KalyChain Documents
  • KalyChain
  • Quick Start
    • Whats is KalyChain
    • Install
    • Start Node
    • How To
    • Genesis File
  • Consensus
    • Proof of Authority (PoA)
    • QBFT
    • Validators
    • Bootnodes
  • Transactions
    • Transaction pool
    • Transaction types
    • Transaction Validation
  • Operate a node
    • Data storage formats
    • Events and logs
    • Backup/restore node instance
    • Add and remove validators without voting
  • JSON RPC Commands
    • Access Logs
    • Authenticate
    • Graphql
    • JSON RPC
    • RPC Pub/Sub
Powered by GitBook
On this page
  • Prerequisites
  • Local block data
  • Genesis configuration
  • Confirm node is running
  • Run a node for testing
  • Run a node
  1. Quick Start

Start Node

Starting KalyChain

PreviousInstallNextHow To

Last updated 2 years ago

Prerequisites

Local block data

When connecting to a network other than the network previously connected to, you must either delete the local block data or use the option to specify a different data directory.

To delete the local block data, delete the database directory in the kaly/build/distribution/kaly-<version> directory.

Genesis configuration

To define a genesis configuration, create a (for example, genesis.json) and specify the file using the option.

When you specify , KalyChain uses the development mode genesis configuration with a fixed low difficulty. A node started with has an empty bootnodes list by default.

Confirm node is running

If you started Kaly with the option, use to call to confirm the node is running.

!!!example

* `eth_chainId` returns the chain ID of the network.

    ```bash
    curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' localhost:8545
    ```

* `eth_syncing` returns the starting, current, and highest block.

    ```bash
    curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' localhost:8545
    ```

    For example, after connecting to Mainnet, `eth_syncing` will return something similar to:

    ```json
    {
      "jsonrpc" : "2.0",
      "id" : 1,
      "result" : {
        "startingBlock" : "0x0",
        "currentBlock" : "0x2d0",
        "highestBlock" : "0x66c0"
      }
    }
    ```

Run a node for testing

To run a node that mines blocks at a rate suitable for testing purposes:

kaly --network=dev --miner-enabled --miner-coinbase=0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --host-allowlist="*" --rpc-ws-enabled --rpc-http-enabled --data-path=/tmp/tmpDatdir

You can also use the following configuration file on the command line to start a node with the same options as above:

network="dev"
miner-enabled=true
miner-coinbase="0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"
rpc-http-cors-origins=["all"]
host-allowlist=["*"]
rpc-ws-enabled=true
rpc-http-enabled=true
data-path="/tmp/tmpdata-path"

Run a node

To run a node on KalyChain network specifying a genesis file and data directory:

kaly --genesis-file=<path>/genesis.json --data-path=<data-path> --rpc-http-enabled --bootnodes=<bootnodes>

Where <data-path> is the path to the directory to save the chain data to. Ensure you configure a peer discovery method, such as

Kaly installed
--data-path
genesis file
--genesis-file
--network=dev
--network=dev
--rpc-http-enabled
cURL
JSON-RPC API methods
bootnodes