basics publisher and peer nodes - SkycoinWikis/CXChains GitHub Wiki

CXCHAINS HOME » CX » CX CHAINS » PUBLISHER AND PEER NODES

Publisher and Peer Nodes

A CX chain works by using the Skycoin platform. In order to start broadcasting transactions and storing them on a blockchain, you need to have a publisher and a peer node. The publisher node is in charge of signing the blocks that are being created on the blockchain, while the peer node has the purpose of receiving the transactions and running them against the current program state of a CX chain.

In order to start a publisher node, the --publisher flag needs to be given to the cx command. For example:

cx --publisher --genesis-address $GENESIS_ADDRESS \
   --genesis-signature $GENESIS_SIGNATURE \
   --secret-key $SECRET_KEY \
   --public-key $PUBLIC_KEY

In the case of a peer node, the --peer flag is given to the cx command. For example:

cx --peer --genesis-address $GENESIS_ADDRESS \
   --port 6001 \
   --genesis-signature $GENESIS_SIGNATURE \
   --public-key $PUBLIC_KEY

The data directory for the publisher node is stored at $HOME/.cxcoin, while the data directory for the peer node is stored at tmp/6001. This will be changed in the future, as the peer node's data will be deleted every time the server storing the data directory is rebooted.

Note that if a new CX chain (a different blockchain code) needs to be created, the data directory of the peer node is required to be manually deleted (for example, by running the command rm -r /tmp/6001).

NEXT ->