Simple Across Relayer is a minimal bot for relaying tokens across multiple blockchains in Across. For more detailed customization, use the bot provided by Across.
Run the following command to install dependencies:
$ pnpm install
Copy the .env.example
file to create a .env
file and set the necessary environment variables.
$ cp .env.example .env
In the .env
file, set the RPC provider URLs and the private key for each blockchain.
Copy the sample.config.json
file to create a config.json
file
$ cp sample.config.json config.json
The config.json
file contains settings for source chains and destination chains. Below are detailed explanations of each configuration item.
- Type:
boolean
- Description: Specifies whether to enable simulation mode. If
true
, actual transactions will not be sent.
- Type:
Array
- Description: Settings for source chains. Each chain configuration includes the following items:
chainId
: Specifies the chain ID.pollingInterval
: Specifies the interval (in milliseconds) for polling the blockchain state.webSocket
: Specifies whether to use websocket to get on-chain events.confirmation
: Specifies the number of blocks required for transaction confirmation. The key is the transaction amount, and the value is the number of blocks required for confirmation.
"srcChains": [
{
"chainId": 1,
"pollingInterval": 1000,
"webSocket": true,
"confirmation": {
"100": 1,
"1000": 2
}
},
...
]
- Type:
Array
- Description: Settings for destination chains. Each chain configuration includes the following items:
chainId
: Specifies the chain ID.supportTokens
: Specifies the list of supported tokens. Each token configuration includes the following items:address
: Specifies the contract address of the token.symbol
: Specifies the symbol of the token.decimals
: Specifies the decimals of the token.minAmount
: Specifies the minimum amount of the token to be sent.maxAmount
: Specifies the maximum amount of the token to be sent.
"dstChains": [
{
"chainId": 8453,
"supportTokens": [
{
"address": "0x4200000000000000000000000000000000000006",
"symbol": "WETH",
"decimals": 18,
"minAmount": 0.0001,
"maxAmount": 1
}
]
},
...
]
Compiles TypeScript files and outputs them to the dist
directory.
$ pnpm run build
Builds the project and starts the relayer.
$ pnpm run start
Watches TypeScript files in the src
directory and automatically restarts on changes.
$ pnpm run dev
Formats the code using Prettier.
$ pnpm run format
Lints the code using ESLint.
$ pnpm run lint
Automatically fixes linting issues using ESLint.
$ pnpm run lint:fix