trustless-generic-relayer/offchain-relayer
A5 Pickle 0b9e81ffc5
Clean up send (#2)
* Update README.md with trustlessness

* ethereum: rename AllowedEmitterSequence; remove arbitrary payloads

* ethereum: refactor integrator contract; add verifying payload

* ethereum: update IWormhole

* ethereum: add message verifying in mock integration

* Remove deliveryList from DeliveryInstructions and fix stack too deep

* Remove maximum batch size from relay parameters

* ethereum: fix observation loop; formatting

* sdk: fix eth-integration test

* offchain-relayer: add regenerate-abi.sh

* fix Makefile

* offchain-relayer: add relayer.tilt.yaml

Co-authored-by: Evan Gray <56235822+evan-gray@users.noreply.github.com>
Co-authored-by: A5 Pickle <a5-pickle@users.noreply.github.com>
Co-authored-by: gator-boi <gator-boi@users.noreply.github.com>
2022-10-06 12:16:57 -05:00
..
.vscode add offchain-relayer (#10) 2022-09-30 12:58:39 -05:00
relay Clean up send (#2) 2022-10-06 12:16:57 -05:00
.gitignore Clean up send (#2) 2022-10-06 12:16:57 -05:00
README.md add offchain-relayer (#10) 2022-09-30 12:58:39 -05:00
get-addresses.sh Clean up send (#2) 2022-10-06 12:16:57 -05:00
go.mod add offchain-relayer (#10) 2022-09-30 12:58:39 -05:00
go.sum add offchain-relayer (#10) 2022-09-30 12:58:39 -05:00
main.go add offchain-relayer (#10) 2022-09-30 12:58:39 -05:00
regenerate-abi.sh Clean up send (#2) 2022-10-06 12:16:57 -05:00
relayer.tilt.yaml Clean up send (#2) 2022-10-06 12:16:57 -05:00
start-relayer.sh add offchain-relayer (#10) 2022-09-30 12:58:39 -05:00

README.md

prereqs

  • tilt up and running with the Spy relayer enabled (--spy_relayer=True).
  • the CoreRelayer deployed to tilt.
  • Golang >= 1.17
  • jq installed and available in your path

relayer config

Config like contract addresses and RPC endpoints gets read from the .relayer.yaml file. any of the args can also be passed at runtime to override the values from the yaml file.

start the relayer

./start-relayer.sh

creating Go clients from ABIs

CoreRelayer

jq '.abi' ./ethereum/build/CoreRelayer.sol/CoreRelayer.json | docker run -i --rm  -v $(pwd):/root -u $(id -u):$(id -g)  ethereum/client-go:alltools-stable abigen --abi - --pkg core_relayer --type CoreRelayer --out /root/offchain-relayer/relay/ethereum/core_relayer/abi.go

get the deployed replayer contract address

CHAINID=1337 && jq '.transactions[] | select(.contractName == "ERC1967Proxy") | .contractAddress' ethereum/broadcast/deploy_contracts.sol/$CHAINID/run-latest.json

wormhole ChainID to network ID


        // Wormhole chain ids explicitly enumerated
        if        (chain == 2)  { evmChainId = 1;          // ethereum
        } else if (chain == 4)  { evmChainId = 56;         // bsc
        } else if (chain == 5)  { evmChainId = 137;        // polygon
        } else if (chain == 6)  { evmChainId = 43114;      // avalanche
        } else if (chain == 7)  { evmChainId = 42262;      // oasis
        } else if (chain == 9)  { evmChainId = 1313161554; // aurora
        } else if (chain == 10) { evmChainId = 250;        // fantom
        } else if (chain == 11) { evmChainId = 686;        // karura
        } else if (chain == 12) { evmChainId = 787;        // acala
        } else if (chain == 13) { evmChainId = 8217;       // klaytn
        } else if (chain == 14) { evmChainId = 42220;      // celo
        } else if (chain == 16) { evmChainId = 1284;       // moonbeam
        } else if (chain == 17) { evmChainId = 245022934;  // neon
        } else if (chain == 23) { evmChainId = 42161;      // arbitrum
        } else if (chain == 24) { evmChainId = 10;         // optimism
        } else if (chain == 25) { evmChainId = 100;        // gnosis
        } else {
            revert("Unknown chain id.");
        }