config

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: LGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const Version = "0.7.4"

Version - dist version def

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]*big.Float `json:"alloc"` // Account balances at genesis

	AllocAddresses []common.Address // Account addresses

	InflationRate float64 `json:"inflation"` // Inflation rate

	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) UpdateChainVersion added in v0.6.1

func (chainConfig *ChainConfig) UpdateChainVersion() error

UpdateChainVersion updates the version of the given chain config.

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