Stateless bot monitors GraphQL endpoint for new events MessageSent that occurs on Polygon network. And then transfers proof to Ethereum root contract.
We use Ape as the testing and deployment framework of this project.
To install pre-commit locally:
pre-commit installexport WEB3_INFURA_PROJECT_ID=<Infura project ID>
export APE_ACCOUNTS_BOT_PASSPHRASE=<Passphrase for account with alias BOT>
export ETHERSCAN_API_KEY=<API Key for Etherscan>
ape run proof_bot --fx-root-tunnel 0x51825d6e893c51836dC9C0EdF3867c57CD0cACB3--graphql-endpoint https://subgraph.satsuma-prod.com/735cd3ac7b23/nucypher-ops/PolygonChild/api --proof-generator https://proof-generator.polygon.technology/api/v1/matic/ --network ethereum:mainnet:infura --account BOTdocker build -f deploy/Dockerfile -t nucypher/train45:latest .First, create the log file:
touch /var/log/cron.logThen run the bot:
docker run \
--name train45 \
--detach \
--env-file .env \
-f deploy/Dockerfile \
-v /var/log/cron.log:/var/log/cron.log \
-v /var/log/:/var/log/ \
-v ~/.ape/:/root/.ape \
nucypher/train45:latestEnjoy the logs:
tail -f /var/log/cron.logdocker stop train45 && docker rm train45docker-compose buildFirst, create the log file:
touch /var/log/cron.logThen run the bot with docker-compose (including log server and autoupdate service):
docker-compose up -ddocker-compose down