`ComponentsVersionsError` when connecting to PXE following the dapp tutorial from docs

I’m facing an issue following the Node.js app that interacts with contracts tutorial from the documentation. I’ve completed the Quick Start guide successfully (created accounts, deployed the token contract, and minted tokens…), and the Aztec sandbox is running without errors.

Now I’m trying to connect to the PXE as described in the tutorial.

When I run this simple script to connect to the PXE:

import { createPXEClient } from '@aztec/aztec.js';

const { PXE_URL = 'http://localhost:8080' } = process.env;

async function main() {
  const pxe = await createPXEClient(PXE_URL);
  const { l1ChainId } = await pxe.getNodeInfo();
  console.log(`Connected to chain ${l1ChainId}`);
}

main().catch(err => {
  console.error(`Error in app: ${err}`);
  process.exit(1);
});

I get this error:

Error in app: ComponentsVersionsError: Expected component version l2ProtocolContractsTreeRoot to be 0x2c8fc46351bda26dff22c6f7d13f51ef1b7b7245475ed6f0857b8aeac417b36f but received 0x26d63d5bcf09b75cc6e123b591dd3e327347d30fe236061f7613ba8d7c5fdac6

My setup:

  • macOS
  • Sandbox installed with bash -i <(curl -s https://install.aztec.network)
  • Running sandbox with aztec start --sandbox
  • The dependencies on my package.json
{
  "dependencies": {
    "@aztec/accounts": "^0.77.0-testnet-ignition.21",
    "@aztec/aztec.js": "^0.77.0-testnet-ignition.21",
    "@aztec/noir-contracts.js": "^0.77.0-testnet-ignition.21"
  }
}

To make sure whether this could work or not, I also tried running the example code directly from the aztec-packages repository (using the VSCode dev container). I ran the reference file at /workspaces/aztec-packages/yarn-project/end-to-end/src/sample-dapp/connect.mjs and got exactly the same error (before I installed the sandbox & ran it).

This seems to be a version mismatch between the PXE client and the sandbox. Does anyone know how to resolve this issue? Is there a specific version of the Aztec libraries I should use? Btw, I have updated my sandbox to the latest version.

Any help would be greatly appreciated! :sweat_smile:

You need to make sure you npm package versions match the version of the sandbox you are running. We dont have a sandbox version 0.77.0-testnet-ignition.21. You can check your sandbox version by running aztec --version

1 Like