gen

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0, MIT Imports: 44 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExpertActor = genesis.Actor{
	Type:    genesis.TAccount,
	Balance: abi.NewTokenAmount(0),
	Meta: (&genesis.AccountMeta{
		Owner: makeAddress("f3u4htuzaihfms2j2qcicx3kqlgzleve3qlj6ul6ei4iolc5ru6f4eof3vtv6sccanzymly7n5wv3znzijbedq"),
	}).ActorMeta(),
}

////////////////////

default expert

////////////////////

View Source
var DefaultFoundationAccountActor = genesis.Actor{
	Type:    genesis.TMultisig,
	Balance: types.FromEpk(50_000_000),
	Meta: (&genesis.MultisigMeta{
		Signers: []address.Address{
			makeAddress("f3vd67sdu27mttcbs6j34uz3d77aizgbannm6bslt2fgu656sgeydxq27uw7r6vppfs6pvsx62gasowg4ssmqa"),
		},
		Threshold:       1,
		VestingDuration: 90 * 3 * builtin.EpochsInDay,
		VestingStart:    0,
		InitialVestedTarget: &builtin.BigFrac{
			Numerator:   big.NewInt(1),
			Denominator: big.NewInt(4),
		},
	}).ActorMeta(),
}

foundation

View Source
var DefaultGovernorActor = genesis.Actor{
	Type:    genesis.TMultisig,
	Balance: big.Zero(),
	Meta: (&genesis.MultisigMeta{
		Signers: []address.Address{
			makeAddress("f3romwhf6urwbxv73he7e5jj3spa2dszpr2y6ulbi5zdx65vqdk63zqxsbtzpy7g5eleyweo22neeqahiiub2a"),
		},
		Threshold:       1,
		VestingDuration: 0,
		VestingStart:    0,
	}).ActorMeta(),
}

////////////////////

default governor

////////////////////

View Source
var DefaultInvestorAccountActor = genesis.Actor{
	Type:    genesis.TMultisig,
	Balance: types.FromEpk(200_000_000),
	Meta: (&genesis.MultisigMeta{
		Signers: []address.Address{
			makeAddress("f3xbgq6chq7g7xxfvl6ooazu54pl5ayiss3aelgyuewsqyirhpjh3a67ftizkg2xhwnkhfeqeq4zkpgkpj75lq"),
		},
		Threshold:       1,
		VestingDuration: 90 * 6 * builtin.EpochsInDay,
		VestingStart:    0,
		InitialVestedTarget: &builtin.BigFrac{
			Numerator:   big.NewInt(1),
			Denominator: big.NewInt(7),
		},
	}).ActorMeta(),
}

investor

View Source
var DefaultKgFundPayeeActor = genesis.Actor{
	Type:    genesis.TAccount,
	Balance: abi.NewTokenAmount(0),
	Meta: (&genesis.AccountMeta{
		Owner: makeAddress("f3xh2cf5httdpa4nsqo2fylag2uye5w3mmniem4gkjjfb7kjlhydnvw2caiz5oeq3hkx62u3vg5wgp5icnuopq"),
	}).ActorMeta(),
}

//////////////////////////////////

default knowledge fund payee

//////////////////////////////////

View Source
var DefaultTeamAccountActor = genesis.Actor{
	Type:    genesis.TMultisig,
	Balance: types.FromEpk(50_000_000),
	Meta: (&genesis.MultisigMeta{
		Signers: []address.Address{
			makeAddress("f3qes5asp3flxi6w7ilwbnmdhqwcjdqxljbmuwof37dxq4q4nifdx52kitlnxe7nqohtpwp6euxth53loxlcia"),
		},
		Threshold:       1,
		VestingDuration: 90 * 15 * builtin.EpochsInDay,
		VestingStart:    0,
		InitialVestedTarget: &builtin.BigFrac{
			Numerator:   big.NewInt(1),
			Denominator: big.NewInt(16),
		},
	}).ActorMeta(),
}

team & contributors

View Source
var ValidWpostForTesting = []proof2.PoStProof{{
	ProofBytes: []byte("valid proof"),
}}

Functions

func CarWalkFunc

func CarWalkFunc(nd format.Node) (out []*format.Link, err error)

func ComputeVRF

func ComputeVRF(ctx context.Context, sign SignFunc, worker address.Address, sigInput []byte) ([]byte, error)

func IsRoundWinner

func IsRoundWinner(ctx context.Context, ts *types.TipSet, round abi.ChainEpoch,
	miner address.Address, brand types.BeaconEntry, mbi *api.MiningBaseInfo, a MiningCheckAPI) (*types.ElectionProof, error)

func VerifyVRF

func VerifyVRF(ctx context.Context, worker address.Address, vrfBase, vrfproof []byte) error

Types

type ChainGen

type ChainGen struct {
	CurTipset *store.FullTipSet

	Timestamper func(*types.TipSet, abi.ChainEpoch) uint64

	GetMessages func(*ChainGen) ([]*types.SignedMessage, error)

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

func NewGenerator

func NewGenerator() (*ChainGen, error)

func NewGeneratorWithSectors

func NewGeneratorWithSectors(numSectors int) (*ChainGen, error)

func (*ChainGen) Banker

func (cg *ChainGen) Banker() address.Address

func (*ChainGen) ChainStore

func (cg *ChainGen) ChainStore() *store.ChainStore

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) NextTipSetFromMinersWithMessages

func (cg *ChainGen) NextTipSetFromMinersWithMessages(base *types.TipSet, miners []address.Address, msgs [][]*types.SignedMessage) (*store.FullTipSet, error)

func (*ChainGen) ResyncBankerNonce

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

ResyncBankerNonce is used for dealing with messages made when simulating forks

func (*ChainGen) SetStateManager

func (cg *ChainGen) SetStateManager(sm *stmgr.StateManager)

func (*ChainGen) SetWinningPoStProver

func (cg *ChainGen) SetWinningPoStProver(m address.Address, wpp WinningPoStProver)

func (*ChainGen) StateManager

func (cg *ChainGen) StateManager() *stmgr.StateManager

func (*ChainGen) Wallet

func (cg *ChainGen) Wallet() *wallet.LocalWallet

func (*ChainGen) YieldRepo

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

type MinedTipSet

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

type MiningCheckAPI

type MiningCheckAPI interface {
	ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error)
	ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error)

	MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error)

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

type SignFunc

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

type WinningPoStProver

type WinningPoStProver interface {
	GenerateCandidates(context.Context, abi.PoStRandomness, uint64) ([]uint64, error)
	ComputeProof(context.Context, []proof2.SectorInfo, abi.PoStRandomness) ([]proof2.PoStProof, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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