This project allows deploying iExec voucher related contracts and associated subgraph on a bellecour forked test chain (anvil).
docker build . --no-cache -t voucher-deployer
Prerequisites:
bellecour-fork
: ethereum test node (anvil, hardhat) forking bellecour blockchain runninggraphnode
: thegraph node connected tobellecour-fork
runningipfs
: ipfs node for subgraph upload running
Environments:
RPC_URL
:bellecour-fork
RPC urlFORCE_POCO_UPGRADE
: boolean set it totrue
to force the PoCo upgrade, use this to test next PoCo version (defaultfalse
)VOUCHER_HUB_ADDRESS
: address of an already deployedVoucherHub
, if set along withVOUCHER_HUB_START_BLOCK
skipsVoucherHub
deployment (default unset)VOUCHER_HUB_START_BLOCK
: number of the block to start indexingVoucherHub
, if set along withVOUCHER_HUB_ADDRESS
skipsVoucherHub
deployment (default unset)SKIP_SUBGRAPH
: boolean set it totrue
to disable the subgraph deployment (defaultfalse
)GRAPHNODE_URL
:graphnode
admin urlIPFS_URL
:ipfs
admin url
docker run --rm \
-e RPC_URL=<bellecour-fork-url> \
-e GRAPHNODE_URL=<bellecour-fork-graphnode-url> \
-e IPFS_URL=<ipfs-node-url> \
-v $PWD/out:/app/out \
voucher-deployer
Output:
- when
FORCE_POCO_UPGRADE
is true (deploy PoCo upgrade)PoCo.git-log
: git logs PoCo
- when
VOUCHER_HUB_ADDRESS
orVOUCHER_HUB_START_BLOCK
is not set (deploy VoucherHub)iexec-voucher-contracts.git-log
: git logs iexec-voucher-contractsVoucherHub.address
: address of the deployed VoucherHub contractVoucherHub.block
: block number of VoucherHub contract deployment
npm run test
this will start a local docker bellecour-fork
, a graphnode
and ipfs
and run the voucher-deployer
once finished, the VoucherHub is deployed on bellecour-fork
at address in ./test/out/VoucherHub.address
and indexed by the subgraph at http://localhost:8000/subgraphs/bellecour/iexec-voucher/graphql.
you can interact with the deployed VoucherHub
using scripts in test/test-scripts
.
# install deps
cd test/test-scripts
npm ci
# interact
node createVoucherType.js
node addEligibleAsset.js
node createVoucher.js
# ...
terminate the local environment by running
npm run stop-test-stack