Request guideΒΆ

A guide for creating service requests in the CommerceBlock 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 PERMISSION assets in order to create requests. This can be done by paying to an address generated by the node or import a private key from another wallet.

  1. Create a request

The following script can be used to create a request. The following parameters need to be filled:

  • Client chain genesis hash
  • Number of tickets
  • Fee percentage paid
  • Start block height
  • End block height
  • Starting auction price
  • Auction decay constant
shopt -s expand_aliases

alias ocl="ocean-cli -rpcport=7043 -rpcuser=ocean -rpcpassword=oceanpass"

echo "Creating request in service chain"

# Address permission tokens will be locked in
pub=`ocl validateaddress $(ocl getnewaddress) | jq -r ".pubkey"`
# Get permission asset unspent
unspent=`ocl listunspent 1 9999999 [] true "PERMISSION" | jq .[0]`
value=`echo $unspent | jq -r ".amount"`
txid=`echo $unspent | jq ".txid"`
vout=`echo $unspent | jq -r ".vout"`

# Provide the `txid` and `vout` for that transaction
# The output can be spent after the locktime is expired
# e.g.
# txid="\"1d91bae7353c0b1fb7178b92b642746ea4ace1d79e1c5d3c680526ef9f4589a7\""
# vout=0
# value=210000

# Client chain genesis block hash
# Request start height
# Request end height
# Number of tickets
# Starting price
# Fee percentage paid
# Decay constant

# Generate and sign request transaction

signedtx=`ocl signrawtransaction $(ocl createrawrequesttx $inputs $outputs)`
txid=`ocl sendrawtransaction $(echo $signedtx | jq -r ".hex")`
echo "txid: $txid"
  1. Monitor a request

Check that a request has been included in the chain using:

ocean-cli getrequests

Download the report script, replace the txid parameter with the request id parameter and run this script to monitor the guardnode response performance and pays due to be paid to each by the end of the service. This information will only become available once the service request has started.