node

package
v0.0.0-...-a1ac4f3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAddressToMessageIndex

func AddAddressToMessageIndex(ctx context.Context, msg *api.Message, ts *types.TipSet, wb *badger.WriteBatch)

func AddressConvert

func AddressConvert(id string) (*model.Address, error)

func AddressLookup

func AddressLookup(id string) (*model.Address, error)

func DecodeAddress

func DecodeAddress(val []byte) (address.Address, error)

func DecodeIdAddress

func DecodeIdAddress(val []byte) (address.Address, error)

func DecodeLotusMessage

func DecodeLotusMessage(val []byte) (*api.Message, error)

func DecodeMessage

func DecodeMessage(val []byte) (*model.Message, error)

func ExistsTipSet

func ExistsTipSet(tsk types.TipSetKey) bool

func GetIdAddress

func GetIdAddress(ctx context.Context, addr address.Address, tsk types.TipSetKey, wb *badger.WriteBatch) (address.Address, error)

func GetLotusMessage

func GetLotusMessage(cid gocid.Cid, ts *types.TipSet, wb *badger.WriteBatch) (*api.Message, error)

func GetMaxHeight

func GetMaxHeight() uint32

func GetMessage

func GetMessage(cid string) (*model.Message, error)

func GetRobustAddress

func GetRobustAddress(ctx context.Context, id address.Address, tsk types.TipSetKey, wb *badger.WriteBatch) (address.Address, error)

func GetTipSet

func GetTipSet(tsk types.TipSetKey, wb *badger.WriteBatch) (*types.TipSet, error)

func GetTipSetByHeight

func GetTipSetByHeight(height uint64) (*types.TipSet, error)

func GetTipSetKeyByHeight

func GetTipSetKeyByHeight(height uint64) (*types.TipSetKey, error)

func GetTipSetMessages

func GetTipSetMessages(ts *types.TipSet, wb *badger.WriteBatch) ([]api.Message, error)

func LookupIdAddress

func LookupIdAddress(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

func LookupRobustAddress

func LookupRobustAddress(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

func SearchMessagesByAddress

func SearchMessagesByAddress(ctx context.Context, address string, limit *int, offset *int) ([]*model.Message, error)

func SearchMessagesByHeight

func SearchMessagesByHeight(ctx context.Context, height uint64, limit *int, offset *int) ([]*model.Message, error)

func SetAddressIndex

func SetAddressIndex(ctx context.Context, addr address.Address, ulid ulid.ULID, cid cid.Cid, tsk types.TipSetKey, wb *badger.WriteBatch)

func SetAddressToId

func SetAddressToId(robust address.Address, id address.Address, wb *badger.WriteBatch) error

func SetIdToAddress

func SetIdToAddress(id address.Address, robust address.Address, wb *badger.WriteBatch) error

func SetMessage

func SetMessage(message api.Message, ts *types.TipSet, wb *badger.WriteBatch) (bool, error)

func SetMessageNoIndex

func SetMessageNoIndex(message api.Message, ts *types.TipSet, wb *badger.WriteBatch) error

func SetTipSet

func SetTipSet(ts *types.TipSet, wb *badger.WriteBatch) error

func SetTipSetMessages

func SetTipSetMessages(tsk types.TipSetKey, messages []api.Message, wb *badger.WriteBatch) (bool, error)

func Sync

func Sync(p0 context.Context, _confidence uint64, _height uint64, _length uint64)

func SyncMessages

func SyncMessages(p0 context.Context, _confidence uint64, _height uint64, _length uint64)

func SyncMessagesFromLily

func SyncMessagesFromLily(p0 context.Context, ts *types.TipSet, wb *badger.WriteBatch) error

func SyncStatus

func SyncStatus() *model.Status

func SyncTipSetMessages

func SyncTipSetMessages(p0 context.Context, ts *types.TipSet, wb *badger.WriteBatch) (int, error)

func SyncTipSetTop

func SyncTipSetTop(p0 context.Context) error

func SyncTipsetStart

func SyncTipsetStart(ctx context.Context, _confidence uint64, _height uint64, _length uint64)

func SyncTipsetWorker

func SyncTipsetWorker(ctx context.Context, id int, jobs <-chan types.TipSetKey, result chan<- types.TipSetKey)

func SyncTipset_deleteme

func SyncTipset_deleteme(p0 context.Context, _confidence uint64, _height uint64, _length uint64)

func TipSetKeyFromString

func TipSetKeyFromString(value string) (types.TipSetKey, error)

func UpdateTipSetMessages

func UpdateTipSetMessages(ts *types.TipSet, wb *badger.WriteBatch) (bool, error)

func ValidateMessages

func ValidateMessages(height uint64)

Types

type Actor

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

func (*Actor) Get

func (t *Actor) Get(id string) (*types.Actor, error)

func (*Actor) Init

func (t *Actor) Init(api lotusapi.FullNodeStruct) error

type Cache

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

func GetCacheInstance

func GetCacheInstance() *Cache

func (*Cache) Cache

func (c *Cache) Cache() *ristretto.Cache

func (*Cache) Close

func (c *Cache) Close()

type LotusNode

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

func GetLotusInstance

func GetLotusInstance(opts *LotusOptions) *LotusNode

func (*LotusNode) Close

func (node *LotusNode) Close()

type LotusOptions

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

type Match

type Match func(*api.InvocResult) bool

match types take an *types.Message and return a bool value.

type Node

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

func (*Node) AddressGetID

func (t *Node) AddressGetID(id string) (address.Address, error)

func (*Node) AddressGetRobust

func (t *Node) AddressGetRobust(id string) (address.Address, error)

func (*Node) ChainGetMessagesInTipset

func (t *Node) ChainGetMessagesInTipset(p0 context.Context, p1 types.TipSetKey, p3 int) ([]*api.InvocResult, error)

func (*Node) ChainGetTipSet

func (t *Node) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error)

func (*Node) ChainHead

func (t *Node) ChainHead(ctx context.Context) (*types.TipSet, error)

func (*Node) ChainHeadSub

func (t *Node) ChainHeadSub(ctx context.Context) (<-chan []*api.HeadChange, error)

func (*Node) Close

func (t *Node) Close()

func (*Node) Connect

func (t *Node) Connect(address1 string, token string) (dtypes.NetworkName, error)

func (*Node) GetActor

func (t *Node) GetActor(id string) (*types.Actor, error)

func (*Node) GetMessage

func (t *Node) GetMessage(id string) (*types.Message, error)

func (*Node) GetPending

func (t *Node) GetPending() ([]*types.SignedMessage, error)

func (*Node) MpoolSub

func (t *Node) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error)

func (*Node) MsigGetPending

func (t *Node) MsigGetPending(addr string) ([]*api.MsigTransaction, error)

func (*Node) Node

func (t *Node) Node() *Node

func (*Node) SearchState

func (t *Node) SearchState(ctx context.Context, match Match, limit *int, offset *int, height int) ([]*SearchStateStruct, int, error)

func (*Node) StartCache

func (t *Node) StartCache()

func (*Node) StateListMessages

func (t *Node) StateListMessages(ctx context.Context, addr string, lookback int) ([]*api.InvocResult, error)

func (*Node) StateReplay

func (t *Node) StateReplay(ctx context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error)

func (*Node) StateSearchMsg

func (t *Node) StateSearchMsg(id string) (*api.MsgLookup, error)

func (*Node) SyncTimerStart

func (t *Node) SyncTimerStart(confidence uint32)

func (*Node) SyncTimerStop

func (t *Node) SyncTimerStop()

type NodeInterface

type NodeInterface interface {
	GetActor(id string) (*types.Actor, error)
	GetPending() ([]*types.SignedMessage, error)
	GetMessage(cidcc string) (*types.Message, error)
	StateSearchMsg(id string) (*api.MsgLookup, error)
	MsigGetPending(addr string) ([]*api.MsigTransaction, error)
	SearchState(ctx context.Context, match Match, limit *int, offset *int, height int) ([]*SearchStateStruct, int, error)
	StateListMessages(ctx context.Context, addr string, lookback int) ([]*api.InvocResult, error)
	StateReplay(ctx context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error)

	ChainHeadSub(ctx context.Context) (<-chan []*api.HeadChange, error)
	MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error)
	Node() *Node
}

type SearchStateStruct

type SearchStateStruct struct {
	Tipset  *types.TipSet
	Message api.InvocResult
}

func (*SearchStateStruct) ConfirmedMessage

func (state *SearchStateStruct) ConfirmedMessage() model.MessageConfirmed

func (*SearchStateStruct) CreateMessage

func (state *SearchStateStruct) CreateMessage() model.Message

Jump to

Keyboard shortcuts

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