params

package
v0.0.0-...-e4b14ae Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaximumExtraDataSize uint64 = 32    // Maximum size extra data may be after Genesis.
	EpochDuration        uint64 = 30000 // Duration between proof-of-work epochs.
)
View Source
const (
	VersionMajor = 1          // Major version component of the current release
	VersionMinor = 0          // Minor version component of the current release
	VersionPatch = 0          // Patch version component of the current release
	VersionMeta  = "unstable" // Version metadata to append to the version string
)

Variables

View Source
var (
	TestChainConfig = &ChainConfig{ChainID: big.NewInt(9527), Pow: new(PowConfig)}

	// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
	// and accepted by the Ethereum core developers into the Ethash consensus.
	//
	// This configuration is intentionally not using keyed fields to force anyone
	// adding flags to the config to also have to set these fields.
	AllPowProtocolChanges = &ChainConfig{
		ChainID: big.NewInt(10086),
		Pow:     new(PowConfig),
	}
)
View Source
var GenesisDifficulty = big.NewInt(1000) // Difficulty of the Genesis block.
View Source
var (
	// MainnetChainConfig is the chain parameters to run a node on the main network.
	MainnetChainConfig = &ChainConfig{
		ChainID: big.NewInt(1),
		Pow:     new(PowConfig),
	}
)
View Source
var (
	MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3")
)
View Source
var TestNetParams = NetParams{
	Name:            "testnet",
	Bech32HRPSegwit: "sr",
}
View Source
var Version = func() string {
	v := fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
	if VersionMeta != "" {
		v += "-" + VersionMeta
	}
	return v
}()

Version holds the textual version string.

Functions

func IsBech32SegwitPrefix

func IsBech32SegwitPrefix(prefix string, params NetParams) bool

Types

type ChainConfig

type ChainConfig struct {
	// chainId identifies the current chain and is used for replay protection
	ChainID *big.Int `json:"chainId"`

	// Various consensus engines
	Pow *PowConfig
}

ChainConfig is the core config which determines the blockchain settings.

func (*ChainConfig) CheckCompatible

func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError

CheckCompatible checks whether scheduled fork transitions have been imported with a mismatching chain configuration.

type ConfigCompatError

type ConfigCompatError struct {
	What string
	// block numbers of the stored and new configurations
	StoredConfig, NewConfig *big.Int
	// the block number to which the local chain must be rewound to correct the error
	RewindTo uint64
}

ConfigCompatError is raised if the locally-stored blockchain is initialised with a ChainConfig that would alter the past.

func (*ConfigCompatError) Error

func (err *ConfigCompatError) Error() string

type NetParams

type NetParams struct {
	// Name defines a human-readable identifier for the network.
	Name            string
	Bech32HRPSegwit string
}

type PowConfig

type PowConfig struct{}

PowConfig is the consensus engine configs for proof-of-work based sealing.

func (*PowConfig) String

func (c *PowConfig) String() string

String implements the stringer interface, returning the consensus engine details.

Jump to

Keyboard shortcuts

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