Documentation ¶
Index ¶
- Constants
- Variables
- func CapGasFee(msg *venusTypes.UnsignedMessage, maxFee abi.TokenAmount)
- func DialArgs(addr string) (string, error)
- func MessagerService() fx.Option
- func ToSignedMsg(ctx context.Context, walletCli IWalletClient, msg *types.Message) (venusTypes.SignedMessage, error)
- type AddressInfo
- type AddressService
- func (addressService *AddressService) DeleteAddress(ctx context.Context, addr address.Address) (address.Address, error)
- func (addressService *AddressService) GetAddress(ctx context.Context, addr address.Address) (*types.Address, error)
- func (addressService *AddressService) HasAddress(ctx context.Context, addr address.Address) (bool, error)
- func (addressService *AddressService) ListAddress(ctx context.Context) ([]*types.Address, error)
- func (addressService *AddressService) SaveAddress(ctx context.Context, address *types.Address) (types.UUID, error)
- func (addressService *AddressService) UpdateAddress(ctx context.Context, address *types.Address) error
- func (addressService *AddressService) UpdateNonce(ctx context.Context, addr address.Address, nonce uint64) (address.Address, error)
- type IWalletClient
- type MemWallet
- func (memWallet *MemWallet) WalletHas(ctx context.Context, addr address.Address) (bool, error)
- func (memWallet *MemWallet) WalletList(ctx context.Context) ([]address.Address, error)
- func (memWallet *MemWallet) WalletSign(ctx context.Context, addr address.Address, data []byte, meta core.MsgMeta) (*crypto.Signature, error)
- type MessageSelector
- func (messageSelector *MessageSelector) GasEstimateMessageGas(ctx context.Context, msg *venusTypes.UnsignedMessage, meta *types.MsgMeta, ...) (*venusTypes.UnsignedMessage, error)
- func (messageSelector *MessageSelector) SelectMessage(ctx context.Context, ts *venusTypes.TipSet) (*MsgSelectResult, error)
- type MessageService
- func (ms *MessageService) GetMessageByCid(ctx context.Context, id cid.Cid) (*types.Message, error)
- func (ms *MessageService) GetMessageByFromAndNonce(ctx context.Context, from address.Address, nonce uint64) (*types.Message, error)
- func (ms *MessageService) GetMessageBySignedCid(ctx context.Context, signedCid cid.Cid) (*types.Message, error)
- func (ms *MessageService) GetMessageByUid(ctx context.Context, id string) (*types.Message, error)
- func (ms *MessageService) GetMessageByUnsignedCid(ctx context.Context, unsignedCid cid.Cid) (*types.Message, error)
- func (ms *MessageService) GetMessageState(ctx context.Context, id string) (types.MessageState, error)
- func (ms *MessageService) HasMessageByUid(ctx context.Context, id string) (bool, error)
- func (ms *MessageService) ListBlockedMessage(ctx context.Context, addr address.Address, d time.Duration) ([]*types.Message, error)
- func (ms *MessageService) ListFailedMessage(ctx context.Context) ([]*types.Message, error)
- func (ms *MessageService) ListFilledMessageByAddress(ctx context.Context, addr address.Address) ([]*types.Message, error)
- func (ms *MessageService) ListMessage(ctx context.Context) ([]*types.Message, error)
- func (ms *MessageService) ListMessageByAddress(ctx context.Context, addr address.Address) ([]*types.Message, error)
- func (ms *MessageService) ListMessageByFromState(ctx context.Context, from address.Address, state types.MessageState, ...) ([]*types.Message, error)
- func (ms *MessageService) MarkBadMessage(ctx context.Context, id string) (struct{}, error)
- func (ms *MessageService) ProcessNewHead(ctx context.Context, apply, revert []*venusTypes.TipSet) error
- func (ms *MessageService) PushMessage(ctx context.Context, msg *types.Message) error
- func (ms *MessageService) ReconnectCheck(ctx context.Context, head *venusTypes.TipSet) error
- func (ms *MessageService) ReplaceMessage(ctx context.Context, id string, auto bool, maxFee string, gasLimit int64, ...) (cid.Cid, error)
- func (ms *MessageService) RepublishMessage(ctx context.Context, id string) (struct{}, error)
- func (ms *MessageService) StartPushMessage(ctx context.Context)
- func (ms *MessageService) UpdateAllFilledMessage(ctx context.Context) (int, error)
- func (ms *MessageService) UpdateMessageInfoByCid(unsignedCid string, receipt *venusTypes.MessageReceipt, height abi.ChainEpoch, ...) (string, error)
- func (ms *MessageService) UpdateMessageStateByCid(ctx context.Context, cid string, state types.MessageState) (string, error)
- func (ms *MessageService) UpdateMessageStateByID(ctx context.Context, id string, state types.MessageState) (string, error)
- func (ms *MessageService) UpdateSignedMessageByID(ctx context.Context, id string) (string, error)
- type MessageState
- func (ms *MessageState) DeleteMessage(id string)
- func (ms *MessageState) GetMessage(id string) (*types.Message, bool)
- func (ms *MessageState) GetMessageStateByCid(cid string) (types.MessageState, bool)
- func (ms *MessageState) MutatorMessage(id string, f func(*types.Message) error) error
- func (ms *MessageState) SetMessage(id string, message *types.Message)
- func (ms *MessageState) UpdateMessageByCid(cid cid.Cid, f func(message *types.Message) error) error
- type MsgSelectResult
- type NodeClient
- type NodeEvents
- type NodeService
- func (ns *NodeService) DeleteNode(ctx context.Context, name string) (struct{}, error)
- func (ns *NodeService) GetNode(ctx context.Context, name string) (*types.Node, error)
- func (ns *NodeService) HasNode(ctx context.Context, name string) (bool, error)
- func (ns *NodeService) ListNode(ctx context.Context) ([]*types.Node, error)
- func (ns *NodeService) SaveNode(ctx context.Context, node *types.Node) (struct{}, error)
- type Params
- type ServiceMap
- type SharedParamsService
- func (sps *SharedParamsService) GetParams() *Params
- func (sps *SharedParamsService) GetSharedParams(ctx context.Context) (*types.SharedParams, error)
- func (sps *SharedParamsService) RefreshSharedParams(ctx context.Context) (struct{}, error)
- func (sps *SharedParamsService) SetParams(sharedParams *types.SharedParams)
- func (sps *SharedParamsService) SetSharedParams(ctx context.Context, params *types.SharedParams) (struct{}, error)
- type TipsetCache
- type WalletClient
- func (walletClient *WalletClient) WalletHas(ctx context.Context, addr address.Address) (bool, error)
- func (walletClient *WalletClient) WalletList(ctx context.Context) ([]address.Address, error)
- func (walletClient *WalletClient) WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta core.MsgMeta) (*crypto.Signature, error)
- type WalletInfo
- type WalletService
- func (walletService *WalletService) ActiveAddress(ctx context.Context, walletName string, addr address.Address) (address.Address, error)
- func (walletService *WalletService) AllAddresses() map[address.Address]struct{}
- func (walletService *WalletService) DeleteWallet(ctx context.Context, name string) (string, error)
- func (walletService *WalletService) ForbiddenAddress(ctx context.Context, walletName string, addr address.Address) (address.Address, error)
- func (walletService *WalletService) GetAddressInfo(walletName string, addr address.Address) (AddressInfo, bool)
- func (walletService *WalletService) GetAddressesInfo(addr address.Address) (map[string]AddressInfo, bool)
- func (walletService *WalletService) GetWalletAddress(ctx context.Context, walletName string, addr address.Address) (*types.WalletAddress, error)
- func (walletService *WalletService) GetWalletByID(ctx context.Context, uuid types.UUID) (*types.Wallet, error)
- func (walletService *WalletService) GetWalletByName(ctx context.Context, name string) (*types.Wallet, error)
- func (walletService *WalletService) HasAddress(walletName string, addr address.Address) bool
- func (walletService *WalletService) HasWallet(ctx context.Context, name string) (bool, error)
- func (walletService *WalletService) HasWalletAddress(ctx context.Context, walletName string, addr address.Address) (bool, error)
- func (walletService *WalletService) ListRemoteWalletAddress(ctx context.Context, walletName string) ([]address.Address, error)
- func (walletService *WalletService) ListWallet(ctx context.Context) ([]*types.Wallet, error)
- func (walletService *WalletService) ListWalletAddress(ctx context.Context) ([]*types.WalletAddress, error)
- func (walletService *WalletService) ListWalletClient() ([]string, []IWalletClient)
- func (walletService *WalletService) ProcessWallet(ctx context.Context, walletName string, cli IWalletClient) error
- func (walletService *WalletService) SaveWallet(ctx context.Context, wallet *types.Wallet) (types.UUID, error)
- func (walletService *WalletService) SetSelectMsgNum(ctx context.Context, walletName string, addr address.Address, num uint64) (address.Address, error)
Constants ¶
View Source
const ( MaxHeadChangeProcess = 5 LookBackLimit = 900 )
Variables ¶
View Source
var DefaultMaxFee = venusTypes.MustParseFIL("0.007")
View Source
var ErrRecordExist = xerrors.Errorf("record exist")
Functions ¶
func CapGasFee ¶
func CapGasFee(msg *venusTypes.UnsignedMessage, maxFee abi.TokenAmount)
func MessagerService ¶
func ToSignedMsg ¶
func ToSignedMsg(ctx context.Context, walletCli IWalletClient, msg *types.Message) (venusTypes.SignedMessage, error)
Types ¶
type AddressInfo ¶
type AddressInfo struct { State types.State SelectMsgNum uint64 WalletClient IWalletClient }
type AddressService ¶
type AddressService struct {
// contains filtered or unexported fields
}
func NewAddressService ¶
func NewAddressService(repo repo.Repo, logger *logrus.Logger) *AddressService
func (*AddressService) DeleteAddress ¶
func (addressService *AddressService) DeleteAddress(ctx context.Context, addr address.Address) (address.Address, error)
func (*AddressService) GetAddress ¶
func (*AddressService) HasAddress ¶
func (addressService *AddressService) HasAddress(ctx context.Context, addr address.Address) (bool, error)
func (*AddressService) ListAddress ¶
func (*AddressService) SaveAddress ¶
func (*AddressService) UpdateAddress ¶
func (*AddressService) UpdateNonce ¶
func (addressService *AddressService) UpdateNonce(ctx context.Context, addr address.Address, nonce uint64) (address.Address, error)
type IWalletClient ¶
type MemWallet ¶
type MemWallet struct {
// contains filtered or unexported fields
}
func (*MemWallet) WalletList ¶
type MessageSelector ¶
type MessageSelector struct {
// contains filtered or unexported fields
}
func NewMessageSelector ¶
func NewMessageSelector(repo repo.Repo, log *logrus.Logger, cfg *config.MessageServiceConfig, nodeClient *NodeClient, addressService *AddressService, walletService *WalletService, sps *SharedParamsService) *MessageSelector
func (*MessageSelector) GasEstimateMessageGas ¶
func (messageSelector *MessageSelector) GasEstimateMessageGas(ctx context.Context, msg *venusTypes.UnsignedMessage, meta *types.MsgMeta, tsk venusTypes.TipSetKey) (*venusTypes.UnsignedMessage, error)
func (*MessageSelector) SelectMessage ¶
func (messageSelector *MessageSelector) SelectMessage(ctx context.Context, ts *venusTypes.TipSet) (*MsgSelectResult, error)
type MessageService ¶
type MessageService struct {
// contains filtered or unexported fields
}
func NewMessageService ¶
func NewMessageService(repo repo.Repo, nc *NodeClient, logger *logrus.Logger, cfg *config.MessageServiceConfig, messageState *MessageState, addressService *AddressService, walletService *WalletService, sps *SharedParamsService, nodeService *NodeService) (*MessageService, error)
func (*MessageService) GetMessageByCid ¶
func (*MessageService) GetMessageByFromAndNonce ¶
func (*MessageService) GetMessageBySignedCid ¶
func (*MessageService) GetMessageByUid ¶
func (*MessageService) GetMessageByUnsignedCid ¶
func (*MessageService) GetMessageState ¶
func (ms *MessageService) GetMessageState(ctx context.Context, id string) (types.MessageState, error)
func (*MessageService) HasMessageByUid ¶
func (*MessageService) ListBlockedMessage ¶
func (*MessageService) ListFailedMessage ¶
func (*MessageService) ListFilledMessageByAddress ¶
func (*MessageService) ListMessage ¶
func (*MessageService) ListMessageByAddress ¶
func (*MessageService) ListMessageByFromState ¶
func (ms *MessageService) ListMessageByFromState(ctx context.Context, from address.Address, state types.MessageState, pageIndex, pageSize int) ([]*types.Message, error)
func (*MessageService) MarkBadMessage ¶
func (ms *MessageService) MarkBadMessage(ctx context.Context, id string) (struct{}, error)
func (*MessageService) ProcessNewHead ¶
func (ms *MessageService) ProcessNewHead(ctx context.Context, apply, revert []*venusTypes.TipSet) error
func (*MessageService) PushMessage ¶
func (*MessageService) ReconnectCheck ¶
func (ms *MessageService) ReconnectCheck(ctx context.Context, head *venusTypes.TipSet) error
func (*MessageService) ReplaceMessage ¶
func (*MessageService) RepublishMessage ¶
func (ms *MessageService) RepublishMessage(ctx context.Context, id string) (struct{}, error)
func (*MessageService) StartPushMessage ¶
func (ms *MessageService) StartPushMessage(ctx context.Context)
func (*MessageService) UpdateAllFilledMessage ¶
func (ms *MessageService) UpdateAllFilledMessage(ctx context.Context) (int, error)
func (*MessageService) UpdateMessageInfoByCid ¶
func (ms *MessageService) UpdateMessageInfoByCid(unsignedCid string, receipt *venusTypes.MessageReceipt, height abi.ChainEpoch, state types.MessageState, tsKey venusTypes.TipSetKey) (string, error)
func (*MessageService) UpdateMessageStateByCid ¶
func (ms *MessageService) UpdateMessageStateByCid(ctx context.Context, cid string, state types.MessageState) (string, error)
func (*MessageService) UpdateMessageStateByID ¶
func (ms *MessageService) UpdateMessageStateByID(ctx context.Context, id string, state types.MessageState) (string, error)
func (*MessageService) UpdateSignedMessageByID ¶
type MessageState ¶
type MessageState struct {
// contains filtered or unexported fields
}
func NewMessageState ¶
func NewMessageState(repo repo.Repo, logger *logrus.Logger, cfg *config.MessageStateConfig) (*MessageState, error)
func (*MessageState) DeleteMessage ¶
func (ms *MessageState) DeleteMessage(id string)
func (*MessageState) GetMessage ¶
func (ms *MessageState) GetMessage(id string) (*types.Message, bool)
func (*MessageState) GetMessageStateByCid ¶
func (ms *MessageState) GetMessageStateByCid(cid string) (types.MessageState, bool)
func (*MessageState) MutatorMessage ¶
func (*MessageState) SetMessage ¶
func (ms *MessageState) SetMessage(id string, message *types.Message)
func (*MessageState) UpdateMessageByCid ¶
func (ms *MessageState) UpdateMessageByCid(cid cid.Cid, f func(message *types.Message) error) error
type MsgSelectResult ¶
type MsgSelectResult struct { SelectMsg []*types.Message ExpireMsg []*types.Message ToPushMsg []*venusTypes.SignedMessage ModifyAddress []*types.Address ErrMsg []msgErrInfo }
type NodeClient ¶
type NodeClient struct { ChainNotify func(context.Context) (<-chan []*chain.HeadChange, error) ChainHead func(context.Context) (*types.TipSet, error) ChainGetTipSet func(context.Context, types.TipSetKey) (*types.TipSet, error) ChainGetBlock func(context.Context, cid.Cid) (*types.BlockHeader, error) ChainGetBlockMessages func(context.Context, cid.Cid) (*chain2.BlockMessages, error) ChainGetParentMessages func(ctx context.Context, bcid cid.Cid) ([]chain2.Message, error) ChainGetParentReceipts func(context.Context, cid.Cid) ([]*types.MessageReceipt, error) StateAccountKey func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) StateSearchMsg func(context.Context, cid.Cid) (*chain.MsgLookup, error) StateGetActor func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error) GasEstimateMessageGas func(context.Context, *types.UnsignedMessage, *types.MessageSendSpec, types.TipSetKey) (*types.UnsignedMessage, error) GasEstimateFeeCap func(context.Context, *types.UnsignedMessage, int64, types.TipSetKey) (big.Int, error) GasEstimateGasPremium func(context.Context, uint64, address.Address, int64, types.TipSetKey) (big.Int, error) GasEstimateGasLimit func(ctx context.Context, msgIn *types.UnsignedMessage, tsk types.TipSetKey) (int64, error) MpoolPush func(context.Context, *types.SignedMessage) (cid.Cid, error) MpoolBatchPush func(context.Context, []*types.SignedMessage) ([]cid.Cid, error) }
func NewNodeClient ¶
func NewNodeClient(ctx context.Context, cfg *config.NodeConfig) (*NodeClient, jsonrpc.ClientCloser, error)
type NodeEvents ¶
type NodeEvents struct {
// contains filtered or unexported fields
}
func StartNodeEvents ¶
func StartNodeEvents(lc fx.Lifecycle, client *NodeClient, msgService *MessageService, log *logrus.Logger) *NodeEvents
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
func NewNodeService ¶
func NewNodeService(repo repo.Repo, logger *logrus.Logger) *NodeService
func (*NodeService) DeleteNode ¶
func (ns *NodeService) DeleteNode(ctx context.Context, name string) (struct{}, error)
type ServiceMap ¶
func MakeServiceMap ¶
func MakeServiceMap(msgService *MessageService, walletService *WalletService, addressService *AddressService, sps *SharedParamsService, nodeService *NodeService) ServiceMap
type SharedParamsService ¶
type SharedParamsService struct {
// contains filtered or unexported fields
}
func NewSharedParamsService ¶
func (*SharedParamsService) GetParams ¶
func (sps *SharedParamsService) GetParams() *Params
func (*SharedParamsService) GetSharedParams ¶
func (sps *SharedParamsService) GetSharedParams(ctx context.Context) (*types.SharedParams, error)
func (*SharedParamsService) RefreshSharedParams ¶
func (sps *SharedParamsService) RefreshSharedParams(ctx context.Context) (struct{}, error)
func (*SharedParamsService) SetParams ¶
func (sps *SharedParamsService) SetParams(sharedParams *types.SharedParams)
func (*SharedParamsService) SetSharedParams ¶
func (sps *SharedParamsService) SetSharedParams(ctx context.Context, params *types.SharedParams) (struct{}, error)
type TipsetCache ¶
type TipsetCache struct { Cache map[int64]*tipsetFormat CurrHeight int64 // contains filtered or unexported fields }
func (*TipsetCache) AddTs ¶
func (tsCache *TipsetCache) AddTs(list ...*tipsetFormat)
func (*TipsetCache) ExistTs ¶
func (tsCache *TipsetCache) ExistTs(height int64) bool
func (*TipsetCache) ListTs ¶
func (tsCache *TipsetCache) ListTs() tipsetList
func (*TipsetCache) ReduceTs ¶
func (tsCache *TipsetCache) ReduceTs()
func (*TipsetCache) RemoveTs ¶
func (tsCache *TipsetCache) RemoveTs(list []*tipsetFormat)
type WalletClient ¶
type WalletClient struct { Internal struct { WalletList func(context.Context) ([]address.Address, error) WalletHas func(ctx context.Context, address address.Address) (bool, error) WalletSign func(ctx context.Context, signer address.Address, toSign []byte, meta core.MsgMeta) (*crypto.Signature, error) } }
func NewWalletClient ¶
func NewWalletClient(ctx context.Context, url, token string) (WalletClient, jsonrpc.ClientCloser, error)
func (*WalletClient) WalletHas ¶
func (walletClient *WalletClient) WalletHas(ctx context.Context, addr address.Address) (bool, error)
func (*WalletClient) WalletList ¶
func (walletClient *WalletClient) WalletList(ctx context.Context) ([]address.Address, error)
type WalletInfo ¶
type WalletInfo struct {
// contains filtered or unexported fields
}
type WalletService ¶
type WalletService struct {
// contains filtered or unexported fields
}
func NewWalletService ¶
func NewWalletService(repo repo.Repo, logger *logrus.Logger, nodeClient *NodeClient, addressService *AddressService, cfg *config.WalletConfig, sps *SharedParamsService) (*WalletService, error)
func (*WalletService) ActiveAddress ¶
func (walletService *WalletService) ActiveAddress(ctx context.Context, walletName string, addr address.Address) (address.Address, error)
func (*WalletService) AllAddresses ¶
func (walletService *WalletService) AllAddresses() map[address.Address]struct{}
func (*WalletService) DeleteWallet ¶
func (*WalletService) ForbiddenAddress ¶
func (walletService *WalletService) ForbiddenAddress(ctx context.Context, walletName string, addr address.Address) (address.Address, error)
func (*WalletService) GetAddressInfo ¶
func (walletService *WalletService) GetAddressInfo(walletName string, addr address.Address) (AddressInfo, bool)
func (*WalletService) GetAddressesInfo ¶
func (walletService *WalletService) GetAddressesInfo(addr address.Address) (map[string]AddressInfo, bool)
func (*WalletService) GetWalletAddress ¶
func (walletService *WalletService) GetWalletAddress(ctx context.Context, walletName string, addr address.Address) (*types.WalletAddress, error)
func (*WalletService) GetWalletByID ¶
func (*WalletService) GetWalletByName ¶
func (*WalletService) HasAddress ¶
func (walletService *WalletService) HasAddress(walletName string, addr address.Address) bool
func (*WalletService) HasWalletAddress ¶
func (*WalletService) ListRemoteWalletAddress ¶
func (walletService *WalletService) ListRemoteWalletAddress(ctx context.Context, walletName string) ([]address.Address, error)
func (*WalletService) ListWallet ¶
func (*WalletService) ListWalletAddress ¶
func (walletService *WalletService) ListWalletAddress(ctx context.Context) ([]*types.WalletAddress, error)
func (*WalletService) ListWalletClient ¶
func (walletService *WalletService) ListWalletClient() ([]string, []IWalletClient)
func (*WalletService) ProcessWallet ¶
func (walletService *WalletService) ProcessWallet(ctx context.Context, walletName string, cli IWalletClient) error
func (*WalletService) SaveWallet ¶
func (*WalletService) SetSelectMsgNum ¶
Click to show internal directories.
Click to hide internal directories.