Register the Chromia bridge on EVM
To enable transfers between networks, we need to register the Chromia bridge component on the EVM bridge contract so that the EVM side recognizes it.
Prerequisites
Before proceeding, ensure you have the following:
-
Deployment or leasing of the Chromia bridge component completed.
-
MetaMask or a compatible wallet.
-
The
<BRIDGE_DEMO_BRID>
for the Chromia bridge component.
Set the Bridge Chain RID on the EVM bridge contract
Now that we have the Bridge Chain, we need to configure the EVM bridge contract to recognize this blockchain.
First, ensure you are inside the postchain-eif-contracts
directory:
cd postchain-eif/postchain-eif-contracts
Next, run the following command to link the Bridge Chain to the bridge contract:
npx hardhat setBlockchainRid:bridge --network bsc_testnet --address 0x<YOUR_BRIDGE_EVM_ADDRESS> --blockchain-rid 0x<BRIDGE_DEMO_BRID>
Run the following command to link the Bridge Chain to the bridge contract (include
--managed-validator 0x<YOUR_BRIDGE_VALIDATOR_ADDRESS>
if using a managed validator):
npx hardhat setBlockchainRid:bridge --network bsc_testnet --address 0x<YOUR_BRIDGE_EVM_ADDRESS> --blockchain-rid 0x<BRIDGE_DEMO_BRID> --managed-validator 0x<YOUR_BRIDGE_VALIDATOR_ADDRESS>
Remember to add the 0x
prefix when entering <BRIDGE_DEMO_BRID>
to ensure the EVM contract accepts it.
--blockchain-rid 0x....................
This command updates the EVM bridge contract so it recognizes <BRIDGE_DEMO_BRID>
.