Guardnode guide

A step by step guide for setting up the Guardnode stack that includes a CommerceBlock service chain full node, a client chain full node and guardnode daemon guardning the client chain.

1. Running the service chain full node

Download the docker-compose file from ocean github and follow the docs instructions on how to run the node using data persistence.

The full node wallet will need to be funded with CBT in order to provide services. This can be done by paying to an address generated by the node or import a private key from another wallet.

Use the command line interface to find about active requests:

ocean-cli getrequests

(Under development) Also possible with the dedicated guardnode electrum wallet.

2. Running the client chain node

Pick one of the active requests with an active auction and run the client chain full node for this chain request by downloading the guardnode repo and running the corresponding docker-compose file in the contrib directory.

(Under development) Also available in the CB services platform.

Start the client ocean node:

docker-compose -f contrib/docker-compose-filename.yml up -d ocean

Using the client chain node generate a pubkey to receive fee rewards on:

addr=`ocean-cli getnewaddress`
pub=`ocean-cli validateaddress $addr | jq -r ".pubkey"`
echo $pub

3. Bid for a request

The create_bid.sh script can be used to bid for an active request. It will build, sign and send a bid transaction for an in auction request corresponding to the given gensis hash, funded by a utxo owned by the local wallet. The following parameters must be provided:

  • Client chain genesis hash
  • Fee pubkey generated previously
  • Fee size of bid transaction
  • Maximum bid amount (Optional)
  • txid of specified UTXO to fund bid transaction (Optional)
  • vout of specified UTXO to fund bid transaction (Optional)

Node connection information must be set via ENV variables:

Env variable Decription
RPC_CONNECT RPC address
RPC_PORT RPC port
RPC_USER RPC username
RPC_PASS RPC password

4. Running the guardnode service

Verify that the bid has been approved by using the service node:

ocean-cli getrequestbids $requesttxid

Once verified fill the bidpubkey and bidpubkey arguments on the docker-compose file downloaded for the client chain under guardnode and start the guardnode service by:

docker-compose -f contrib/docker-compose-filename.yml up -d guardnode

Monitor the logs using:

docker-compose -f contrib/docker-compose-filename.yml logs --follow guardnode

and look out for any alerts