Documentation ¶
Overview ¶
genesis package provides utility functions to generate new genesis file to init a chain
Source Files ¶
Each file contains following contents
- bins.go : Stores contract binaries actually used in genesis of named networks
- genesis.go : Provides functions to make a new genesis object
- options.go : Provides utility functions to generate each part in a genesis file such as a list of validators
Index ¶
- Constants
- func New(options ...Option) *blockchain.Genesis
- func NewClique(options ...Option) *blockchain.Genesis
- func NewFile(options ...Option) string
- func NewFileAt(dir string, options ...Option) string
- func Save(dataDir string, genesis *blockchain.Genesis) error
- type Option
- func AddressBookMock() Option
- func Alloc(addrs []common.Address, balance *big.Int) Option
- func AllocWithKairosContract(addrs []common.Address, balance *big.Int) Option
- func AllocWithMainnetContract(addrs []common.Address, balance *big.Int) Option
- func AllocWithPreKairosContract(addrs []common.Address, balance *big.Int) Option
- func AllocWithPremainnetContract(addrs []common.Address, balance *big.Int) Option
- func AllocateKip113(kip113ProxyAddr, kip113LogicAddr common.Address, owner common.Address, ...) Option
- func AllocateRegistry(storage map[common.Hash]common.Hash) Option
- func ChainID(chainID *big.Int) Option
- func Clique(config *params.CliqueConfig) Option
- func DeriveShaImpl(impl int) Option
- func Governance(config *params.GovernanceConfig) Option
- func Istanbul(config *params.IstanbulConfig) Option
- func Kip113Mock(kip113LogicAddr common.Address) Option
- func PatchAddressBook(addr common.Address) Option
- func ProposerInterval(interval uint64) Option
- func RegistryMock() Option
- func StakingInterval(interval uint64) Option
- func UnitPrice(price uint64) Option
- func Validators(addrs ...common.Address) Option
- func ValidatorsOfClique(signers ...common.Address) Option
Constants ¶
View Source
const ( KairosAddressBookBin = "" /* 47244-byte string literal not displayed */ PreKairosAddressBookBin = "" /* 47244-byte string literal not displayed */ PremainnetAddressBookBin = "" /* 47244-byte string literal not displayed */ MainnetAddressBookBin = "" /* 47244-byte string literal not displayed */ MainnetCreditBin = "" /* 1459112-byte string literal not displayed */ )
View Source
const ( FileName = "genesis.json" InitBlockScore = 1 )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(options ...Option) *blockchain.Genesis
func NewClique ¶
func NewClique(options ...Option) *blockchain.Genesis
Types ¶
type Option ¶
type Option func(*blockchain.Genesis)
func AddressBookMock ¶
func AddressBookMock() Option
func AllocWithKairosContract ¶
func AllocateKip113 ¶
func Clique ¶
func Clique(config *params.CliqueConfig) Option
func DeriveShaImpl ¶
func Governance ¶
func Governance(config *params.GovernanceConfig) Option
func Istanbul ¶
func Istanbul(config *params.IstanbulConfig) Option
func Kip113Mock ¶
func PatchAddressBook ¶
Patch the hardcoded line in AddressBook.sol:constructContract().
func ProposerInterval ¶
func RegistryMock ¶
func RegistryMock() Option
func StakingInterval ¶
func Validators ¶
func ValidatorsOfClique ¶
Click to show internal directories.
Click to hide internal directories.