Good projects are built on good tooling. In the case of the Peggy Cosmos <-> Ethereum bridge developer tooling is a particularly complex problem.

If you want to test Peggy end to end you need to build and deploy a full software stack for two different blockchains. For the experienced this represents hours of setup work, for the inexperienced this is an unassailable barrier to contribution.

For this reason we've invested a large amount of work in test tooling for Peggy including an all up integration test that can be run on every commit.

#!/bin/bash
git clone https://github.com/cosmos/peggy/
cd peggy && git checkout althea-peggy
bash tests/all-up-test.sh

This one command will

  • Build the Peggy Cosmos module
  • Build the Peggy Ethereum contract
  • Build the Peggy relayer and validator signer binaries
  • Setup a 3 node Cosmos testnet
  • Setup an Ethereum testnet
  • Deploy the Peggy Ethereum contract
  • Run tests across this testnet.

Right now there isn't too much to test beyond deployment of the components. But as the project progresses we plan on automating every validation we perform so that any developer can have the advantage of an instant testnet.

To access a working development environment, where the Cosmos and Ethereum chains are already running and ready for you to poke around see the developer instructions.

#!/bin/bash
bash ./tests/build-container.sh
bash ./tests/start-chains.sh
#switch to a new terminal and run 
bash ./tests/run-tests.sh
# Or this to access a shell inside the test container
docker exec -it peggy_test_instance /bin/bash 
#Change the code, and when you want to test it again, restart 
bash ./tests/start-chains.sh && bash ./tests/run-tests.sh.

We're organizing development in the Cosmos Peggy Discord channel, so please hop in and ask for tasks, notify us of open pull requests, or just chat. Code can be found at github.com/cosmos/peggy

Right now major next steps include

  • Relayer logic in Rust
  • Transaction batch logic on the Cosmos-sdk side
  • Potential optimizations to the Solidity contract using bit-packing to store sigs
  • Tests for every case where the Solidity contract should throw