Code Monkey home page Code Monkey logo

train45's Introduction

State Transfer Bot Polygon → Ethereum

Stateless bot monitors GraphQL endpoint for new events MessageSent that occurs on Polygon network. And then transfers proof to Ethereum root contract.

Installation

We use Ape as the testing and deployment framework of this project.

Configuring Pre-commit

To install pre-commit locally:

pre-commit install

Example of usage

export 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/exit-payload/ --network ethereum:mainnet:infura --account BOT

Docker

Build
docker build -f deploy/Dockerfile -t nucypher/train45:latest .
Run

First, create the log file:

touch /var/log/cron.log

Then 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:latest

Enjoy the logs:

tail -f /var/log/cron.log
Stop
docker stop train45 && docker rm train45

Docker-compose

Build
docker-compose build
Start (all services)

First, create the log file:

touch /var/log/cron.log

Then run the bot with docker-compose (including log server and autoupdate service):

docker-compose up -d
Stop (all services)
docker-compose down

train45's People

Contributors

kprasch avatar vzotova avatar manumonti avatar

Watchers

Justin Holmes avatar  avatar MacLane S Wilkison avatar David Núñez avatar tux  avatar James Campbell avatar Derek Pierre avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.