relay

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeyPassword = "gochain"
)

Variables

View Source
var (
	Senders   = map[string]NewSenderFunc{}
	Receivers = map[string]NewReceiverFunc{}
)

Functions

This section is empty.

Types

type ChainConfig

type ChainConfig struct {
	Address  chain.BTPAddress `json:"address"`
	Endpoint []string         `json:"endpoint"`
	Options  json.RawMessage  `json:"options,omitempty"`
}

type Config

type Config struct {
	Relays []*RelayConfig `json:"relays"`
}

type DstConfig

type DstConfig struct {
	ChainConfig `json:",squash"`

	KeyStore    json.RawMessage `json:"key_store"`
	KeyPassword string          `json:"key_password"`

	// AWS
	AWSSecretName string `json:"aws_secret_name,omitempty"`
	AWSRegion     string `json:"aws_region,omitempty"`

	// TxSizeLimit
	// is the maximum size of a transaction in bytes
	TxDataSizeLimit uint64 `json:"tx_data_size_limit"`
}

func (*DstConfig) Wallet

func (cfg *DstConfig) Wallet() (wallet.Wallet, error)

type NewReceiverFunc

type NewReceiverFunc func(
	src, dst chain.BTPAddress, urls []string,
	opts json.RawMessage, l log.Logger) (chain.Receiver, error)

type NewSenderFunc

type NewSenderFunc func(
	src, dst chain.BTPAddress, urls []string, w wallet.Wallet,
	opts json.RawMessage, l log.Logger) (chain.Sender, error)

type Relay

type Relay interface {
	Start(ctx context.Context) (err error)
}

func NewMultiRelay

func NewMultiRelay(cfg *Config, l log.Logger) (Relay, error)

func NewRelay

func NewRelay(cfg *RelayConfig, src chain.Receiver, dst chain.Sender, log log.Logger) (Relay, error)

type RelayConfig

type RelayConfig struct {
	Name string    `json:"name"`
	Src  SrcConfig `json:"src"`
	Dst  DstConfig `json:"dst"`
}

type SrcConfig

type SrcConfig struct {
	ChainConfig `json:",squash"`
	Offset      uint64 `json:"offset"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL