Across

How to verify Across Bundles

Step 1: Install Required Dependencies:

git:

yarn:

node.js

  • Run the following command to check what version of node you are running: node -v Make sure it is greater than 16.18.0.

redis:

ts-node

  • You can use the following to install globally: npm install -g ts-node

Nvm (optional)

VS Code (optional)

  • Highly recommend using a code editor like VS code.

Step 2: Clone the relayer-v2 repo:

  • If using VS code, open the terminal and run the following command:

Step 3: Run Redis

Open a terminal window and run:

Step 4: Environment Variables

  • Change the .env.example file to .env

  • In line 8 and 9, uncomment either the MNEMONIC or PRIVATE_KEY and input a private key that has no money on it.

    • I used https://vanity-eth.tk/ to create a private key to use for the demo but again, do not use one that has any money on it as it is an unnecessary risk.

  • Sign up for an Infura account https://www.infura.io/ and click ‘Create New API Key’. After you create the key, you should see a list of endpoints for each network.

  • In the .env file, update the following env variables to the URL for your infura account. The underscore number at the end of the variable represents the chain ID. So RPC_PROVIDER_ALCHEMY_1 is mainnet.

    • You can use https://chainlist.org/ to find the ID by network.

    • Include the NODE_URL_324 for zksync below even though it hasn’t been added to the .env.example file yet:

Step 5: Run the script

The below is an example, however the two changes that need to be made based on the request are:

  • REQUEST_TIME=CHANGE_THIS_TO_THE_TIMESTAMP

  • I used privateKey for the below, however, if you used mnemonic in your env variables, it should be changed to –wallet mnemonic

Note: The first time you run this, it is going to take a long time.

REQUEST_TIME=1692110627 ts-node ./src/scripts/validateRootBundle.ts --wallet privateKey

When the script finishes running, check the Validation results as shown below. The below shows an example of an invalid bundle as it shows “valid”: false:

Appendix

For additional documentation on Across root bundles, visit:

https://docs.across.to/v/developer-docs/how-across-works/overview/disputing-root-bundles https://docs.across.to/v/developer-docs/how-across-works/overview/validating-root-bundles

Last updated

Was this helpful?