lily

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0, MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeadNotifier

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

func (*HeadNotifier) Apply

func (h *HeadNotifier) Apply(ctx context.Context, ts *types.TipSet) error

func (*HeadNotifier) Cancel

func (h *HeadNotifier) Cancel(err error)

func (*HeadNotifier) Err

func (h *HeadNotifier) Err() error

func (*HeadNotifier) HeadEvents

func (h *HeadNotifier) HeadEvents() <-chan *chain.HeadEvent

func (*HeadNotifier) Revert

func (h *HeadNotifier) Revert(ctx context.Context, ts *types.TipSet) error

func (*HeadNotifier) SetCurrent

func (h *HeadNotifier) SetCurrent(ctx context.Context, ts *types.TipSet) error

type LilyAPI

type LilyAPI interface {
	AuthVerify(ctx context.Context, token string) ([]auth.Permission, error)

	LilyWatch(ctx context.Context, cfg *LilyWatchConfig) (schedule.JobID, error)
	LilyWalk(ctx context.Context, cfg *LilyWalkConfig) (schedule.JobID, error)

	LilyJobStart(ctx context.Context, ID schedule.JobID) error
	LilyJobStop(ctx context.Context, ID schedule.JobID) error
	LilyJobList(ctx context.Context) ([]schedule.JobResult, error)

	LilyGapFind(ctx context.Context, cfg *LilyGapFindConfig) (schedule.JobID, error)
	LilyGapFill(ctx context.Context, cfg *LilyGapFillConfig) (schedule.JobID, error)

	// SyncState returns the current status of the chain sync system.
	SyncState(context.Context) (*api.SyncState, error) //perm:read

	ChainHead(context.Context) (*types.TipSet, error)                                                  //perm:read
	ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error)                                //perm:read
	ChainReadObj(context.Context, cid.Cid) ([]byte, error)                                             //perm:read
	ChainStatObj(context.Context, cid.Cid, cid.Cid) (api.ObjStat, error)                               //perm:read
	ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error)                            //perm:read
	ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)    //perm:read
	ChainGetTipSetAfterHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) //perm:read
	ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)                        //perm:read
	ChainGetParentReceipts(context.Context, cid.Cid) ([]*types.MessageReceipt, error)                  //perm:read
	ChainGetParentMessages(context.Context, cid.Cid) ([]api.Message, error)                            //perm:read

	// trigger graceful shutdown
	Shutdown(context.Context) error

	// LogList returns a list of loggers
	LogList(context.Context) ([]string, error)         //perm:write
	LogSetLevel(context.Context, string, string) error //perm:write

	// ID returns peerID of libp2p node backing this API
	ID(context.Context) (peer.ID, error) //perm:read
	NetAutoNatStatus(ctx context.Context) (i api.NatInfo, err error)
	NetPeers(context.Context) ([]peer.AddrInfo, error)
	NetAddrsListen(context.Context) (peer.AddrInfo, error)
	NetPubsubScores(context.Context) ([]api.PubsubScore, error)
	NetAgentVersion(ctx context.Context, p peer.ID) (string, error)
	NetPeerInfo(context.Context, peer.ID) (*api.ExtendedPeerInfo, error)
}

type LilyAPIStruct

type LilyAPIStruct struct {
	// authentication
	// TODO: avoid importing CommonStruct, split out into separate lily structs
	v0api.CommonStruct

	Internal struct {
		Store                                func() adt.Store                                                                  `perm:"read"`
		GetExecutedAndBlockMessagesForTipset func(context.Context, *types.TipSet, *types.TipSet) (*lens.TipSetMessages, error) `perm:"read"`

		LilyWatch func(context.Context, *LilyWatchConfig) (schedule.JobID, error) `perm:"read"`
		LilyWalk  func(context.Context, *LilyWalkConfig) (schedule.JobID, error)  `perm:"read"`

		LilyJobStart func(ctx context.Context, ID schedule.JobID) error      `perm:"read"`
		LilyJobStop  func(ctx context.Context, ID schedule.JobID) error      `perm:"read"`
		LilyJobList  func(ctx context.Context) ([]schedule.JobResult, error) `perm:"read"`

		LilyGapFind func(ctx context.Context, cfg *LilyGapFindConfig) (schedule.JobID, error) `perm:"read"`
		LilyGapFill func(ctx context.Context, cfg *LilyGapFillConfig) (schedule.JobID, error) `perm:"read"`

		Shutdown func(context.Context) error `perm:"read"`

		SyncState func(ctx context.Context) (*api.SyncState, error) `perm:"read"`

		ChainHead                 func(context.Context) (*types.TipSet, error)                                  `perm:"read"`
		ChainGetBlock             func(context.Context, cid.Cid) (*types.BlockHeader, error)                    `perm:"read"`
		ChainReadObj              func(context.Context, cid.Cid) ([]byte, error)                                `perm:"read"`
		ChainStatObj              func(context.Context, cid.Cid, cid.Cid) (api.ObjStat, error)                  `perm:"read"`
		ChainGetTipSet            func(context.Context, types.TipSetKey) (*types.TipSet, error)                 `perm:"read"`
		ChainGetTipSetByHeight    func(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) `perm:"read"`
		ChainGetBlockMessages     func(context.Context, cid.Cid) (*api.BlockMessages, error)                    `perm:"read"`
		ChainGetParentReceipts    func(context.Context, cid.Cid) ([]*types.MessageReceipt, error)               `perm:"read"`
		ChainGetParentMessages    func(context.Context, cid.Cid) ([]api.Message, error)                         `perm:"read"`
		ChainGetTipSetAfterHeight func(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) `perm:"read"`

		LogList     func(context.Context) ([]string, error)     `perm:"read"`
		LogSetLevel func(context.Context, string, string) error `perm:"read"`

		ID               func(context.Context) (peer.ID, error)                        `perm:"read"`
		NetAutoNatStatus func(context.Context) (api.NatInfo, error)                    `perm:"read"`
		NetPeers         func(context.Context) ([]peer.AddrInfo, error)                `perm:"read"`
		NetAddrsListen   func(context.Context) (peer.AddrInfo, error)                  `perm:"read"`
		NetPubsubScores  func(context.Context) ([]api.PubsubScore, error)              `perm:"read"`
		NetAgentVersion  func(ctx context.Context, p peer.ID) (string, error)          `perm:"read"`
		NetPeerInfo      func(context.Context, peer.ID) (*api.ExtendedPeerInfo, error) `perm:"read"`
	}
}

func (*LilyAPIStruct) ChainGetBlock

func (s *LilyAPIStruct) ChainGetBlock(ctx context.Context, c cid.Cid) (*types.BlockHeader, error)

func (*LilyAPIStruct) ChainGetBlockMessages

func (s *LilyAPIStruct) ChainGetBlockMessages(ctx context.Context, blockCid cid.Cid) (*api.BlockMessages, error)

func (*LilyAPIStruct) ChainGetParentMessages

func (s *LilyAPIStruct) ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]api.Message, error)

func (*LilyAPIStruct) ChainGetParentReceipts

func (s *LilyAPIStruct) ChainGetParentReceipts(ctx context.Context, blockCid cid.Cid) ([]*types.MessageReceipt, error)

func (*LilyAPIStruct) ChainGetTipSet

func (s *LilyAPIStruct) ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error)

func (*LilyAPIStruct) ChainGetTipSetAfterHeight

func (s *LilyAPIStruct) ChainGetTipSetAfterHeight(ctx context.Context, epoch abi.ChainEpoch, key types.TipSetKey) (*types.TipSet, error)

func (*LilyAPIStruct) ChainGetTipSetByHeight

func (s *LilyAPIStruct) ChainGetTipSetByHeight(ctx context.Context, epoch abi.ChainEpoch, key types.TipSetKey) (*types.TipSet, error)

func (*LilyAPIStruct) ChainHead

func (s *LilyAPIStruct) ChainHead(ctx context.Context) (*types.TipSet, error)

func (*LilyAPIStruct) ChainReadObj

func (s *LilyAPIStruct) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error)

func (*LilyAPIStruct) ChainStatObj

func (s *LilyAPIStruct) ChainStatObj(ctx context.Context, c cid.Cid, c2 cid.Cid) (api.ObjStat, error)

func (*LilyAPIStruct) GetExecutedAndBlockMessagesForTipset

func (s *LilyAPIStruct) GetExecutedAndBlockMessagesForTipset(ctx context.Context, ts, pts *types.TipSet) (*lens.TipSetMessages, error)

func (*LilyAPIStruct) ID

func (s *LilyAPIStruct) ID(ctx context.Context) (peer.ID, error)

func (*LilyAPIStruct) LilyGapFill

func (s *LilyAPIStruct) LilyGapFill(ctx context.Context, cfg *LilyGapFillConfig) (schedule.JobID, error)

func (*LilyAPIStruct) LilyGapFind

func (s *LilyAPIStruct) LilyGapFind(ctx context.Context, cfg *LilyGapFindConfig) (schedule.JobID, error)

func (*LilyAPIStruct) LilyJobList

func (s *LilyAPIStruct) LilyJobList(ctx context.Context) ([]schedule.JobResult, error)

func (*LilyAPIStruct) LilyJobStart

func (s *LilyAPIStruct) LilyJobStart(ctx context.Context, ID schedule.JobID) error

func (*LilyAPIStruct) LilyJobStop

func (s *LilyAPIStruct) LilyJobStop(ctx context.Context, ID schedule.JobID) error

func (*LilyAPIStruct) LilyWalk

func (s *LilyAPIStruct) LilyWalk(ctx context.Context, cfg *LilyWalkConfig) (schedule.JobID, error)

func (*LilyAPIStruct) LilyWatch

func (s *LilyAPIStruct) LilyWatch(ctx context.Context, cfg *LilyWatchConfig) (schedule.JobID, error)

func (*LilyAPIStruct) LogList

func (s *LilyAPIStruct) LogList(ctx context.Context) ([]string, error)

func (*LilyAPIStruct) LogSetLevel

func (s *LilyAPIStruct) LogSetLevel(ctx context.Context, subsystem, level string) error

func (*LilyAPIStruct) NetAddrsListen

func (s *LilyAPIStruct) NetAddrsListen(ctx context.Context) (peer.AddrInfo, error)

func (*LilyAPIStruct) NetAgentVersion

func (s *LilyAPIStruct) NetAgentVersion(ctx context.Context, p peer.ID) (string, error)

func (*LilyAPIStruct) NetAutoNatStatus

func (s *LilyAPIStruct) NetAutoNatStatus(ctx context.Context) (api.NatInfo, error)

func (*LilyAPIStruct) NetPeerInfo

func (s *LilyAPIStruct) NetPeerInfo(ctx context.Context, p peer.ID) (*api.ExtendedPeerInfo, error)

func (*LilyAPIStruct) NetPeers

func (s *LilyAPIStruct) NetPeers(ctx context.Context) ([]peer.AddrInfo, error)

func (*LilyAPIStruct) NetPubsubScores

func (s *LilyAPIStruct) NetPubsubScores(ctx context.Context) ([]api.PubsubScore, error)

func (*LilyAPIStruct) Shutdown

func (s *LilyAPIStruct) Shutdown(ctx context.Context) error

func (*LilyAPIStruct) Store

func (s *LilyAPIStruct) Store() adt.Store

func (*LilyAPIStruct) SyncState

func (s *LilyAPIStruct) SyncState(ctx context.Context) (*api.SyncState, error)

type LilyGapFillConfig

type LilyGapFillConfig struct {
	RestartOnFailure    bool
	RestartOnCompletion bool
	RestartDelay        time.Duration
	Storage             string // name of storage system to use, cannot be empty and must be Database storage.
	Name                string
	To                  uint64
	From                uint64
	Tasks               []string // name of tasks to fill gaps for
}

type LilyGapFindConfig

type LilyGapFindConfig struct {
	RestartOnFailure    bool
	RestartOnCompletion bool
	RestartDelay        time.Duration
	Storage             string // name of storage system to use, cannot be empty and must be Database storage.
	Name                string
	To                  uint64
	From                uint64
	Tasks               []string // name of tasks to fill gaps for
}

type LilyNodeAPI

type LilyNodeAPI struct {
	fx.In

	full.ChainAPI
	full.StateAPI
	full.SyncAPI
	common.CommonAPI
	Events         *events.Events
	Scheduler      *schedule.Scheduler
	StorageCatalog *storage.Catalog
	ExecMonitor    stmgr.ExecMonitor
}

func (*LilyNodeAPI) ChainGetTipSetAfterHeight

func (m *LilyNodeAPI) ChainGetTipSetAfterHeight(ctx context.Context, epoch abi.ChainEpoch, key types.TipSetKey) (*types.TipSet, error)

func (*LilyNodeAPI) Daemonized

func (m *LilyNodeAPI) Daemonized() bool

func (*LilyNodeAPI) GetExecutedAndBlockMessagesForTipset

func (m *LilyNodeAPI) GetExecutedAndBlockMessagesForTipset(ctx context.Context, ts, pts *types.TipSet) (*lens.TipSetMessages, error)

func (*LilyNodeAPI) GetMessageExecutionsForTipSet

func (m *LilyNodeAPI) GetMessageExecutionsForTipSet(ctx context.Context, next *types.TipSet, current *types.TipSet) ([]*lens.MessageExecution, error)

func (*LilyNodeAPI) LilyGapFill

func (m *LilyNodeAPI) LilyGapFill(_ context.Context, cfg *LilyGapFillConfig) (schedule.JobID, error)

func (*LilyNodeAPI) LilyGapFind

func (m *LilyNodeAPI) LilyGapFind(_ context.Context, cfg *LilyGapFindConfig) (schedule.JobID, error)

func (*LilyNodeAPI) LilyJobList

func (m *LilyNodeAPI) LilyJobList(_ context.Context) ([]schedule.JobResult, error)

func (*LilyNodeAPI) LilyJobStart

func (m *LilyNodeAPI) LilyJobStart(_ context.Context, ID schedule.JobID) error

func (*LilyNodeAPI) LilyJobStop

func (m *LilyNodeAPI) LilyJobStop(_ context.Context, ID schedule.JobID) error

func (*LilyNodeAPI) LilyWalk

func (m *LilyNodeAPI) LilyWalk(_ context.Context, cfg *LilyWalkConfig) (schedule.JobID, error)

func (*LilyNodeAPI) LilyWatch

func (m *LilyNodeAPI) LilyWatch(_ context.Context, cfg *LilyWatchConfig) (schedule.JobID, error)

func (*LilyNodeAPI) LogList

func (m *LilyNodeAPI) LogList(ctx context.Context) ([]string, error)

func (*LilyNodeAPI) LogSetLevel

func (m *LilyNodeAPI) LogSetLevel(ctx context.Context, subsystem, level string) error

func (*LilyNodeAPI) Shutdown

func (m *LilyNodeAPI) Shutdown(ctx context.Context) error

func (*LilyNodeAPI) StateGetReceipt

func (m *LilyNodeAPI) StateGetReceipt(ctx context.Context, msg cid.Cid, from types.TipSetKey) (*types.MessageReceipt, error)

func (*LilyNodeAPI) Store

func (m *LilyNodeAPI) Store() adt.Store

type LilyWalkConfig

type LilyWalkConfig struct {
	From                int64
	To                  int64
	Name                string
	Tasks               []string
	Window              time.Duration
	RestartOnFailure    bool
	RestartOnCompletion bool
	RestartDelay        time.Duration
	Storage             string // name of storage system to use, may be empty
}

type LilyWatchConfig

type LilyWatchConfig struct {
	Name                string
	Tasks               []string
	Window              time.Duration
	Confidence          int
	RestartOnFailure    bool
	RestartOnCompletion bool
	RestartDelay        time.Duration
	Storage             string // name of storage system to use, may be empty
}

type LogQueryHook

type LogQueryHook struct {
}

used for debugging querries, call ORM.AddHook and this will print all queries.

func (*LogQueryHook) AfterQuery

func (l *LogQueryHook) AfterQuery(ctx context.Context, event *pg.QueryEvent) error

func (*LogQueryHook) BeforeQuery

func (l *LogQueryHook) BeforeQuery(ctx context.Context, evt *pg.QueryEvent) (context.Context, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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