automate-chainhooks is a npm script for automation testing of chainhook
- Go to the root of the project and do
npm install
. Make sure you have satisfied the above Prerequisites. - Start ngrok using the command
ngrok http 3006
. Once it starts, provide the ngrok URL in the.env
file forDOMAIN_URL
. This is required to post the result for the http predicates. You can check the ngrok requests atlocalhost:4040
- Run all the predicates:
$ npm run predicates
- Run all the file result predicates:
$ npm run file-predicates
- Run all the POST URL predicates:
$ npm run post-predicates
- Clear all the result files:
$ npm run clear-result-files
- Run transaction predicate for file append and POST
$ predicate=transaction npm run predicates
- Run print-event predicate for file append and POST
$ predicate=print-event npm run predicates
- Run nft-event predicate for file append and POST
$ predicate=nft-event npm run predicates
- Run ft-event predicate for file append and POST
$ predicate=ft-event npm run predicates
- Run contract-deployment predicate for file append and POST
$ predicate=contract-deployment npm run predicates
- Run contract-call predicate for file append and POST
$ predicate=contract-call npm run predicates
- Run block-height predicate for file append and POST
$ predicate=block-height npm run predicates
- Run stx-event predicate for file append and POST
$ predicate=stx-event npm run predicates
Run the bitcoind with ./bitcoind -rpcuser=root -rpcpassword=root
. Set this user and root in Chainhook.toml
file and run the command as chainhook predicates scan ./tests/bitcoin-predicates/ordinals-protocol/ordinals-protocol-file.json --config-path=./Chainhook.toml