# your DSP's API endpointexport DSP_ENDPOINT=# a new account to deploy your contract toexport ACCOUNT=# your new account's active public keyexport ACTIVE_PUBLIC_KEY=# compile coldtoken contractzeuscompilecdcontracts/eos# set eosio.code permissioncleos -u $DSP_ENDPOINT set account permission $ACCOUNT active "{\"threshold\":1,\"keys\":[{\"weight\":1,\"key\":\"$ACTIVE_PUBLIC_KEY\"}],\"accounts\":[{\"permission\":{\"actor\":\"$ACCOUNT\",\"permission\":\"eosio.code\"},\"weight\":1}]}" owner -p $ACCOUNT@active
# set contractcleos-u $DSP_ENDPOINT setcontract $ACCOUNT ./coldtoken
Select and stake to DSP:
# your DSP's accountexport DSP_ACCOUNT=# your DSP's serviceexport DSP_SERVICE=# your DSP's packageexport DSP_PACKAGE=# your DSP's minimum stake quantity in DAPP or DAPPHDL (example: 10.0000 DAPP or 10.0000 DAPPHDL)export MIN_STAKE_QUANTITY=# select DSP packagecleos -u $DSP_ENDPOINT push action dappservices selectpkg "{\"owner\":\"$ACCOUNT\",\"provider\":\"$DSP_ACCOUNT\",\"service\":\"$DSP_SERVICE\",\"package\":\"$DSP_PACKAGE\"}" -p $ACCOUNT
# stake to DSP package with DAPPcleos -u $DSP_ENDPOINT push action dappservices stake "{\"owner\":\"$ACCOUNT\",\"provider\":\"$DSP_ACCOUNT\",\"service\":\"$DSP_SERVICE\",\"quantity\":\"$MIN_STAKE_QUANTITY\"}" -p $ACCOUNT
# stake to DSP package with DAPPHDL, only available on mainnetcleos -u $DSP_ENDPOINT push action dappairhodl1 stake "{\"owner\":\"$ACCOUNT\",\"provider\":\"$DSP_ACCOUNT\",\"service\":\"$DSP_SERVICE\",\"quantity\":\"$MIN_STAKE_QUANTITY\"}" -p $ACCOUNT
Run test commands:
When running the test commands, if you're using leap version 3.0.0+ you'll need to add --use-old-send-rpc -t false to the cleos command to not use the send_transaction2 rpc by default as seen below. If using the legacy eos software, that flag is not required.
# you must be in the root of the box to run this commandcd../../zeusget-table-row $ACCOUNT "accounts" $ACCOUNT "TEST"--endpoint $DSP_ENDPOINT |python-mjson.tool# with curl:curl http://$DSP_ENDPOINT/v1/dsp/ipfsservice1/get_table_row -d '{"contract":"CONTRACT_ACCOUNT","scope":"SCOPE","table":"TABLE_NAME","key":"TABLE_PRIMARY_KEY"}' | python -m json.tool
vRAM related actions to look for in a block explorer:
Look for “xcommit” and “xcleanup” actions on your contract: https://bloks.io/
xcommit - The commit request instructs a DSP to write new data to their local IPFS cluster node. A developer can utilize the setData function from within their smart contract to first hash the new data in order to return a URI, before dispatching a commit request which is caught by the DSP node. In a similar way the getData function can be utilized in order to fetch the data for the smart contract or request a Warmup in case it is missing.
xcleanup - A cleanup request sends a request to the DSP to evict a file from the cache. This is an asynchronous request.
More information on vRAM related actions can be found here