Documentation ¶
Index ¶
- type Account
- type Approver
- type Authority
- type Builder
- func (b *Builder) Build(stater *state.Stater) (blk *block.Block, events tx.Events, transfers tx.Transfers, err error)
- func (b *Builder) Call(clause *tx.Clause, caller thor.Address) *Builder
- func (b *Builder) ComputeID() (thor.Bytes32, error)
- func (b *Builder) ExtraData(data [28]byte) *Builder
- func (b *Builder) ForkConfig(fc thor.ForkConfig) *Builder
- func (b *Builder) GasLimit(limit uint64) *Builder
- func (b *Builder) State(proc func(state *state.State) error) *Builder
- func (b *Builder) Timestamp(t uint64) *Builder
- type CustomGenesis
- type DevAccount
- type Executor
- type Genesis
- type HexOrDecimal256
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v1.0.7
type Account struct { Address thor.Address `json:"address"` Balance *HexOrDecimal256 `json:"balance"` Energy *HexOrDecimal256 `json:"energy"` Code string `json:"code"` Storage map[string]thor.Bytes32 `json:"storage"` }
Account is the account will set to the genesis block
type Approver ¶ added in v1.0.7
type Approver struct { Address thor.Address `json:"address"` Identity thor.Bytes32 `json:"identity"` }
Approver is the approver info for executor contract
type Authority ¶ added in v1.0.7
type Authority struct { MasterAddress thor.Address `json:"masterAddress"` EndorsorAddress thor.Address `json:"endorsorAddress"` Identity thor.Bytes32 `json:"identity"` }
Authority is the authority node info
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder helper to build genesis block.
func (*Builder) Build ¶
func (b *Builder) Build(stater *state.Stater) (blk *block.Block, events tx.Events, transfers tx.Transfers, err error)
Build build genesis block according to presets.
func (*Builder) ExtraData ¶
ExtraData set extra data, which will be put into last 28 bytes of genesis parent id.
func (*Builder) ForkConfig ¶ added in v1.5.0
func (b *Builder) ForkConfig(fc thor.ForkConfig) *Builder
ForkConfig set fork config.
type CustomGenesis ¶ added in v1.0.7
type CustomGenesis struct { LaunchTime uint64 `json:"launchTime"` GasLimit uint64 `json:"gaslimit"` ExtraData string `json:"extraData"` Accounts []Account `json:"accounts"` Authority []Authority `json:"authority"` Params Params `json:"params"` Executor Executor `json:"executor"` ForkConfig *thor.ForkConfig `json:"forkConfig"` }
CustomGenesis is user customized genesis
type DevAccount ¶
type DevAccount struct { Address thor.Address PrivateKey *ecdsa.PrivateKey }
DevAccount account for development.
func DevAccounts ¶
func DevAccounts() []DevAccount
DevAccounts returns pre-alloced accounts for solo mode.
type Executor ¶ added in v1.0.7
type Executor struct {
Approvers []Approver `json:"approvers"`
}
Executor is the params for executor info
type Genesis ¶
type Genesis struct {
// contains filtered or unexported fields
}
Genesis to build genesis block.
func NewCustomNet ¶ added in v1.0.7
func NewCustomNet(gen *CustomGenesis) (*Genesis, error)
NewCustomNet create custom network genesis.
type HexOrDecimal256 ¶ added in v1.7.2
type HexOrDecimal256 math.HexOrDecimal256
hexOrDecimal256 marshals big.Int as hex or decimal. Copied from go-ethereum/common/math and implement json. Marshaler
func (*HexOrDecimal256) MarshalJSON ¶ added in v1.7.2
func (i *HexOrDecimal256) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*HexOrDecimal256) UnmarshalJSON ¶ added in v1.7.2
func (i *HexOrDecimal256) UnmarshalJSON(input []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type Params ¶ added in v1.0.7
type Params struct { RewardRatio *HexOrDecimal256 `json:"rewardRatio"` BaseGasPrice *HexOrDecimal256 `json:"baseGasPrice"` ProposerEndorsement *HexOrDecimal256 `json:"proposerEndorsement"` ExecutorAddress *thor.Address `json:"executorAddress"` }
Params means the chain params for params contract