witness_node is the GXChain-node program that contains blockchain core features such as packing blocks, verification blocks, and state storage.Starting the
witness_node program with the
help parameter will output all the commands supported by the tool. The following is an example of how to start the common functions.
1. replay blockchain
Rebuild object graph by replaying all blocks
./programs/witness_node/witness_node --replay-blockchain --fast-replay
fast-replay:no sleep while replaying block blocks
2. resync blockchain
Delete all blocks and re-sync with network from scratch
On the GXChain main-net, this file is built in, no need to specify it manually.
#File to read Genesis State from genesis-json ./programs/witness_node/witness_node --genesis-json genesis.json
4. API Server
Endpoint for websocket RPC to listen on
5. P2P Server
Endpoint for P2P node to listen on
6. Seed Nodes
P2P nodes to connect to on startup (may specify multiple times)
Directory containing databases,configuration file, etc.
witness_nodeis not running in the background, execute
Ctrl + Conce and then wait for the program to save the memory data and then exit automatically.
witness_nodeis running in the background, execute
kill -s SIGINT $(pgrep witness_node), and wait for the program to save the memory data and then exit automatically. You can't use
kill -9, otherwise the next time you start the index, the index will be rebuilt.