Get table
Get table - get-table.js
get-table.jsReads all vRAM tables of a smart contract and stores them with the naming syntax: ${contract_name}-${table_name}-table.json. The script is located in the utils/ipfs-service/get-table.js of an unboxed zeus box.
Mandatory env variables:
# account name vRAM table exists on
export CONTRACT_NAME=
# run script
node zeus_boxes/ipfs-dapp-service/utils/ipfs-service/get-tableOptional env variables (if using non-local nodeos / IPFS instance):
# defaults to all vRam tables in the abi, can be used to target a specific table
export TABLE_NAME=
# defaults to localhost:8888, can be used to specify external nodeos instance
export NODEOS_ENDPOINT=
# defaults to localhost, can be used to specify external IPFS instance
export IPFS_HOST=
# defaults to 5001
export IPFS_PORT=
# defaults to http
export IPFS_PROTOCOL=
# defaults to 1024
export SHARD_LIMIT=
# defaults to false
# produces a ${contractName}-${tableName}-roots.json file which is the table's current entries
# also produces an ipfs-data.json which can be used to recreate the current state of the IPFS table
export VERBOSE=Steps to produce /ipfs-dapp-service/test1-test-table.json file below:
Expected output /ipfs-dapp-service/test1-test-table.json:
If VERBOSE=true, you will also get test1-test-roots.json and ipfs-data.json:
test1-test-roots.json - equivalent of cleos get table test1 test1 test
ipfs-data.json - produces all data necessary to recreate current state of the table, can be used for populating a DSP’s IPFS cluster
Last updated
Was this helpful?