npm install
npx hardhat test
configure an .env file to have the values of .env.example and test deploy! (Use a real LayerZero endpoint in place of 0x0000..)
- Deploy both OmniCounters:
npx hardhat --network fuji deploy
npx hardhat --network mumbai deploy
- Set the remote addresses, so each contract can receive messages
npx hardhat --network mumbai omniCounterSetRemote --target-network fuji
npx hardhat --network fuji omniCounterSetRemote --target-network mumbai
- Send a cross chain message from
mumbai
tofuji
!
npx hardhat --network mumbai omniCounterIncrementCounter --target-network fuji
Optionally use this command in a separate terminal to watch the counter increment in real-time.
npx hardhat --network fuji omniCounterPoll
- Deploy both OmniCounters:
npx hardhat --network mumbai deploy
npx hardhat --network fuji deploy
npx hardhat --network bsc-testnet deploy
npx hardhat --network fantom-testnet deploy
- Set the remote addresses, so each contract can receive messages
npx hardhat --network mumbai omniCounterSetRemote --target-network fuji
npx hardhat --network fuji omniCounterSetRemote --target-network mumbai
npx hardhat --network mumbai omniCounterSetRemote --target-network bsc-testnet
npx hardhat --network bsc-testnet omniCounterSetRemote --target-network mumbai
npx hardhat --network mumbai omniCounterSetRemote --target-network fantom-testnet
npx hardhat --network fantom-testnet omniCounterSetRemote --target-network mumbai
- Send a cross chain message from
mumbai
tofuji
!
npx hardhat --network mumbai omniCounterIncrementMultiCounter --target-networks fuji,bsc-testnet,fantom-testnet
Optionally use this command in a separate terminal to watch the counter increment in real-time.
npx hardhat --network fuji omniCounterPoll
npx hardhat --network bsc-testnet omniCounterPoll
npx hardhat --network fantom-testnet omniCounterPoll
For further reading, and a list of endpoint ids and deployed LayerZero contract addresses please take a look at the Gitbook here: https://layerzero.gitbook.io/
npx hardhat --network mumbai omniCounterGetOracle --target-network fantom-testnet
npx hardhat --network mumbai omniCounterSetOracle --target-network mumbai --oracle 0xORACLE_ADDR
Many of the example contracts make use of LayerZeroEndpointMock.sol which is a nice way to test LayerZero locally!