Mirroring https://github.com/pyth-network/pyth-crosschain

Leo e39fb2abec Update README.md 5 years ago
bridge a3c745ace7 bridge/pkg/ethereum: remove channel unsubscribes 5 years ago
devnet 7545d2b803 terra: disable in production mode 5 years ago
docs dc82826ef3 Update overview image to properly describe Terra flow 5 years ago
ethereum 114524a096 ethereum: update packages and use package-lock.json 5 years ago
proto 66430cb5be bridge: implement guardian set update submission node admin service 5 years ago
scripts 66430cb5be bridge: implement guardian set update submission node admin service 5 years ago
solana fdc2be10b3 solana: verify that new guardian set isn't empty 5 years ago
terra 84600ad9f5 terra: include block timestamp in VAAs (#94) 5 years ago
third_party cee28540bd Upgrade SDK; add balance rpc call (#80) 5 years ago
tools 35d265b9c8 tools: build with -mod=readonly 5 years ago
web cc1dcf0867 web: clarify some headings 5 years ago
.gitignore 7993a72dea Add VAA serialization logic 5 years ago
DEVELOP.md da768a09c4 ethereum: mine ganache blocks in the background 5 years ago
Dockerfile.agent d8c9b41a01 Add builds for protos and the Solana agent 5 years ago
LICENSE 2c2a3c6c8e Add Apache2 license 5 years ago
README.md e39fb2abec Update README.md 5 years ago
Tiltfile 3264f7622d terra: split and clean up k8s configs 5 years ago
buf.yml d8c9b41a01 Add builds for protos and the Solana agent 5 years ago
dev-install.sh 863e1c038b dev-install.sh: update to k3s v1.19.3+k3s2 5 years ago
generate-abi.sh 12873e5819 Add tooling to regenerate the Go ABI 5 years ago
generate-protos.sh d151c95d82 node.proto stub and dependencies 5 years ago

README.md

Wormhole

Read our introduction blog article for more details on Wormhole and its major design decisions.

See DEVELOP.md for instructions on how to set up a local devnet.

Audit / Feature Status

Feature Maintainer Auditor Status
Ethereum contract Certus One Kudelski ✔️ Audited
Solana contract Certus One Kudelski ✔️ Audited
Bridge node Certus One Kudelski 🚧 In Progress
Terra contract Everstake Kudelski ⚠ Pending

Repo overview

  • bridge/ — The guardian node which connects to both chains, observes lockups and submits VAAs. Written in pure Go.

    • cmd/ - CLI entry point, deals with the mechanics of parsing command line flags and loading keys.
    • pkg/processor — Most of the business logic for cross-chain communication lives here. Talks to multiple loosely coupled services communicating via Go channels.
    • pkg/p2p — libp2p-based gossip network.
    • pkg/devnet — Constants and helper functions for the deterministic local devnet.
    • pkg/ethereum — Ethereum chain interface with auto-generated contract ABI. Uses go-ethereum to directly connect to an Eth node.
    • pkg/solana — Solana chain interface. Light gRPC wrapper around a Rust agent (see below) which actually talks to Solana.
    • pkg/supervisor — Erlang-inspired process supervision tree imported from Certus One's internal code base. We use this everywhere in the bridge code for fault tolerance and fast convergence.
    • pkg/vaa — Go implementation of our VAA structure, including serialization code.
  • ethereum/ — Ethereum wormhole contract, tests and fixtures.

    • contracts/ — Wormhole itself, the wrapped token and helper libraries.
    • migrations/ — Ganache migration that deploys the contracts to a local devnet. This is the starting point for both the tests and the devnet. Note that devnet and tests result in different devnet states.
    • src/send-lockups.js — Sends ETH lockups in a loop. See DEVELOP.md for usage.
  • solana/ — Solana sidecar agent, contract and CLI.

    • agent/ — Rust agent sidecar deployed alongside each Guardian node. It serves a local gRPC API to interface with the Solana blockchain. This is far easier to maintain than a pure-Go Solana client.
    • bridge/ — Solana Wormhole smart contract code.
    • cli/ — Wormhole user CLI tool for interaction with the smart contract.
    • devnet_setup.sh — Devnet initialization and lockup generator (the Solana equivalent to the Ganache migration + send-lockups.js). Runs as a sidecar alongside the Solana devnet.
  • proto/ — Protocol Buffer definitions for the P2P network and the local Solana agent RPC. These are heavily commented and a good intro.

  • third_party/ — Build machinery and tooling for third party applications we use.

    • abigen/ — Reproducible build for the go-ethereum ABI code generator we use.
    • solana/ — Build for the full Solana project plus a floating patchset we maintain while waiting for features to be implemented in the upstream project.
  • docs/ — Operator documentation and project specs.

  • web/ — User interface for cross-chain transfers. Not yet wired into the local devnet. Uses Metamask and Web3.js to initiate transfers from a browser. Watch this video as an introduction.

  • tools/ — Reproducible builds for local development tooling like buf and protoc-gen-go.

  • Tiltfile, devnet/ and various Dockerfiles — deployment code and fixtures for local development. Deploys a deterministic devnet with an Ethereum devnet, Solana devnet, and a variably sized guardian set that can be used to simulate full cross-chain transfers. The Dockerfiles are carefully designed for fast incremental builds with local caching, and require a recent Docker version with Buildkit support. See DEVELOP.md for usage.

  • generate-abi.sh and generate-protos.sh — Helper scripts to (re-)build generated code. The Eth ABI is committed to the repo, so you only need to run this script if the Wormhole.sol interface changes. The protobuf libraries are not committed and will be regenerated automatically by the Tiltfile.