full

package
v0.0.0-...-484cccf Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0, MIT Imports: 90 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EthSubscribeEventTypeHeads               = "newHeads"
	EthSubscribeEventTypeLogs                = "logs"
	EthSubscribeEventTypePendingTransactions = "newPendingTransactions"
)
View Source
const MaxSpendOnFeeDenom = 100
View Source
const MinGasPremium = 100e3

Variables

View Source
var ErrModuleDisabled = errors.New("module disabled, enable with Fevm.EnableEthRPC / LOTUS_FEVM_ENABLEETHRPC")
View Source
var ErrNullRound = errors.New("requested epoch was a null round")
View Source
var ErrUnsupported = errors.New("unsupported method")

Functions

func EthTxHashFromMessageCid

func EthTxHashFromMessageCid(ctx context.Context, c cid.Cid, sa StateAPI) (ethtypes.EthHash, error)

func EthTxHashFromSignedMessage

func EthTxHashFromSignedMessage(ctx context.Context, smsg *types.SignedMessage, sa StateAPI) (ethtypes.EthHash, error)

func EthTxHashGC

func EthTxHashGC(ctx context.Context, retentionDays int, manager *EthTxHashManager)

func WaitForMpoolUpdates

func WaitForMpoolUpdates(ctx context.Context, ch <-chan api.MpoolUpdate, manager *EthTxHashManager)

Types

type ChainAPI

type ChainAPI struct {
	fx.In

	WalletAPI
	ChainModuleAPI

	Chain  *store.ChainStore
	TsExec stmgr.Executor

	// ExposedBlockstore is the global monolith blockstore that is safe to
	// expose externally. In the future, this will be segregated into two
	// blockstores.
	ExposedBlockstore dtypes.ExposedBlockstore

	// BaseBlockstore is the underlying blockstore
	BaseBlockstore dtypes.BaseBlockstore

	Repo repo.LockedRepo
}

func (*ChainAPI) ChainBlockstoreInfo

func (a *ChainAPI) ChainBlockstoreInfo(ctx context.Context) (map[string]interface{}, error)

func (*ChainAPI) ChainCheckBlockstore

func (a *ChainAPI) ChainCheckBlockstore(ctx context.Context) error

func (*ChainAPI) ChainDeleteObj

func (a *ChainAPI) ChainDeleteObj(ctx context.Context, obj cid.Cid) error

func (*ChainAPI) ChainExport

func (a *ChainAPI) ChainExport(ctx context.Context, nroots abi.ChainEpoch, skipoldmsgs bool, tsk types.TipSetKey) (<-chan []byte, error)

func (ChainAPI) ChainExportRangeInternal

func (a ChainAPI) ChainExportRangeInternal(ctx context.Context, head, tail types.TipSetKey, cfg api.ChainExportConfig) error

func (*ChainAPI) ChainGetBlock

func (a *ChainAPI) ChainGetBlock(ctx context.Context, msg cid.Cid) (*types.BlockHeader, error)

func (*ChainAPI) ChainGetEvents

func (a *ChainAPI) ChainGetEvents(ctx context.Context, root cid.Cid) ([]types.Event, error)

ChainGetEvents returns the events under an event AMT root CID.

TODO (raulk) make copies of this logic elsewhere use this (e.g. itests, CLI, events filter).

func (*ChainAPI) ChainGetGenesis

func (a *ChainAPI) ChainGetGenesis(ctx context.Context) (*types.TipSet, error)

func (*ChainAPI) ChainGetMessagesInTipset

func (a *ChainAPI) ChainGetMessagesInTipset(ctx context.Context, tsk types.TipSetKey) ([]api.Message, error)

func (*ChainAPI) ChainGetNode

func (a *ChainAPI) ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error)

func (*ChainAPI) ChainGetParentMessages

func (a *ChainAPI) ChainGetParentMessages(ctx context.Context, bcid cid.Cid) ([]api.Message, error)

func (*ChainAPI) ChainGetParentReceipts

func (a *ChainAPI) ChainGetParentReceipts(ctx context.Context, bcid cid.Cid) ([]*types.MessageReceipt, error)

func (*ChainAPI) ChainGetPath

func (a *ChainAPI) ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error)

func (*ChainAPI) ChainHotGC

func (a *ChainAPI) ChainHotGC(ctx context.Context, opts api.HotGCOpts) error

func (*ChainAPI) ChainPrune

func (a *ChainAPI) ChainPrune(ctx context.Context, opts api.PruneOpts) error

func (*ChainAPI) ChainPutObj

func (a *ChainAPI) ChainPutObj(ctx context.Context, obj blocks.Block) error

func (*ChainAPI) ChainSetHead

func (a *ChainAPI) ChainSetHead(ctx context.Context, tsk types.TipSetKey) error

func (*ChainAPI) ChainStatObj

func (a *ChainAPI) ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (api.ObjStat, error)

func (*ChainAPI) ChainTipSetWeight

func (a *ChainAPI) ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (types.BigInt, error)

type ChainModule

type ChainModule struct {
	fx.In

	Chain *store.ChainStore

	// ExposedBlockstore is the global monolith blockstore that is safe to
	// expose externally. In the future, this will be segregated into two
	// blockstores.
	ExposedBlockstore dtypes.ExposedBlockstore
}

ChainModule provides a default implementation of ChainModuleAPI. It can be swapped out with another implementation through Dependency Injection (for example with a thin RPC client).

func (*ChainModule) ChainGetBlockMessages

func (m *ChainModule) ChainGetBlockMessages(ctx context.Context, msg cid.Cid) (*api.BlockMessages, error)

func (*ChainModule) ChainGetMessage

func (m *ChainModule) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)

func (*ChainModule) ChainGetPath

func (m *ChainModule) ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*api.HeadChange, error)

func (*ChainModule) ChainGetTipSet

func (m *ChainModule) ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error)

func (*ChainModule) ChainGetTipSetAfterHeight

func (m *ChainModule) ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)

func (*ChainModule) ChainGetTipSetByHeight

func (m *ChainModule) ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)

func (*ChainModule) ChainHasObj

func (m *ChainModule) ChainHasObj(ctx context.Context, obj cid.Cid) (bool, error)

func (*ChainModule) ChainHead

func (m *ChainModule) ChainHead(context.Context) (*types.TipSet, error)

func (*ChainModule) ChainNotify

func (m *ChainModule) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error)

func (*ChainModule) ChainReadObj

func (m *ChainModule) ChainReadObj(ctx context.Context, obj cid.Cid) ([]byte, error)

type ChainModuleAPI

type ChainModuleAPI interface {
	ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
	ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
	ChainHasObj(context.Context, cid.Cid) (bool, error)
	ChainHead(context.Context) (*types.TipSet, error)
	ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
	ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
	ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
	ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
	ChainReadObj(context.Context, cid.Cid) ([]byte, error)
	ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*api.HeadChange, error)
}

type EthAPI

type EthAPI struct {
	fx.In

	Chain *store.ChainStore

	EthModuleAPI
	EthEventAPI
}

func (*EthAPI) EthAddressToFilecoinAddress

func (a *EthAPI) EthAddressToFilecoinAddress(ctx context.Context, ethAddress ethtypes.EthAddress) (address.Address, error)

func (*EthAPI) EthGetTransactionByBlockHashAndIndex

func (a *EthAPI) EthGetTransactionByBlockHashAndIndex(context.Context, ethtypes.EthHash, ethtypes.EthUint64) (ethtypes.EthTx, error)

func (*EthAPI) EthGetTransactionByBlockNumberAndIndex

func (a *EthAPI) EthGetTransactionByBlockNumberAndIndex(context.Context, ethtypes.EthUint64, ethtypes.EthUint64) (ethtypes.EthTx, error)

func (*EthAPI) FilecoinAddressToEthAddress

func (a *EthAPI) FilecoinAddressToEthAddress(ctx context.Context, filecoinAddress address.Address) (ethtypes.EthAddress, error)

type EthEvent

type EthEvent struct {
	Chain                *store.ChainStore
	EventFilterManager   *filter.EventFilterManager
	TipSetFilterManager  *filter.TipSetFilterManager
	MemPoolFilterManager *filter.MemPoolFilterManager
	FilterStore          filter.FilterStore
	SubManager           *EthSubscriptionManager
	MaxFilterHeightRange abi.ChainEpoch
	SubscribtionCtx      context.Context
}

func (*EthEvent) EthGetFilterChanges

func (e *EthEvent) EthGetFilterChanges(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error)

func (*EthEvent) EthGetFilterLogs

func (e *EthEvent) EthGetFilterLogs(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error)

func (*EthEvent) EthGetLogs

func (e *EthEvent) EthGetLogs(ctx context.Context, filterSpec *ethtypes.EthFilterSpec) (*ethtypes.EthFilterResult, error)

func (*EthEvent) EthNewBlockFilter

func (e *EthEvent) EthNewBlockFilter(ctx context.Context) (ethtypes.EthFilterID, error)

func (*EthEvent) EthNewFilter

func (e *EthEvent) EthNewFilter(ctx context.Context, filterSpec *ethtypes.EthFilterSpec) (ethtypes.EthFilterID, error)

func (*EthEvent) EthNewPendingTransactionFilter

func (e *EthEvent) EthNewPendingTransactionFilter(ctx context.Context) (ethtypes.EthFilterID, error)

func (*EthEvent) EthSubscribe

func (e *EthEvent) EthSubscribe(ctx context.Context, p jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error)

func (*EthEvent) EthUninstallFilter

func (e *EthEvent) EthUninstallFilter(ctx context.Context, id ethtypes.EthFilterID) (bool, error)

func (*EthEvent) EthUnsubscribe

func (e *EthEvent) EthUnsubscribe(ctx context.Context, id ethtypes.EthSubscriptionID) (bool, error)

func (*EthEvent) GC

func (e *EthEvent) GC(ctx context.Context, ttl time.Duration)

GC runs a garbage collection loop, deleting filters that have not been used within the ttl window

type EthEventAPI

type EthEventAPI interface {
	EthGetLogs(ctx context.Context, filter *ethtypes.EthFilterSpec) (*ethtypes.EthFilterResult, error)
	EthGetFilterChanges(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error)
	EthGetFilterLogs(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error)
	EthNewFilter(ctx context.Context, filter *ethtypes.EthFilterSpec) (ethtypes.EthFilterID, error)
	EthNewBlockFilter(ctx context.Context) (ethtypes.EthFilterID, error)
	EthNewPendingTransactionFilter(ctx context.Context) (ethtypes.EthFilterID, error)
	EthUninstallFilter(ctx context.Context, id ethtypes.EthFilterID) (bool, error)
	EthSubscribe(ctx context.Context, params jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error)
	EthUnsubscribe(ctx context.Context, id ethtypes.EthSubscriptionID) (bool, error)
}

type EthModule

type EthModule struct {
	Chain            *store.ChainStore
	Mpool            *messagepool.MessagePool
	StateManager     *stmgr.StateManager
	EthTxHashManager *EthTxHashManager

	ChainAPI
	MpoolAPI
	StateAPI
}

EthModule provides the default implementation of the standard Ethereum JSON-RPC API.

Execution model reconciliation

Ethereum relies on an immediate block-based execution model. The block that includes a transaction is also the block that executes it. Each block specifies the state root resulting from executing all transactions within it (output state).

In Filecoin, at every epoch there is an unknown number of round winners all of whom are entitled to publish a block. Blocks are collected into a tipset. A tipset is committed only when the subsequent tipset is built on it (i.e. it becomes a parent). Block producers execute the parent tipset and specify the resulting state root in the block being produced. In other words, contrary to Ethereum, each block specifies the input state root.

Ethereum clients expect transactions returned via eth_getBlock* to have a receipt (due to immediate execution). For this reason:

  • eth_blockNumber returns the latest executed epoch (head - 1)
  • The 'latest' block refers to the latest executed epoch (head - 1)
  • The 'pending' block refers to the current speculative tipset (head)
  • eth_getTransactionByHash returns the inclusion tipset of a message, but only after it has executed.
  • eth_getTransactionReceipt ditto.

"Latest executed epoch" refers to the tipset that this node currently accepts as the best parent tipset, based on the blocks it is accumulating within the HEAD tipset.

func (*EthModule) EthAccounts

func (a *EthModule) EthAccounts(context.Context) ([]ethtypes.EthAddress, error)

func (*EthModule) EthBlockNumber

func (a *EthModule) EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error)

func (*EthModule) EthCall

func (a *EthModule) EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam string) (ethtypes.EthBytes, error)

func (*EthModule) EthChainId

func (a *EthModule) EthChainId(ctx context.Context) (ethtypes.EthUint64, error)

func (*EthModule) EthEstimateGas

func (a *EthModule) EthEstimateGas(ctx context.Context, tx ethtypes.EthCall) (ethtypes.EthUint64, error)

func (*EthModule) EthFeeHistory

func (a *EthModule) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (ethtypes.EthFeeHistory, error)

func (*EthModule) EthGasPrice

func (a *EthModule) EthGasPrice(ctx context.Context) (ethtypes.EthBigInt, error)

func (*EthModule) EthGetBalance

func (a *EthModule) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error)

func (*EthModule) EthGetBlockByHash

func (a *EthModule) EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error)

func (*EthModule) EthGetBlockByNumber

func (a *EthModule) EthGetBlockByNumber(ctx context.Context, blkParam string, fullTxInfo bool) (ethtypes.EthBlock, error)

func (*EthModule) EthGetBlockTransactionCountByHash

func (a *EthModule) EthGetBlockTransactionCountByHash(ctx context.Context, blkHash ethtypes.EthHash) (ethtypes.EthUint64, error)

func (*EthModule) EthGetBlockTransactionCountByNumber

func (a *EthModule) EthGetBlockTransactionCountByNumber(ctx context.Context, blkNum ethtypes.EthUint64) (ethtypes.EthUint64, error)

func (*EthModule) EthGetCode

func (a *EthModule) EthGetCode(ctx context.Context, ethAddr ethtypes.EthAddress, blkParam string) (ethtypes.EthBytes, error)

EthGetCode returns string value of the compiled bytecode

func (*EthModule) EthGetMessageCidByTransactionHash

func (a *EthModule) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error)

func (*EthModule) EthGetStorageAt

func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error)

func (*EthModule) EthGetTransactionByHash

func (a *EthModule) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error)

func (*EthModule) EthGetTransactionByHashLimited

func (a *EthModule) EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error)

func (*EthModule) EthGetTransactionCount

func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkParam string) (ethtypes.EthUint64, error)

func (*EthModule) EthGetTransactionHashByCid

func (a *EthModule) EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error)

func (*EthModule) EthGetTransactionReceipt

func (a *EthModule) EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error)

func (*EthModule) EthGetTransactionReceiptLimited

func (a *EthModule) EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error)

func (*EthModule) EthMaxPriorityFeePerGas

func (a *EthModule) EthMaxPriorityFeePerGas(ctx context.Context) (ethtypes.EthBigInt, error)

func (*EthModule) EthProtocolVersion

func (a *EthModule) EthProtocolVersion(ctx context.Context) (ethtypes.EthUint64, error)

func (*EthModule) EthSendRawTransaction

func (a *EthModule) EthSendRawTransaction(ctx context.Context, rawTx ethtypes.EthBytes) (ethtypes.EthHash, error)

func (*EthModule) NetListening

func (a *EthModule) NetListening(ctx context.Context) (bool, error)

func (*EthModule) NetVersion

func (a *EthModule) NetVersion(_ context.Context) (string, error)

func (*EthModule) StateNetworkName

func (a *EthModule) StateNetworkName(ctx context.Context) (dtypes.NetworkName, error)

func (*EthModule) Web3ClientVersion

func (a *EthModule) Web3ClientVersion(ctx context.Context) (string, error)

type EthModuleAPI

type EthModuleAPI interface {
	EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error)
	EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error)
	EthGetBlockTransactionCountByNumber(ctx context.Context, blkNum ethtypes.EthUint64) (ethtypes.EthUint64, error)
	EthGetBlockTransactionCountByHash(ctx context.Context, blkHash ethtypes.EthHash) (ethtypes.EthUint64, error)
	EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error)
	EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxInfo bool) (ethtypes.EthBlock, error)
	EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error)
	EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error)
	EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error)
	EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error)
	EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error)
	EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error)
	EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error)
	EthGetCode(ctx context.Context, address ethtypes.EthAddress, blkOpt string) (ethtypes.EthBytes, error)
	EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error)
	EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error)
	EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (ethtypes.EthFeeHistory, error)
	EthChainId(ctx context.Context) (ethtypes.EthUint64, error)
	NetVersion(ctx context.Context) (string, error)
	NetListening(ctx context.Context) (bool, error)
	EthProtocolVersion(ctx context.Context) (ethtypes.EthUint64, error)
	EthGasPrice(ctx context.Context) (ethtypes.EthBigInt, error)
	EthEstimateGas(ctx context.Context, tx ethtypes.EthCall) (ethtypes.EthUint64, error)
	EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam string) (ethtypes.EthBytes, error)
	EthMaxPriorityFeePerGas(ctx context.Context) (ethtypes.EthBigInt, error)
	EthSendRawTransaction(ctx context.Context, rawTx ethtypes.EthBytes) (ethtypes.EthHash, error)
	Web3ClientVersion(ctx context.Context) (string, error)
}

type EthModuleDummy

type EthModuleDummy struct{}

func (*EthModuleDummy) EthAccounts

func (e *EthModuleDummy) EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error)

func (*EthModuleDummy) EthAddressToFilecoinAddress

func (e *EthModuleDummy) EthAddressToFilecoinAddress(ctx context.Context, ethAddress ethtypes.EthAddress) (address.Address, error)

func (*EthModuleDummy) EthBlockNumber

func (e *EthModuleDummy) EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error)

func (*EthModuleDummy) EthCall

func (e *EthModuleDummy) EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam string) (ethtypes.EthBytes, error)

func (*EthModuleDummy) EthChainId

func (e *EthModuleDummy) EthChainId(ctx context.Context) (ethtypes.EthUint64, error)

func (*EthModuleDummy) EthEstimateGas

func (e *EthModuleDummy) EthEstimateGas(ctx context.Context, tx ethtypes.EthCall) (ethtypes.EthUint64, error)

func (*EthModuleDummy) EthFeeHistory

func (e *EthModuleDummy) EthFeeHistory(ctx context.Context, p jsonrpc.RawParams) (ethtypes.EthFeeHistory, error)

func (*EthModuleDummy) EthGasPrice

func (e *EthModuleDummy) EthGasPrice(ctx context.Context) (ethtypes.EthBigInt, error)

func (*EthModuleDummy) EthGetBalance

func (e *EthModuleDummy) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error)

func (*EthModuleDummy) EthGetBlockByHash

func (e *EthModuleDummy) EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error)

func (*EthModuleDummy) EthGetBlockByNumber

func (e *EthModuleDummy) EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxInfo bool) (ethtypes.EthBlock, error)

func (*EthModuleDummy) EthGetBlockTransactionCountByHash

func (e *EthModuleDummy) EthGetBlockTransactionCountByHash(ctx context.Context, blkHash ethtypes.EthHash) (ethtypes.EthUint64, error)

func (*EthModuleDummy) EthGetBlockTransactionCountByNumber

func (e *EthModuleDummy) EthGetBlockTransactionCountByNumber(ctx context.Context, blkNum ethtypes.EthUint64) (ethtypes.EthUint64, error)

func (*EthModuleDummy) EthGetCode

func (e *EthModuleDummy) EthGetCode(ctx context.Context, address ethtypes.EthAddress, blkOpt string) (ethtypes.EthBytes, error)

func (*EthModuleDummy) EthGetFilterChanges

func (e *EthModuleDummy) EthGetFilterChanges(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error)

func (*EthModuleDummy) EthGetFilterLogs

func (*EthModuleDummy) EthGetLogs

func (*EthModuleDummy) EthGetMessageCidByTransactionHash

func (e *EthModuleDummy) EthGetMessageCidByTransactionHash(ctx context.Context, txHash *ethtypes.EthHash) (*cid.Cid, error)

func (*EthModuleDummy) EthGetStorageAt

func (e *EthModuleDummy) EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error)

func (*EthModuleDummy) EthGetTransactionByBlockHashAndIndex

func (e *EthModuleDummy) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error)

func (*EthModuleDummy) EthGetTransactionByBlockNumberAndIndex

func (e *EthModuleDummy) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error)

func (*EthModuleDummy) EthGetTransactionByHash

func (e *EthModuleDummy) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error)

func (*EthModuleDummy) EthGetTransactionByHashLimited

func (e *EthModuleDummy) EthGetTransactionByHashLimited(ctx context.Context, txHash *ethtypes.EthHash, limit abi.ChainEpoch) (*ethtypes.EthTx, error)

func (*EthModuleDummy) EthGetTransactionCount

func (e *EthModuleDummy) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error)

func (*EthModuleDummy) EthGetTransactionHashByCid

func (e *EthModuleDummy) EthGetTransactionHashByCid(ctx context.Context, cid cid.Cid) (*ethtypes.EthHash, error)

func (*EthModuleDummy) EthGetTransactionReceipt

func (e *EthModuleDummy) EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error)

func (*EthModuleDummy) EthGetTransactionReceiptLimited

func (e *EthModuleDummy) EthGetTransactionReceiptLimited(ctx context.Context, txHash ethtypes.EthHash, limit abi.ChainEpoch) (*api.EthTxReceipt, error)

func (*EthModuleDummy) EthMaxPriorityFeePerGas

func (e *EthModuleDummy) EthMaxPriorityFeePerGas(ctx context.Context) (ethtypes.EthBigInt, error)

func (*EthModuleDummy) EthNewBlockFilter

func (e *EthModuleDummy) EthNewBlockFilter(ctx context.Context) (ethtypes.EthFilterID, error)

func (*EthModuleDummy) EthNewFilter

func (e *EthModuleDummy) EthNewFilter(ctx context.Context, filter *ethtypes.EthFilterSpec) (ethtypes.EthFilterID, error)

func (*EthModuleDummy) EthNewPendingTransactionFilter

func (e *EthModuleDummy) EthNewPendingTransactionFilter(ctx context.Context) (ethtypes.EthFilterID, error)

func (*EthModuleDummy) EthProtocolVersion

func (e *EthModuleDummy) EthProtocolVersion(ctx context.Context) (ethtypes.EthUint64, error)

func (*EthModuleDummy) EthSendRawTransaction

func (e *EthModuleDummy) EthSendRawTransaction(ctx context.Context, rawTx ethtypes.EthBytes) (ethtypes.EthHash, error)

func (*EthModuleDummy) EthSubscribe

func (e *EthModuleDummy) EthSubscribe(ctx context.Context, params jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error)

func (*EthModuleDummy) EthUninstallFilter

func (e *EthModuleDummy) EthUninstallFilter(ctx context.Context, id ethtypes.EthFilterID) (bool, error)

func (*EthModuleDummy) EthUnsubscribe

func (e *EthModuleDummy) EthUnsubscribe(ctx context.Context, id ethtypes.EthSubscriptionID) (bool, error)

func (*EthModuleDummy) NetListening

func (e *EthModuleDummy) NetListening(ctx context.Context) (bool, error)

func (*EthModuleDummy) NetVersion

func (e *EthModuleDummy) NetVersion(ctx context.Context) (string, error)

func (*EthModuleDummy) Web3ClientVersion

func (e *EthModuleDummy) Web3ClientVersion(ctx context.Context) (string, error)

type EthSubscriptionManager

type EthSubscriptionManager struct {
	Chain    *store.ChainStore
	StateAPI StateAPI
	ChainAPI ChainAPI
	// contains filtered or unexported fields
}

func (*EthSubscriptionManager) StartSubscription

func (e *EthSubscriptionManager) StartSubscription(ctx context.Context, out ethSubscriptionCallback, dropFilter func(context.Context, filter.Filter) error) (*ethSubscription, error)

func (*EthSubscriptionManager) StopSubscription

type EthTxHashManager

type EthTxHashManager struct {
	StateAPI              StateAPI
	TransactionHashLookup *ethhashlookup.EthTxHashLookup
}

func (*EthTxHashManager) Apply

func (m *EthTxHashManager) Apply(ctx context.Context, from, to *types.TipSet) error

func (*EthTxHashManager) PopulateExistingMappings

func (m *EthTxHashManager) PopulateExistingMappings(ctx context.Context, minHeight abi.ChainEpoch) error

func (*EthTxHashManager) ProcessSignedMessage

func (m *EthTxHashManager) ProcessSignedMessage(ctx context.Context, msg *types.SignedMessage)

func (*EthTxHashManager) Revert

func (m *EthTxHashManager) Revert(ctx context.Context, from, to *types.TipSet) error

type GasAPI

type GasAPI struct {
	fx.In

	GasModuleAPI

	Stmgr *stmgr.StateManager
	Chain *store.ChainStore
	Mpool *messagepool.MessagePool

	PriceCache *GasPriceCache
}

func (*GasAPI) GasEstimateFeeCap

func (a *GasAPI) GasEstimateFeeCap(
	ctx context.Context,
	msg *types.Message,
	maxqueueblks int64,
	tsk types.TipSetKey,
) (types.BigInt, error)

func (*GasAPI) GasEstimateGasLimit

func (a *GasAPI) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message, tsk types.TipSetKey) (int64, error)

func (*GasAPI) GasEstimateGasPremium

func (a *GasAPI) GasEstimateGasPremium(
	ctx context.Context,
	nblocksincl uint64,
	sender address.Address,
	gaslimit int64,
	_ types.TipSetKey,
) (types.BigInt, error)

type GasMeta

type GasMeta struct {
	Price big.Int
	Limit int64
}

type GasModule

type GasModule struct {
	fx.In
	Stmgr     *stmgr.StateManager
	Chain     *store.ChainStore
	Mpool     *messagepool.MessagePool
	GetMaxFee dtypes.DefaultMaxFeeFunc

	PriceCache *GasPriceCache
}

GasModule provides a default implementation of GasModuleAPI. It can be swapped out with another implementation through Dependency Injection (for example with a thin RPC client).

func (*GasModule) GasEstimateFeeCap

func (m *GasModule) GasEstimateFeeCap(
	ctx context.Context,
	msg *types.Message,
	maxqueueblks int64,
	tsk types.TipSetKey,
) (types.BigInt, error)

func (*GasModule) GasEstimateGasLimit

func (m *GasModule) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message, tsk types.TipSetKey) (int64, error)

func (*GasModule) GasEstimateGasPremium

func (m *GasModule) GasEstimateGasPremium(
	ctx context.Context,
	nblocksincl uint64,
	sender address.Address,
	gaslimit int64,
	_ types.TipSetKey,
) (types.BigInt, error)

func (*GasModule) GasEstimateMessageGas

func (m *GasModule) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, _ types.TipSetKey) (*types.Message, error)

type GasModuleAPI

type GasModuleAPI interface {
	GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
}

type GasPriceCache

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

func NewGasPriceCache

func NewGasPriceCache() *GasPriceCache

func (*GasPriceCache) GetTSGasStats

func (g *GasPriceCache) GetTSGasStats(ctx context.Context, cstore *store.ChainStore, ts *types.TipSet) ([]GasMeta, error)

type MpoolAPI

type MpoolAPI struct {
	fx.In

	MpoolModuleAPI

	WalletAPI
	GasAPI

	RaftAPI

	MessageSigner messagesigner.MsgSigner

	PushLocks *dtypes.MpoolLocker
}

func (*MpoolAPI) MpoolBatchPush

func (a *MpoolAPI) MpoolBatchPush(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error)

func (*MpoolAPI) MpoolBatchPushMessage

func (a *MpoolAPI) MpoolBatchPushMessage(ctx context.Context, msgs []*types.Message, spec *api.MessageSendSpec) ([]*types.SignedMessage, error)

func (*MpoolAPI) MpoolBatchPushUntrusted

func (a *MpoolAPI) MpoolBatchPushUntrusted(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error)

func (*MpoolAPI) MpoolCheckMessages

func (a *MpoolAPI) MpoolCheckMessages(ctx context.Context, protos []*api.MessagePrototype) ([][]api.MessageCheckStatus, error)

func (*MpoolAPI) MpoolCheckPendingMessages

func (a *MpoolAPI) MpoolCheckPendingMessages(ctx context.Context, from address.Address) ([][]api.MessageCheckStatus, error)

func (*MpoolAPI) MpoolCheckReplaceMessages

func (a *MpoolAPI) MpoolCheckReplaceMessages(ctx context.Context, msgs []*types.Message) ([][]api.MessageCheckStatus, error)

func (*MpoolAPI) MpoolClear

func (a *MpoolAPI) MpoolClear(ctx context.Context, local bool) error

func (*MpoolAPI) MpoolGetConfig

func (a *MpoolAPI) MpoolGetConfig(context.Context) (*types.MpoolConfig, error)

func (*MpoolAPI) MpoolGetNonce

func (a *MpoolAPI) MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error)

func (*MpoolAPI) MpoolPending

func (a *MpoolAPI) MpoolPending(ctx context.Context, tsk types.TipSetKey) ([]*types.SignedMessage, error)

func (*MpoolAPI) MpoolPushMessage

func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error)

func (*MpoolAPI) MpoolPushUntrusted

func (a *MpoolAPI) MpoolPushUntrusted(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error)

func (*MpoolAPI) MpoolSelect

func (a *MpoolAPI) MpoolSelect(ctx context.Context, tsk types.TipSetKey, ticketQuality float64) ([]*types.SignedMessage, error)

func (*MpoolAPI) MpoolSetConfig

func (a *MpoolAPI) MpoolSetConfig(ctx context.Context, cfg *types.MpoolConfig) error

func (*MpoolAPI) MpoolSub

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

type MpoolModule

type MpoolModule struct {
	fx.In

	Mpool *messagepool.MessagePool
}

MpoolModule provides a default implementation of MpoolModuleAPI. It can be swapped out with another implementation through Dependency Injection (for example with a thin RPC client).

func (*MpoolModule) MpoolPush

func (m *MpoolModule) MpoolPush(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error)

type MpoolModuleAPI

type MpoolModuleAPI interface {
	MpoolPush(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error)
}

type MsigAPI

type MsigAPI struct {
	fx.In

	StateAPI StateAPI
	MpoolAPI MpoolAPI
}

func (*MsigAPI) MsigAddApprove

func (a *MsigAPI) MsigAddApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, newAdd address.Address, inc bool) (*api.MessagePrototype, error)

func (*MsigAPI) MsigAddCancel

func (a *MsigAPI) MsigAddCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, newAdd address.Address, inc bool) (*api.MessagePrototype, error)

func (*MsigAPI) MsigAddPropose

func (a *MsigAPI) MsigAddPropose(ctx context.Context, msig address.Address, src address.Address, newAdd address.Address, inc bool) (*api.MessagePrototype, error)

func (*MsigAPI) MsigApprove

func (a *MsigAPI) MsigApprove(ctx context.Context, msig address.Address, txID uint64, src address.Address) (*api.MessagePrototype, error)

func (*MsigAPI) MsigApproveTxnHash

func (a *MsigAPI) MsigApproveTxnHash(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (*api.MessagePrototype, error)

func (*MsigAPI) MsigCancel

func (a *MsigAPI) MsigCancel(ctx context.Context, msig address.Address, txID uint64, src address.Address) (*api.MessagePrototype, error)

func (*MsigAPI) MsigCancelTxnHash

func (a *MsigAPI) MsigCancelTxnHash(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (*api.MessagePrototype, error)

func (*MsigAPI) MsigCreate

func (a *MsigAPI) MsigCreate(ctx context.Context, req uint64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (*api.MessagePrototype, error)

TODO: remove gp (gasPrice) from arguments TODO: Add "vesting start" to arguments.

func (*MsigAPI) MsigPropose

func (a *MsigAPI) MsigPropose(ctx context.Context, msig address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (*api.MessagePrototype, error)

func (*MsigAPI) MsigRemoveSigner

func (a *MsigAPI) MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (*api.MessagePrototype, error)

func (*MsigAPI) MsigSwapApprove

func (a *MsigAPI) MsigSwapApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, oldAdd address.Address, newAdd address.Address) (*api.MessagePrototype, error)

func (*MsigAPI) MsigSwapCancel

func (a *MsigAPI) MsigSwapCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, oldAdd address.Address, newAdd address.Address) (*api.MessagePrototype, error)

func (*MsigAPI) MsigSwapPropose

func (a *MsigAPI) MsigSwapPropose(ctx context.Context, msig address.Address, src address.Address, oldAdd address.Address, newAdd address.Address) (*api.MessagePrototype, error)

type RaftAPI

type RaftAPI struct {
	fx.In

	MessageSigner *messagesigner.MessageSignerConsensus `optional:"true"`
}

func (*RaftAPI) GetRaftState

func (r *RaftAPI) GetRaftState(ctx context.Context) (*api.RaftStateData, error)

func (*RaftAPI) IsLeader

func (r *RaftAPI) IsLeader(ctx context.Context) bool

func (*RaftAPI) Leader

func (r *RaftAPI) Leader(ctx context.Context) (peer.ID, error)

func (*RaftAPI) RedirectToLeader

func (r *RaftAPI) RedirectToLeader(ctx context.Context, method string, arg interface{}, ret interface{}) (bool, error)

type StateAPI

type StateAPI struct {
	fx.In

	// TODO: the wallet here is only needed because we have the MinerCreateBlock
	// API attached to the state API. It probably should live somewhere better
	Wallet    api.Wallet
	DefWallet wallet.Default

	StateModuleAPI

	ProofVerifier storiface.Verifier
	StateManager  *stmgr.StateManager
	Chain         *store.ChainStore
	Beacon        beacon.Schedule
	Consensus     consensus.Consensus
	TsExec        stmgr.Executor
}

func (*StateAPI) MinerCreateBlock

func (a *StateAPI) MinerCreateBlock(ctx context.Context, bt *api.BlockTemplate) (*types.BlockMsg, error)

func (*StateAPI) MinerGetBaseInfo

func (a *StateAPI) MinerGetBaseInfo(ctx context.Context, maddr address.Address, epoch abi.ChainEpoch, tsk types.TipSetKey) (*api.MiningBaseInfo, error)

This is on StateAPI because miner.Miner requires this, and MinerAPI requires miner.Miner

func (*StateAPI) MsigGetVestingSchedule

func (a *StateAPI) MsigGetVestingSchedule(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MsigVesting, error)

func (*StateAPI) StateActorCodeCIDs

func (a *StateAPI) StateActorCodeCIDs(ctx context.Context, nv network.Version) (map[string]cid.Cid, error)

func (*StateAPI) StateActorManifestCID

func (a *StateAPI) StateActorManifestCID(ctx context.Context, nv network.Version) (cid.Cid, error)

func (*StateAPI) StateAllMinerFaults

func (a *StateAPI) StateAllMinerFaults(ctx context.Context, lookback abi.ChainEpoch, endTsk types.TipSetKey) ([]*api.Fault, error)

func (*StateAPI) StateCall

func (a *StateAPI) StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (res *api.InvocResult, err error)

func (*StateAPI) StateChangedActors

func (a *StateAPI) StateChangedActors(ctx context.Context, old cid.Cid, new cid.Cid) (map[string]types.Actor, error)

func (*StateAPI) StateCirculatingSupply

func (a *StateAPI) StateCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error)

func (*StateAPI) StateCompute

func (a *StateAPI) StateCompute(ctx context.Context, height abi.ChainEpoch, msgs []*types.Message, tsk types.TipSetKey) (*api.ComputeStateOutput, error)

func (*StateAPI) StateComputeDataCID

func (a *StateAPI) StateComputeDataCID(ctx context.Context, maddr address.Address, sectorType abi.RegisteredSealProof, deals []abi.DealID, tsk types.TipSetKey) (cid.Cid, error)

func (*StateAPI) StateDecodeParams

func (a *StateAPI) StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error)

func (*StateAPI) StateEncodeParams

func (a *StateAPI) StateEncodeParams(ctx context.Context, toActCode cid.Cid, method abi.MethodNum, params json.RawMessage) ([]byte, error)

func (*StateAPI) StateGetAllocation

func (a *StateAPI) StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifreg.AllocationId, tsk types.TipSetKey) (*verifreg.Allocation, error)

func (*StateAPI) StateGetAllocationForPendingDeal

func (a *StateAPI) StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifreg.Allocation, error)

func (*StateAPI) StateGetAllocations

func (a *StateAPI) StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifreg.AllocationId]verifreg.Allocation, error)

func (*StateAPI) StateGetBeaconEntry

func (a *StateAPI) StateGetBeaconEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error)

func (*StateAPI) StateGetClaim

func (a *StateAPI) StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifreg.ClaimId, tsk types.TipSetKey) (*verifreg.Claim, error)

func (*StateAPI) StateGetClaims

func (a *StateAPI) StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifreg.ClaimId]verifreg.Claim, error)

func (*StateAPI) StateGetNetworkParams

func (a *StateAPI) StateGetNetworkParams(ctx context.Context) (*api.NetworkParams, error)

func (*StateAPI) StateGetRandomnessFromBeacon

func (a *StateAPI) StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error)

func (*StateAPI) StateGetRandomnessFromTickets

func (a *StateAPI) StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error)

func (*StateAPI) StateListActors

func (a *StateAPI) StateListActors(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)

func (*StateAPI) StateListMessages

func (a *StateAPI) StateListMessages(ctx context.Context, match *api.MessageMatch, tsk types.TipSetKey, toheight abi.ChainEpoch) ([]cid.Cid, error)

func (*StateAPI) StateLookupRobustAddress

func (a *StateAPI) StateLookupRobustAddress(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

func (*StateAPI) StateMarketDeals

func (a *StateAPI) StateMarketDeals(ctx context.Context, tsk types.TipSetKey) (map[string]*api.MarketDeal, error)

func (*StateAPI) StateMarketParticipants

func (a *StateAPI) StateMarketParticipants(ctx context.Context, tsk types.TipSetKey) (map[string]api.MarketBalance, error)

func (*StateAPI) StateMinerActiveSectors

func (a *StateAPI) StateMinerActiveSectors(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error)

func (*StateAPI) StateMinerAllocated

func (a *StateAPI) StateMinerAllocated(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*bitfield.BitField, error)

func (*StateAPI) StateMinerAvailableBalance

func (a *StateAPI) StateMinerAvailableBalance(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (types.BigInt, error)

func (*StateAPI) StateMinerDeadlines

func (a *StateAPI) StateMinerDeadlines(ctx context.Context, m address.Address, tsk types.TipSetKey) ([]api.Deadline, error)

func (*StateAPI) StateMinerFaults

func (a *StateAPI) StateMinerFaults(ctx context.Context, addr address.Address, tsk types.TipSetKey) (bitfield.BitField, error)

func (*StateAPI) StateMinerInitialPledgeCollateral

func (a *StateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci minertypes.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error)

func (*StateAPI) StateMinerPartitions

func (a *StateAPI) StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error)

func (*StateAPI) StateMinerPreCommitDepositForPower

func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci minertypes.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error)

func (*StateAPI) StateMinerRecoveries

func (a *StateAPI) StateMinerRecoveries(ctx context.Context, addr address.Address, tsk types.TipSetKey) (bitfield.BitField, error)

func (*StateAPI) StateMinerSectorAllocated

func (a *StateAPI) StateMinerSectorAllocated(ctx context.Context, maddr address.Address, s abi.SectorNumber, tsk types.TipSetKey) (bool, error)

func (*StateAPI) StateMinerSectorCount

func (a *StateAPI) StateMinerSectorCount(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MinerSectors, error)

func (*StateAPI) StateMinerSectors

func (a *StateAPI) StateMinerSectors(ctx context.Context, addr address.Address, sectorNos *bitfield.BitField, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error)

func (*StateAPI) StateNetworkName

func (a *StateAPI) StateNetworkName(ctx context.Context) (dtypes.NetworkName, error)

func (*StateAPI) StateReadState

func (a *StateAPI) StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*api.ActorState, error)

func (*StateAPI) StateReplay

func (a *StateAPI) StateReplay(ctx context.Context, tsk types.TipSetKey, mc cid.Cid) (*api.InvocResult, error)

func (*StateAPI) StateSectorExpiration

func (a *StateAPI) StateSectorExpiration(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorExpiration, error)

func (*StateAPI) StateSectorPartition

func (a *StateAPI) StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorLocation, error)

func (*StateAPI) StateSectorPreCommitInfo

func (a *StateAPI) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*minertypes.SectorPreCommitOnChainInfo, error)

func (*StateAPI) StateVMCirculatingSupplyInternal

func (a *StateAPI) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error)

func (*StateAPI) StateVerifiedRegistryRootKey

func (a *StateAPI) StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error)

func (*StateAPI) StateVerifierStatus

func (a *StateAPI) StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)

StateVerifiedClientStatus returns the data cap for the given address. Returns zero if there is no entry in the data cap table for the address.

type StateModule

type StateModule struct {
	fx.In

	StateManager *stmgr.StateManager
	Chain        *store.ChainStore
}

StateModule provides a default implementation of StateModuleAPI. It can be swapped out with another implementation through Dependency Injection (for example with a thin RPC client).

func (*StateModule) MsigGetAvailableBalance

func (m *StateModule) MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)

func (*StateModule) MsigGetPending

func (m *StateModule) MsigGetPending(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*api.MsigTransaction, error)

func (*StateModule) MsigGetVested

func (m *StateModule) MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)

func (*StateModule) StateAccountKey

func (m *StateModule) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

func (*StateModule) StateDealProviderCollateralBounds

func (m *StateModule) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)

StateDealProviderCollateralBounds returns the min and max collateral a storage provider can issue. It takes the deal size and verified status as parameters.

func (*StateModule) StateGetActor

func (m *StateModule) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (a *types.Actor, err error)

func (*StateModule) StateListMiners

func (m *StateModule) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)

func (*StateModule) StateLookupID

func (m *StateModule) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

func (*StateModule) StateMarketBalance

func (m *StateModule) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)

func (*StateModule) StateMarketStorageDeal

func (m *StateModule) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)

func (*StateModule) StateMinerInfo

func (m *StateModule) StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (api.MinerInfo, error)

func (*StateModule) StateMinerPower

func (m *StateModule) StateMinerPower(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*api.MinerPower, error)

func (*StateModule) StateMinerProvingDeadline

func (m *StateModule) StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)

func (*StateModule) StateNetworkVersion

func (m *StateModule) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error)

func (*StateModule) StateSearchMsg

func (m *StateModule) StateSearchMsg(ctx context.Context, tsk types.TipSetKey, msg cid.Cid, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)

func (*StateModule) StateSectorGetInfo

func (m *StateModule) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)

Returns nil, nil if sector is not found

func (*StateModule) StateVerifiedClientStatus

func (m *StateModule) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)

StateVerifiedClientStatus returns the data cap for the given address. Returns zero if there is no entry in the data cap table for the address.

func (*StateModule) StateWaitMsg

func (m *StateModule) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)

type StateModuleAPI

type StateModuleAPI interface {
	MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
	MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
	MsigGetPending(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*api.MsigTransaction, error)
	StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
	StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error)
	StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error)
	StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
	StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
	StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)
	StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)
	StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (api.MinerInfo, error)
	StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
	StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
	StateNetworkVersion(ctx context.Context, key types.TipSetKey) (network.Version, error)
	StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
	StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
	StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
	StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error)
}

type SyncAPI

type SyncAPI struct {
	fx.In

	SlashFilter *slashfilter.SlashFilter `optional:"true"`
	Syncer      *chain.Syncer
	PubSub      *pubsub.PubSub
	NetName     dtypes.NetworkName
}

func (*SyncAPI) SyncCheckBad

func (a *SyncAPI) SyncCheckBad(ctx context.Context, bcid cid.Cid) (string, error)

func (*SyncAPI) SyncCheckpoint

func (a *SyncAPI) SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error

func (*SyncAPI) SyncIncomingBlocks

func (a *SyncAPI) SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error)

func (*SyncAPI) SyncMarkBad

func (a *SyncAPI) SyncMarkBad(ctx context.Context, bcid cid.Cid) error

func (*SyncAPI) SyncState

func (a *SyncAPI) SyncState(ctx context.Context) (*api.SyncState, error)

func (*SyncAPI) SyncSubmitBlock

func (a *SyncAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error

func (*SyncAPI) SyncUnmarkAllBad

func (a *SyncAPI) SyncUnmarkAllBad(ctx context.Context) error

func (*SyncAPI) SyncUnmarkBad

func (a *SyncAPI) SyncUnmarkBad(ctx context.Context, bcid cid.Cid) error

func (*SyncAPI) SyncValidateTipset

func (a *SyncAPI) SyncValidateTipset(ctx context.Context, tsk types.TipSetKey) (bool, error)

type WalletAPI

type WalletAPI struct {
	fx.In

	StateManagerAPI stmgr.StateManagerAPI
	Default         wallet.Default
	api.Wallet
}

func (*WalletAPI) WalletBalance

func (a *WalletAPI) WalletBalance(ctx context.Context, addr address.Address) (types.BigInt, error)

func (*WalletAPI) WalletDefaultAddress

func (a *WalletAPI) WalletDefaultAddress(ctx context.Context) (address.Address, error)

func (*WalletAPI) WalletSetDefault

func (a *WalletAPI) WalletSetDefault(ctx context.Context, addr address.Address) error

func (*WalletAPI) WalletSign

func (a *WalletAPI) WalletSign(ctx context.Context, k address.Address, msg []byte) (*crypto.Signature, error)

func (*WalletAPI) WalletSignMessage

func (a *WalletAPI) WalletSignMessage(ctx context.Context, k address.Address, msg *types.Message) (*types.SignedMessage, error)

func (*WalletAPI) WalletValidateAddress

func (a *WalletAPI) WalletValidateAddress(ctx context.Context, str string) (address.Address, error)

func (*WalletAPI) WalletVerify

func (a *WalletAPI) WalletVerify(ctx context.Context, k address.Address, msg []byte, sig *crypto.Signature) (bool, error)

Jump to

Keyboard shortcuts

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