Run A Full Node
Last updated
Last updated
Run the following command to connect to the KCC mainnet:
And if you want to connect to the KCC testnet, you can use the following command instead:
In the following sections, we will only talk about the mainnet. However, all the following commands will work on testnet, except that you should add an extra --testnet
option.
With the commands above, you can only access your RPC servers from the same machine that runs your node. If you want to make your RPC servers publicly accessible, you need to specify the listening addresses of your RPC servers:
Your node could be vulnerable if you make your RPC servers publicly accessible.
The state is a snapshot of all accounts on KCC, which includes the balance and nonce of each account, the code of each contract, and the storage of each smart contract. If you want to query the historical state at some block, you can replay all the transactions starting from the genesis block to reconstruct the state at that block. However, if you want to save all states on your disk, that would take a lot of disk space. Therefore, although a full node saves all the historical blocks and receipts, it does not hold all the historical states.
Nevertheless, in some scenarios, you want to save all the historical states on your disk. For example, you are building some analyzing system that frequently queries the historical states, and you don't want to waste time reconstructing the historical states. You can run an archive node as follows:
We highly recommend managing your node with a process manager. A process manager watches your node client process, collects and rotates the logs, and restarts your node if needed. Here is a list of some popular process managers:
The entry point of our docker image is geth
, so it is quite straightforward to run your node in a docker container:
"geth" is the client binary you have built or installed in . If it is not in one of your $PATH, you should use an absolute path (i.e., /path/to/geth
) Instead.
If you want to access your node through the , you can use the following command to enable the HTTP and WebSocket RPC servers: