statediff

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0, MIT Imports: 31 Imported by: 2

README

State exploration for filecoin (lotus centric)

This tool provides functionality for exploration and comparing changes to filecoin state.

Contents

Installation

go get github.com/filecoin-project/statediff/cmd/statediff

Usage

See what state change is expected by a test vector:

statediff vector --file vector.json 

See what state chaned on the local lotus chain across a block or message:

statediff chain --expand-actors all bafy...

API

Other tools working with state trees can access statediff by importing github.com/filecoin-project/statediff.

  • Diff(context.Context, blockstore.Blockstore, a, b cid.Cid, ...Option) string Diff generates a textual unified diff between stateroots a and b. State objects are retreived out of the provided blockstore.
    • Options can be used to control the amount of recursion / expansion performed. In particular, ExpandActors will perform recursive introspection into each individual actor account with a differing HEAD state, and ExpandActorByCid will selectively expand actor accounts based on provided CIDs.

License

Dual-licensed under MIT + Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(ctx context.Context, store blockstore.Blockstore, a, b cid.Cid, opts ...Option) string

func ExpandActors

func ExpandActors(c *config)

ExpandActors indicates that exploration should recurse into actor states when they differ, rather than simply indicating which state roots have diverged.

func StoreFor

func StoreFor(ctx context.Context, client api.FullNode) blockstore.Blockstore

Types

type Option

type Option func(c *config)

func ExpandActorByCid

func ExpandActorByCid(cids []cid.Cid) Option

ExpandActorByCid expands only specific actor states that diverge. Cids that diverge can bes specified by the `CodeID` to expand a specific type of actor e.g. `builtin.AccountActorCodeID`. or a specific instance of an actor based on the specific `Actor.Head`.

func WithActorExpansionFromUser

func WithActorExpansionFromUser(arg string) (Option, error)

Parse a user entered fuzzy definition for actor expansion.

Directories

Path Synopsis
cmd
statediff
establish connection to a 'FullNode' filecoin API with cli configuration.
establish connection to a 'FullNode' filecoin API with cli configuration.
extern
fil-ledger Module
filecoin-ffi Module

Jump to

Keyboard shortcuts

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