config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Version - dist version def
	Version = "0.5.0"
)

Variables

This section is empty.

Functions

func HandleReceivedConfigRequest

func HandleReceivedConfigRequest() ([]byte, error)

HandleReceivedConfigRequest - handle config request

Types

type ChainConfig

type ChainConfig struct {
	Alloc map[string]float64 `json:"alloc"` // Account balances at genesis

	AllocAddresses []common.Address // Account addresses

	NetworkID    uint        `json:"network"` // Network ID (0: mainnet, 1: testnet, etc...)
	ChainID      common.Hash `json:"id"`      // Hashed networkID, genesisSignature
	ChainVersion string      `json:"version"` // Network version
}

ChainConfig - chain configuration

func FromBytes

func FromBytes(b []byte) (*ChainConfig, error)

FromBytes - decode byte array into chain config

func NewChainConfig

func NewChainConfig(genesisFilePath string) (*ChainConfig, error)

NewChainConfig - generate new ChainConfig from genesis.json file

func ReadChainConfigFromMemory

func ReadChainConfigFromMemory() (*ChainConfig, error)

ReadChainConfigFromMemory - read chain configuration from chain config json file

func (*ChainConfig) Bytes

func (chainConfig *ChainConfig) Bytes() []byte

Bytes - convert given chainConfig to byte array

func (*ChainConfig) String

func (chainConfig *ChainConfig) String() string

String - convert given chainConfig to string

func (*ChainConfig) WriteToMemory

func (chainConfig *ChainConfig) WriteToMemory() error

WriteToMemory - write given chainConfig to memory

Jump to

Keyboard shortcuts

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