Replay Contract

As a DSP, you will want the ability to replay a contract’s vRAM (IPFS) related transactions to load that data into your IPFS cluster. We provide a file that does just that replay-contract.js.

To do this you will need to sign up for an API key from dfuse.io, you can select the Server to Server option from the dropdown when creating it. Dfuse offers free keys that last 24 hours, so there’s no need to pay.

There are some mandatory and optional environment variables.

Mandatory:

export DFUSE_API_KEY=
# contract to replay
export CONTRACT=
export NODEOS_CHAINID="aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906" # < mainnet | kylin > "5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191"

Optional:

export LAST_BLOCK= # defaults to 35000000, this is the last block to sync from, find the first vRAM transaction for the contract and set the block before it
export DFUSE_ENDPOINT= # defaults to 'mainnet.eos.dfuse.io', can set to `kylin.eos.dfuse.io`
export BLOCK_COUNT_PER_QUERY= # defaults to 1000000
export NODEOS_SECURED= # defaults to true
export NODEOS_HOST= # defaults to localhost
export NODEOS_PORT= # defaults to 13115

Once you’ve set those, simply run with:

sudo find / -name replay-contract.js
node /root/.nvm/versions/node/v10.16.0/lib/node_modules/@liquidapps/dsp/utils/ipfs-service/replay-contract.js

# sent 6513 saved 7725.26KB 6.42KB/s Block:77756949