gen

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0, MIT Imports: 37 Imported by: 19

Documentation

Index

Constants

View Source
const (
	DSepTicket       = 1
	DSepElectionPost = 2
)

Variables

This section is empty.

Functions

func AdjustInitActorStartID

func AdjustInitActorStartID(ctx context.Context, bs blockstore.Blockstore, stateroot cid.Cid, val uint64) (cid.Cid, error)

func ComputeProof

func ComputeProof(ctx context.Context, epp ElectionPoStProver, pi *ProofInput) (*types.EPostProof, error)

func ComputeVRF

func ComputeVRF(ctx context.Context, sign SignFunc, worker, miner address.Address, p uint64, input []byte) ([]byte, error)

func MakeInitialStateTree

func MakeInitialStateTree(bs bstore.Blockstore, actmap map[address.Address]types.BigInt) (*state.StateTree, error)

func MinerCreateBlock

func MinerCreateBlock(ctx context.Context, sm *stmgr.StateManager, w *wallet.Wallet, miner address.Address, parents *types.TipSet, ticket *types.Ticket, proof *types.EPostProof, msgs []*types.SignedMessage, height, timestamp uint64) (*types.FullBlock, error)

func SetupCronActor

func SetupCronActor(bs bstore.Blockstore) (*types.Actor, error)

func SetupInitActor

func SetupInitActor(bs bstore.Blockstore, addrs []address.Address) (*types.Actor, error)

func SetupStorageMarketActor

func SetupStorageMarketActor(bs bstore.Blockstore, sroot cid.Cid, deals []actors.StorageDealProposal) (cid.Cid, error)

func SetupStorageMiners

func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid, gmcfg *GenMinerCfg) (cid.Cid, []actors.StorageDealProposal, error)

func SetupStoragePowerActor

func SetupStoragePowerActor(bs bstore.Blockstore) (*types.Actor, error)

func VerifyVRF

func VerifyVRF(ctx context.Context, worker, miner address.Address, p uint64, input, vrfproof []byte) error

Types

type ChainGen

type ChainGen struct {
	CurTipset *store.FullTipSet

	Timestamper func(*types.TipSet, uint64) uint64

	Miners []address.Address
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator() (*ChainGen, error)

func (*ChainGen) Genesis

func (cg *ChainGen) Genesis() *types.BlockHeader

func (*ChainGen) GenesisCar

func (cg *ChainGen) GenesisCar() ([]byte, error)

func (*ChainGen) NextTipSet

func (cg *ChainGen) NextTipSet() (*MinedTipSet, error)

func (*ChainGen) NextTipSetFromMiners

func (cg *ChainGen) NextTipSetFromMiners(base *types.TipSet, miners []address.Address) (*MinedTipSet, error)

func (*ChainGen) ResyncBankerNonce

func (cg *ChainGen) ResyncBankerNonce(ts *types.TipSet) error

This function is awkward. It's used to deal with messages made when simulating forks

func (*ChainGen) YieldRepo

func (cg *ChainGen) YieldRepo() (repo.Repo, error)

type GenMinerCfg

type GenMinerCfg struct {
	PreSeals map[string]genesis.GenesisMiner

	// The addresses of the created miner, this is set by the genesis setup
	MinerAddrs []address.Address

	PeerIDs []peer.ID
}

type GenesisBootstrap

type GenesisBootstrap struct {
	Genesis *types.BlockHeader
}

func MakeGenesisBlock

func MakeGenesisBlock(bs bstore.Blockstore, sys *types.VMSyscalls, balances map[address.Address]types.BigInt, gmcfg *GenMinerCfg, ts uint64) (*GenesisBootstrap, error)

type MinedTipSet

type MinedTipSet struct {
	TipSet   *store.FullTipSet
	Messages []*types.SignedMessage
}

type MiningCheckAPI

type MiningCheckAPI interface {
	ChainGetRandomness(context.Context, types.TipSetKey, int64) ([]byte, error)

	StateMinerPower(context.Context, address.Address, *types.TipSet) (api.MinerPower, error)

	StateMinerWorker(context.Context, address.Address, *types.TipSet) (address.Address, error)

	StateMinerSectorSize(context.Context, address.Address, *types.TipSet) (uint64, error)

	StateMinerProvingSet(context.Context, address.Address, *types.TipSet) ([]*api.ChainSectorInfo, error)

	WalletSign(context.Context, address.Address, []byte) (*types.Signature, error)
}

type ProofInput

type ProofInput struct {
	// contains filtered or unexported fields
}

func IsRoundWinner

func IsRoundWinner(ctx context.Context, ts *types.TipSet, round int64, miner address.Address, epp ElectionPoStProver, a MiningCheckAPI) (*ProofInput, error)

type SignFunc

type SignFunc func(context.Context, address.Address, []byte) (*types.Signature, error)

Jump to

Keyboard shortcuts

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