Coder Social home page Coder Social logo

hyperledger-labs / yui-relayer Goto Github PK

View Code? Open in Web Editor NEW
35.0 10.0 28.0 1.56 MB

IBC Relayer implementations for heterogeneous blockchains

License: Other

Makefile 0.68% Go 91.24% Shell 7.80% Dockerfile 0.28%
ibc cosmos-sdk tendermint hyperledger-fabric corda ethereum

yui-relayer's Introduction

Relayer

Test GoDoc

An IBC relayer implementation supports heterogeneous blockchains.

Supported chains

You can find a list of each supported combination of chains and examples of E2E testing with the Relayer here: https://github.com/datachainlab/yui-relayer-build

Compatibility with IBC

The Relayer uses "vX.Y.Z" as its version format. "v0.Y.Z" will be used until the Relayer's core and module interface is stable.

In addition, "Y" corresponds to the specific major version of ibc-go (i.e., "X"). The following table shows the Relayer version and its corresponding ibc-go version.

Relayer ibc-go
v0.5(current branch) v8
v0.4 v7
v0.3 v4
v0.2 v1

Glossary

  • Chain: supports sending a transaction to the chain and querying its state
  • Prover: generates or query a proof of a target chain's state. This proof is verified by on-chain Light Client deployed on the counterparty chain.
  • ProvableChain: consists of a Chain and a Prover.
  • Path: is a path of two ProvableChains that relay packets to each other.
  • ChainConfig: is a configuration to generate a Chain. It requires implementing Build method to build the Chain.
  • ProverConfig: is a configuration to generate a Prover. It also requires implementing Build method to build the Prover.

How to support a new chain

The Relayer can support additional chains you want without forking the repository.

You can use the Relayer as a library to configure your relayer that supports any chain or Light Client. You must provide a module that implements Module interface.

The following is the implementation of the tendermint module:

import (
	codectypes "github.com/cosmos/cosmos-sdk/codec/types"
	"github.com/hyperledger-labs/yui-relayer/chains/tendermint"
	"github.com/hyperledger-labs/yui-relayer/chains/tendermint/cmd"
	"github.com/hyperledger-labs/yui-relayer/config"
	"github.com/spf13/cobra"
)

type Module struct{}

var _ config.ModuleI = (*Module)(nil)

// Name returns the name of the module
func (Module) Name() string {
	return "tendermint"
}

// RegisterInterfaces register the module interfaces to protobuf Any.
func (Module) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
	registry.RegisterImplementations(
		(*core.ChainConfig)(nil),
		&ChainConfig{},
	)
	registry.RegisterImplementations(
		(*core.ProverConfig)(nil),
		&ProverConfig{},
	)
}

// GetCmd returns the command
func (Module) GetCmd(ctx *config.Context) *cobra.Command {
	return cmd.TendermintCmd(ctx.Codec, ctx)
}

A module can be used through a relayer configuration file by registering a Config implementation for a target Chain or Prover in RegisterInterfaces method.

You can use it by specifying the package name of the proto definition corresponding to the Config in the "@type" field of the config file, as shown below. Then, the relayer creates an instance of the corresponding Chain or Prover using the Config at runtime.

{
  "chain": {
    "@type": "/relayer.chains.tendermint.config.ChainConfig",
    "key": "testkey",
    "chain_id": "ibc0",
    "rpc_addr": "http://localhost:26657",
    "account_prefix": "cosmos",
    "gas_adjustment": 1.5,
    "gas_prices": "0.025stake"
  },
  "prover": {
    "@type": "/relayer.chains.tendermint.config.ProverConfig",
    "trusting_period": "336h"
  }
}

yui-relayer's People

Contributors

3100 avatar bluele avatar dai1975 avatar dongrie avatar mattsu6666 avatar ryjones avatar siburu avatar toshihiko-okubo avatar yoshidan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yui-relayer's Issues

Inquiry About Support for Multi-Chain Communication (Beyond Two Chains)

I am currently engaged with the Tutorial-MiniToken.

My query pertains to the expansion of this framework for multi-chain communication. Specifically, is it possible for a relayer to facilitate simultaneous interactions among multiple chains, such as enabling ibc0 to communicate with both ibc1 and ibc2? I observe that current examples focus mainly on two-chain interactions.

I would be grateful if there are any guidance or suggestions on enabling such multi-chain connectivity. Thanks. :)

FabricGateway::Gatewayの早すぎるClose

https://github.com/datachainlab/relayer/blob/563073a9c2a62345123e202cc9817810f652839d/chains/fabric/gateway.go#L74

このClose関数ですが、今のところ中身が空なので問題になってませんが、意味的には以下のとおりなのでここでCloseしてしまうのは不味いのではないかと。

// Close the gateway connection and all associated resources, including removing listeners attached to networks and
// contracts created by the gateway.

Separate proving functions from Chain

Why

Currently, a relay endpoint is simply abstracted as a chain, and the chain has the role of generating commitments and proofs to be verified by the counterparty chain.

Therefore, when a chain is tendermint, the counterparty is forced to use the tendermint light client as verification. This makes it difficult to use other clients such as solomachine or multisig client.

What

We separate the responsibilities as follows:

  • Chain
    It supports the submission of transactions and the Query for the state.

  • Prover
    It provides the Query for the state and proof of it. In addition, it provides a header for the counterparty to update the state. In many cases, it will keep a Chain instance to query the state.

Architecture

Add a prover for IBFT2 Client

We want to add a prover for an IBFT2 Client.
To complete the issue, we require additional E2E tests with a new configuration using IBFT2 Client.

Fix the Go module paths

Change the Go module paths to new ones as follows.

  • datachainlab/relayer => hyperledger-labs/yui-relayer
  • datachainlab/fabric-ibc => hyperledger-labs/yui-fabric-ibc
  • datachainlab/corda-ibc => hyperledger-labs/yui-corda-ibc

Write developers' guide

  • How to set up the relayer?
  • How to run the relayer?
  • How to analyze an error in packet-relay?
  • How to set up the chain end? (This should be described in yui-docs?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.