Documentation
¶
Index ¶
- type Bootnode
- type ChainSpec
- func (cs *ChainSpec) GenesisHeaderBytes() ([]byte, error)
- func (cs *ChainSpec) GenesisStateKeyVals() (types.StateKeyVals, error)
- func (cs *ChainSpec) ParseProtocolParameters() (types.ProtocolParameters, error)
- func (cs *ChainSpec) ProtocolParametersBytes() ([]byte, error)
- func (cs *ChainSpec) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootnode ¶
type Bootnode struct {
Original string // original string
Name string // 53 chars: 'e' + base32(pubkey)
PubKey [32]byte // decoded Ed25519 public key
IP net.IP // IPv4 or IPv6 address
Port uint16 // port number
}
Bootnode is a parsed bootnode entry <name>@<ip>:<port>.
func ParseBootnode ¶
ParseBootnode parses "<name>@<ip>:<port>". - name must be 53 chars, starts with 'e', rest is base32(pubkey) without padding. - ip must be a literal IPv4 or IPv6 address (IPv6 may be in [] or not).
type ChainSpec ¶
type ChainSpec struct {
ID string `json:"id"`
Bootnodes []string `json:"bootnodes,omitempty"`
GenesisHeader string `json:"genesis_header"`
GenesisState map[string]string `json:"genesis_state"`
ProtocolParamsHex string `json:"protocol_parameters,omitempty"`
}
ChainSpec matches JIP-4 JSON schema.
func LoadFromBytes ¶
func (*ChainSpec) GenesisHeaderBytes ¶
func (*ChainSpec) GenesisStateKeyVals ¶
func (cs *ChainSpec) GenesisStateKeyVals() (types.StateKeyVals, error)
func (*ChainSpec) ParseProtocolParameters ¶
func (cs *ChainSpec) ParseProtocolParameters() (types.ProtocolParameters, error)
func (*ChainSpec) ProtocolParametersBytes ¶
Click to show internal directories.
Click to hide internal directories.