chains

package
v0.0.0-...-cda9367 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigPath = "./test_config.json"
View Source
const DefaultKeystorePath = "./keys"

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Config   ChainConfig // The config of this chain
	Streamer Streamer    // The streamer of this chain
	Router   Router      // The router of the chain

}

Chain is a connection to a blockchain network

type ChainConfig

type ChainConfig struct {
	Type       string `toml:"type" json:"type"`
	ID         string `toml:"id" json:"id"`                   // Chain ID
	Endpoint   string `toml:"endpoint" json:"endpoint"`       // url for rpc endpoint
	Operator   string `toml:"operator" json:"operator"`       // operator's address
	PrivateKey string `toml:"private_key" json:"private_key"` // operator's private key
}

ChainConfig is parsed directly from the config file and is used to construct the Chain

type Config

type Config struct {
	Chains []ChainConfig `toml:"chains" json:"chains"`
}

Config ...

func GetConfig

func GetConfig() (*Config, error)

func NewConfig

func NewConfig() *Config

NewConfig ...

func (*Config) ToJSON

func (c *Config) ToJSON(file string) *os.File

type Router

type Router interface {
	Route(types.EventData) (error, types.Packet)
}

Router packages transaction data as packets and relays them to the bridge

type Streamer

type Streamer interface {
	Start() error
}

Streamer streams transactions from a blockchain and passes them to the router

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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