config

package
v0.0.0-...-4502c18 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: GPL-3.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config combines the database, version and magic value of the network. It can also store the Accounts, Chains and Snapshots Managers.

func NewConfig

func NewConfig(db *leveldb.Db, magic []byte, version [3]byte) *Config

NewConfig creates new config, but not creates Managers.

func (*Config) AccountManager

func (c *Config) AccountManager() *account.AccountManager

AccountManager is getter for AccountManager, creates default if manager nil.

func (*Config) ChainHelper

func (c *Config) ChainHelper() *chain.ChainHelper

ChainHelper is getter for ChainHelper, creates default if helper nil.

func (*Config) DataBase

func (c *Config) DataBase() *leveldb.Db

DataBase is getter for Db instance.

func (*Config) Magic

func (c *Config) Magic() []byte

Magic is getter for magic value of the network.

func (*Config) PeerManager

func (c *Config) PeerManager() *peer.PeerManager

PeerManager is getter for PeerManager, creates default if manager nil.

func (*Config) SnapShotFactory

func (c *Config) SnapShotFactory() *snapshot.SnapShotFactory

SnapShotFactory is getter for SnapShotFactory, creates default if factory nil.

func (*Config) SnapShotManager

func (c *Config) SnapShotManager() *snapshot.SnapShotManager

SnapShotManager is getter for SnapShotManager, creates default if manager nil.

func (*Config) Version

func (c *Config) Version() Version

Version is getter for Version instance.

type Configer

type Configer interface {
	// SnapShotManager is getter for SnapShotManager.
	SnapShotManager() *snapshot.SnapShotManager

	// AccountManager is getter for AccountManager.
	AccountManager() *account.AccountManager

	// ChainHelper is getter for ChainHelper.
	ChainHelper() *chain.ChainHelper

	// SnapShotFactory is getter for SnapShotFactory.
	SnapShotFactory() *snapshot.SnapShotFactory

	//  Magic is getter for magic value of the network.
	Magic() []byte

	// Version is getter for Version instance.
	Version() Version
}

Configer is a network configuration view.

type Version

type Version [3]byte

Version this is the type for storing the protocol version. Range versions: 0.0.0 - 255.255.255. First byte for major changes. Second byte for minor changes. Third byte is optional value for micro changes.

func NewVersionByString

func NewVersionByString(v string) Version

NewVersionByString converts version string to Version type.

func (Version) Equals

func (v Version) Equals(v2 Version) bool

Equals check if the two versions match

func (Version) GetBytes

func (v Version) GetBytes() []byte

GetBytes converts version to the []byte array

func (Version) GetBytes3

func (v Version) GetBytes3() [3]byte

GetBytes3 converts version to the []byte array

func (Version) String

func (v Version) String() string

String converts version to string representation.

Jump to

Keyboard shortcuts

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