genesis

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0, MIT Imports: 60 Imported by: 1

Documentation

Index

Constants

View Source
const AccountStart = 100
View Source
const MaxAccounts = MinerStart - AccountStart
View Source
const MinerStart = 1000

Variables

View Source
var RootVerifierID address.Address

Functions

func MakeInitialStateTree

func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template Template) (*tree.State, map[address.Address]address.Address, error)

func MinerAddress

func MinerAddress(genesisIndex uint64) address.Address

func SetupCronActor

func SetupCronActor(ctx context.Context, bs bstore.Blockstore, av specactors.Version) (*types.Actor, error)

func SetupInitActor

func SetupInitActor(ctx context.Context, bs bstore.Blockstore, netname string, initialActors []Actor, rootVerifier Actor, remainder Actor, av specactors.Version) (int64, *types.Actor, map[address.Address]address.Address, error)

func SetupRewardActor

func SetupRewardActor(ctx context.Context, bs bstore.Blockstore, qaPower big.Int, av specactors.Version) (*types.Actor, error)

func SetupStorageMarketActor

func SetupStorageMarketActor(ctx context.Context, bs bstore.Blockstore, av specactors.Version) (*types.Actor, error)

func SetupStorageMiners

func SetupStorageMiners(ctx context.Context, cs *chain.Store, sroot cid.Cid, miners []Miner, nv network.Version, para *config.ForkUpgradeConfig) (cid.Cid, error)

Note: Much of this is brittle, if the methodNum / param / return changes, it will break things

func SetupStoragePowerActor

func SetupStoragePowerActor(ctx context.Context, bs bstore.Blockstore, av specactors.Version) (*types.Actor, error)

func SetupSystemActor

func SetupSystemActor(ctx context.Context, bs bstore.Blockstore, av specactors.Version) (*types.Actor, error)

func SetupVerifiedRegistryActor

func SetupVerifiedRegistryActor(ctx context.Context, bs bstore.Blockstore, av specactors.Version) (*types.Actor, error)

func VerifyPreSealedData

func VerifyPreSealedData(ctx context.Context, cs *chain.Store, stateroot cid.Cid, template Template, keyIDs map[address.Address]address.Address, nv network.Version, para *config.ForkUpgradeConfig) (cid.Cid, error)

Types

type AccountMeta

type AccountMeta struct {
	Owner address.Address // bls / secpk
}

func (*AccountMeta) ActorMeta

func (am *AccountMeta) ActorMeta() json.RawMessage

type Actor

type Actor struct {
	Type    ActorType
	Balance abi.TokenAmount

	Meta json.RawMessage
}

type ActorType

type ActorType string
const (
	TAccount  ActorType = "account"
	TMultisig ActorType = "multisig"
)

type GenesisBootstrap

type GenesisBootstrap struct {
	Genesis *types.BlockHeader
}

func MakeGenesisBlock

func MakeGenesisBlock(ctx context.Context, rep repo.Repo, bs bstore.Blockstore, template Template, para *config.ForkUpgradeConfig) (*GenesisBootstrap, error)

type Miner

type Miner struct {
	ID     address.Address
	Owner  address.Address
	Worker address.Address
	PeerID peer.ID //nolint:golint

	MarketBalance abi.TokenAmount
	PowerBalance  abi.TokenAmount

	SectorSize abi.SectorSize

	Sectors []*PreSeal
}

type MultisigMeta

type MultisigMeta struct {
	Signers         []address.Address
	Threshold       int
	VestingDuration int
	VestingStart    int
}

func (*MultisigMeta) ActorMeta

func (mm *MultisigMeta) ActorMeta() json.RawMessage

type PreSeal

type PreSeal struct {
	CommR     cid.Cid
	CommD     cid.Cid
	SectorID  abi.SectorNumber
	Deal      market2.DealProposal
	ProofType abi.RegisteredSealProof
}

type Template

type Template struct {
	NetworkVersion network.Version
	Accounts       []Actor
	Miners         []Miner

	NetworkName string
	Timestamp   uint64 `json:",omitempty"`

	VerifregRootKey  Actor
	RemainderAccount Actor
}

Jump to

Keyboard shortcuts

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