This is a demonstration of token transfer using IBC between a Harmony network and a Cosmos-based blockchain.
- We use yui-ibc-solidity for IBC core and our customed tendermint-sol as a Tendermint light client on Harmony
- We use ibc-harmony-client as a Harmony light client on Cosmos-based blockchain
- contracts ... contracts and migration scripts for harmony
- relayer ... IBC relayer using yui-relayer
- chains/harmony ... harmony modules
- chains/tendermint ... tendermint modules for tendermint-sol
- tests ... test environments
- cases ... E2E test case
- chains/harmony ... configs for harmony localnet
- chains/tendermint ... configs for tendermint localnet
- bash 4.0 or higher
- golang 1.16 or higher
- node.js 16
Example:
# assume that RPC port offset is 500
export HARMONY_LOCAL_SHARD_0_URL=http://localhost:9598
export HARMONY_LOCAL_SHARD_1_URL=http://localhost:9596
export HARMONY_GAS_LIMIT=100000000
export HARMONY_GAS_PRICE=1000000000
# used for deploying contracts
# cf. https://github.com/harmony-one/harmony/pull/3332
export HARMONY_LOCAL_PRIVATE_KEY: '0x1f84c95ac16e6a50f08d44c7bde7aff8742212fda6e4321fde48bf83bef266dc'
Harmony localnet url is configured based on tests/chains/harmony/configs/localnet_deploy.config.
Relayer needs libraries for harmony. At first, we need to build the libraries.
make clone-harmony
make build-harmony
Then, we will get a relayer with the following command.
make build-relayer
The following commands creates a Harmony localnet docker image with deployed contracts.
cd tests/chains/harmony
make docker-image
The following command creates a Cosmos local network image.
cd tests/chains/tendermint
make docker-image
The following commands brings up the two networks, performs an IBC Handshake, and transfers token.
cd tests/cases/tm2harmony
make network
make test
make network-down