Documentation ¶
Index ¶
- type AppliedMessage
- type Node
- func (nd *Node) Close() error
- func (nd *Node) CopySim(ctx context.Context, oldName, newName string) error
- func (nd *Node) CreateSim(ctx context.Context, name string, head *types.TipSet) (*Simulation, error)
- func (nd *Node) DeleteSim(ctx context.Context, name string) error
- func (nd *Node) ListSims(ctx context.Context) ([]string, error)
- func (nd *Node) LoadSim(ctx context.Context, name string) (*Simulation, error)
- func (nd *Node) RenameSim(ctx context.Context, oldName, newName string) error
- type Simulation
- func (sim *Simulation) GetHead() *types.TipSet
- func (sim *Simulation) GetNetworkVersion() network.Version
- func (sim *Simulation) GetStart() *types.TipSet
- func (sim *Simulation) ListUpgrades() (stmgr.UpgradeSchedule, error)
- func (sim *Simulation) Name() string
- func (sim *Simulation) SetHead(head *types.TipSet) error
- func (sim *Simulation) SetUpgradeHeight(nv network.Version, epoch abi.ChainEpoch) (_err error)
- func (sim *Simulation) Step(ctx context.Context) (*types.TipSet, error)
- func (sim *Simulation) Walk(ctx context.Context, lookback int64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppliedMessage ¶
type AppliedMessage struct { types.Message types.MessageReceipt }
type Node ¶
type Node struct { Blockstore blockstore.Blockstore MetadataDS datastore.Batching Chainstore *store.ChainStore // contains filtered or unexported fields }
Node represents the local lotus node, or at least the part of it we care about.
func OpenNode ¶
OpenNode opens the local lotus node for writing. This will fail if the node is online.
func (*Node) Close ¶
Close cleanly close the repo. Please call this on shutdown to make sure everything is flushed.
func (*Node) CreateSim ¶
func (nd *Node) CreateSim(ctx context.Context, name string, head *types.TipSet) (*Simulation, error)
CreateSim creates a new simulation.
- This will fail if a simulation already exists with the given name. - Num must not contain a '/'.
func (*Node) DeleteSim ¶
DeleteSim deletes a simulation and all related metadata.
NOTE: This function does not delete associated messages, blocks, or chain state.
type Simulation ¶
type Simulation struct { Node *Node StateManager *stmgr.StateManager // contains filtered or unexported fields }
Simulation specifies a lotus-sim simulation.
func (*Simulation) GetHead ¶
func (sim *Simulation) GetHead() *types.TipSet
GetHead returns the current simulation head.
func (*Simulation) GetNetworkVersion ¶
func (sim *Simulation) GetNetworkVersion() network.Version
GetNetworkVersion returns the current network version for the simulation.
func (*Simulation) GetStart ¶
func (sim *Simulation) GetStart() *types.TipSet
GetStart returns simulation's parent tipset.
func (*Simulation) ListUpgrades ¶
func (sim *Simulation) ListUpgrades() (stmgr.UpgradeSchedule, error)
ListUpgrades returns any future network upgrades.
func (*Simulation) SetHead ¶
func (sim *Simulation) SetHead(head *types.TipSet) error
SetHead updates the current head of the simulation and stores it in the metadata store. This is called for every Simulation.Step.
func (*Simulation) SetUpgradeHeight ¶
func (sim *Simulation) SetUpgradeHeight(nv network.Version, epoch abi.ChainEpoch) (_err error)
SetUpgradeHeight sets the height of the given network version change (and saves the config).
This fails if the specified epoch has already passed or the new upgrade schedule is invalid.
func (*Simulation) Step ¶
Step steps the simulation forward one step. This may move forward by more than one epoch.
func (*Simulation) Walk ¶
func (sim *Simulation) Walk( ctx context.Context, lookback int64, cb func(sm *stmgr.StateManager, ts *types.TipSet, stCid cid.Cid, messages []*AppliedMessage) error, ) error
Walk walks the simulation's chain from the current head back to the first tipset.