fabric tendermint cross demo

This is an example application for an atomic swap through Cross-chain transaction using Cross Framework between Hyperledger Fabric and Tendermint.

As Atomic commit protocol, Simple commit protocol is used.

Requirements

Install required tools

The below command installs Relayer, Fabric tools, Fabric CLI, Tendermint CLI

# install fabric tools and build Fabric/Tendermint CLI, Relayer
make -C demo build -j5

Chains

Chain Node Role Application
Tendermint 1 Node Coordinator/Participant ERC-20 based on CDT Module
Fabric 1 Orderer, 3 Peers Participant ERC-20 based on CDT Module

Directory structure

  • cmds
    • alpha … Tendermint CLI
    • beta … Fabric CLI
  • contracts
    • erc20 … contract modules for Tendermint/Fabric
  • demo … demo environment including
    • chains
      • fabric … fabric-related files including docker-compose.yaml for network
        • chaincode
          • fabibc … fabric chaincode application
      • tendermint … tendermint simapp working as CLI and tendermint application including docker-compose.yaml for network
    • configs … config files for alpha cli, beta cli, fabric app, relayer
    • scripts … shell scripts for alpha cli, beta cli, relayer, scenario
  • relayer … Relayer CLI

How tools work

  • Relayer
    • relaying packets between different chains
  • Fabric tools
    • genesis block generation
    • configuration of a channel
    • cryptographic generation
    • deployment of chaincode
  • Fabric CLI
    • creating tx, submitting tx, querying tx on Fabric node
  • Tendermint CLI
    • creating tx, submitting tx, querying tx on Tendermint node

Startup fabric and tendermint network

# prepare fabric network and tendermint network using docker containers
make -C demo network

Testing the demo

# initialize relayer, fabric CLI, tendermint CLI, and run handshake for IBC between fabric and tendermint by creating transactions.
make -C demo run-init
# run ./scripts/scenario/sample-scenario. See the `About sample-scenario` section for more detail.
make -C demo run

End network

# down related containers, remove volumes
make -C demo network-down
# remove any generated data
make -C demo clean

Restart network if needed

make -C demo network-down
make -C demo clean
make -C demo network

About sample-scenario

See About sample-scenario

READMEs

Additional information can be found below.

GitHub

View Github