The purpose of this app is to relay Ethereum events coming from ERC20Locker
and EthCustodian
contracts, build proofs
for each and submit it to NEAR.
-
Install packages:
$ yarn install
-
Set the appropriate
relayerNearAccount
address insrc/json/relayer-config.json
file. -
Add to the file your RPC endpoint (with or without API key):
$ echo "WEB3_RPC_ENDPOINT=YOUR_WEB3_RPC_ENDPOINT_HERE" >> .env
RPC access can be easily gained from Alchemy. -
Add path to the Near credentials (e.g. this usually will be at
~/.near-credentials
on Linux
and/Users/<user>/.near-credentials
on MacOS:
$ echo "NEAR_KEY_STORE_PATH=PATH_TO_YOUR_NEAR_CREDENTIALS_HERE" >> .env
To build relayer run:
$ make
To start relayer run:
$ make run START_FROM_BLOCK=<required_block_number_to_start_from_here> NETWORK=<network_name_or_path_to_custom_config>
To restore the last session run:
$ make restore-last-session
Alternatively, you can use the script directly. To get the list of available commands type:
$ node src/index.js --help