Documentation ¶
Index ¶
- Constants
- Variables
- func CapGasFee(msg *venusTypes.Message, maxFee abi.TokenAmount)
- func MessagerService() fx.Option
- func ToSignedMsg(ctx context.Context, walletCli gatewayAPI.IWalletClient, msg *types.Message, ...) (venusTypes.SignedMessage, error)
- type AddressService
- func (addressService *AddressService) ActiveAddress(ctx context.Context, addr address.Address) error
- func (addressService *AddressService) ActiveAddresses(ctx context.Context) map[address.Address]struct{}
- func (addressService *AddressService) DeleteAddress(ctx context.Context, addr address.Address) error
- func (addressService *AddressService) ForbiddenAddress(ctx context.Context, addr address.Address) error
- func (addressService *AddressService) GetAccountsOfSigner(ctx context.Context, addr address.Address) ([]string, 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) ListActiveAddress(ctx context.Context) ([]*types.Address, error)
- func (addressService *AddressService) ListAddress(ctx context.Context) ([]*types.Address, error)
- func (addressService *AddressService) SaveAddress(ctx context.Context, address *types.Address) (venusTypes.UUID, error)
- func (addressService *AddressService) SetFeeParams(ctx context.Context, params *types.AddressSpec) error
- func (addressService *AddressService) SetSelectMsgNum(ctx context.Context, addr address.Address, num uint64) error
- func (addressService *AddressService) UpdateNonce(ctx context.Context, addr address.Address, nonce uint64) error
- func (addressService *AddressService) WalletHas(ctx context.Context, addr address.Address) (bool, error)
- type GasSpec
- type IAddressService
- type IMessageService
- type INodeService
- type MessageService
- func (ms *MessageService) ClearUnFillMessage(ctx context.Context, addr address.Address) (int, error)
- func (ms *MessageService) GetActorCfgByID(ctx context.Context, id venusTypes.UUID) (*types.ActorCfg, error)
- func (ms *MessageService) GetMessageByCid(ctx context.Context, cid 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) ListActorCfg(ctx context.Context) ([]*types.ActorCfg, error)
- func (ms *MessageService) ListBlockedMessage(ctx context.Context, params *repo.MsgQueryParams, d time.Duration) ([]*types.Message, error)
- func (ms *MessageService) ListFailedMessage(ctx context.Context, params *repo.MsgQueryParams) ([]*types.Message, error)
- func (ms *MessageService) ListFilledMessageByAddress(ctx context.Context, addr address.Address) ([]*types.Message, error)
- func (ms *MessageService) ListMessage(ctx context.Context, params *repo.MsgQueryParams) ([]*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) error
- func (ms *MessageService) ProcessNewHead(ctx context.Context, apply []*venusTypes.TipSet) error
- func (ms *MessageService) PushMessage(ctx context.Context, msg *venusTypes.Message, meta *types.SendSpec) (string, error)
- func (ms *MessageService) PushMessageWithId(ctx context.Context, id string, msg *venusTypes.Message, meta *types.SendSpec) (string, error)
- func (ms *MessageService) ReconnectCheck(ctx context.Context, head *venusTypes.TipSet) error
- func (ms *MessageService) RecoverFailedMsg(ctx context.Context, addr address.Address) ([]string, error)
- func (ms *MessageService) ReplaceMessage(ctx context.Context, params *types.ReplacMessageParams) (cid.Cid, error)
- func (ms *MessageService) RepublishMessage(ctx context.Context, id string) error
- func (ms *MessageService) SaveActorCfg(ctx context.Context, actorCfg *types.ActorCfg) error
- func (ms *MessageService) Send(ctx context.Context, params types.QuickSendParams) (string, error)
- func (ms *MessageService) StartPushMessage(ctx context.Context, skipPushMsg bool)
- func (ms *MessageService) UpdateActorCfg(ctx context.Context, id venusTypes.UUID, ...) error
- func (ms *MessageService) UpdateAllFilledMessage(ctx context.Context) (int, error)
- func (ms *MessageService) UpdateFilledMessageByID(ctx context.Context, id string) (string, 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) error
- func (ms *MessageService) WaitMessage(ctx context.Context, id string, confidence uint64) (*types.Message, error)
- type MsgSelectMgr
- type MsgSelectResult
- type NodeEvents
- type NodeService
- func (ns *NodeService) DeleteNode(ctx context.Context, name string) 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) error
- type SharedParamsService
- type TipsetCache
Constants ¶
View Source
const ( MaxHeadChangeProcess = 5 LookBackLimit = 900 )
Variables ¶
View Source
types.FeeSpec{ BaseFee: big.NewInt(0), GasOverEstimation: 1.25, MaxFee: big.Int{Int: DefaultMaxFee.Int}, GasFeeCap: big.NewInt(0), GasOverPremium: 0, }, }ID: 1, SelMsgNum: 20, FeeSpec:
View Source
var DefaultMaxFee = venusTypes.MustParseFIL("0.07")
Functions ¶
func CapGasFee ¶
func CapGasFee(msg *venusTypes.Message, maxFee abi.TokenAmount)
func MessagerService ¶
func ToSignedMsg ¶
func ToSignedMsg(ctx context.Context, walletCli gatewayAPI.IWalletClient, msg *types.Message, accounts []string) (venusTypes.SignedMessage, error)
Types ¶
type AddressService ¶
type AddressService struct {
// contains filtered or unexported fields
}
func NewAddressService ¶
func NewAddressService(repo repo.Repo, walletClient gatewayAPI.IWalletClient, remoteAuthCli jwtclient.IAuthClient) *AddressService
func (*AddressService) ActiveAddress ¶
func (addressService *AddressService) ActiveAddress(ctx context.Context, addr address.Address) error
func (*AddressService) ActiveAddresses ¶
func (addressService *AddressService) ActiveAddresses(ctx context.Context) map[address.Address]struct{}
func (*AddressService) DeleteAddress ¶
func (addressService *AddressService) DeleteAddress(ctx context.Context, addr address.Address) error
func (*AddressService) ForbiddenAddress ¶
func (addressService *AddressService) ForbiddenAddress(ctx context.Context, addr address.Address) error
func (*AddressService) GetAccountsOfSigner ¶
func (addressService *AddressService) GetAccountsOfSigner(ctx context.Context, addr address.Address) ([]string, error)
func (*AddressService) GetAddress ¶
func (*AddressService) HasAddress ¶
func (addressService *AddressService) HasAddress(ctx context.Context, addr address.Address) (bool, error)
func (*AddressService) ListActiveAddress ¶
func (*AddressService) ListAddress ¶
func (*AddressService) SaveAddress ¶
func (addressService *AddressService) SaveAddress(ctx context.Context, address *types.Address) (venusTypes.UUID, error)
func (*AddressService) SetFeeParams ¶
func (addressService *AddressService) SetFeeParams(ctx context.Context, params *types.AddressSpec) error
func (*AddressService) SetSelectMsgNum ¶
func (addressService *AddressService) SetSelectMsgNum(ctx context.Context, addr address.Address, num uint64) error
func (*AddressService) UpdateNonce ¶
func (addressService *AddressService) UpdateNonce(ctx context.Context, addr address.Address, nonce uint64) error
func (*AddressService) WalletHas ¶
func (addressService *AddressService) WalletHas(ctx context.Context, addr address.Address) (bool, error)
WalletHas 1. 检查请求token绑定的 account是否在addr绑定的用户列表中,不在返回false; eg. from01的绑定关系: from01-acc01,from01-acc02, 判断: acc[token] IN (acc01,acc02) 2. 调用sophon-gateway的 `WalletHas(context.Context, []string, address.Address) (bool, error)` 查找在线的venus-wallet,调用 `.WalletHas(ctx, []string{acc01,acc02}, addr)` sophon-gateway: venus-wallet的私钥和所有支持账号都绑定,WalletHas从接口的绑定账号列表中查找是否存在在线的venus-wallet channel.
type IAddressService ¶
type IAddressService interface { SaveAddress(ctx context.Context, address *types.Address) (venusTypes.UUID, error) UpdateNonce(ctx context.Context, addr address.Address, nonce uint64) error GetAddress(ctx context.Context, addr address.Address) (*types.Address, error) // WalletHas 1. 检查请求token绑定的 account是否在addr绑定的用户列表中,不在返回false; eg. from01的绑定关系: from01-acc01,from01-acc02, 判断: acc[token] IN (acc01,acc02) // 2. 调用sophon-gateway的 `WalletHas(context.Context, []string, address.Address) (bool, error)` 查找在线的venus-wallet,调用 `.WalletHas(ctx, []string{acc01,acc02}, addr)` // sophon-gateway: venus-wallet的私钥和所有支持账号都绑定,WalletHas从接口的绑定账号列表中查找是否存在在线的venus-wallet channel. WalletHas(ctx context.Context, addr address.Address) (bool, error) HasAddress(ctx context.Context, addr address.Address) (bool, error) ListAddress(ctx context.Context) ([]*types.Address, error) ListActiveAddress(ctx context.Context) ([]*types.Address, error) DeleteAddress(ctx context.Context, addr address.Address) error ForbiddenAddress(ctx context.Context, addr address.Address) error ActiveAddress(ctx context.Context, addr address.Address) error SetSelectMsgNum(ctx context.Context, addr address.Address, num uint64) error SetFeeParams(ctx context.Context, params *types.AddressSpec) error ActiveAddresses(ctx context.Context) map[address.Address]struct{} GetAccountsOfSigner(ctx context.Context, addr address.Address) ([]string, error) }
type IMessageService ¶
type IMessageService interface { PushMessage(ctx context.Context, msg *venusTypes.Message, meta *types.SendSpec) (string, error) PushMessageWithId(ctx context.Context, id string, msg *venusTypes.Message, meta *types.SendSpec) (string, error) HasMessageByUid(ctx context.Context, id string) (bool, error) GetMessageByUid(ctx context.Context, id string) (*types.Message, error) GetMessageByCid(ctx context.Context, cid cid.Cid) (*types.Message, error) GetMessageByFromAndNonce(ctx context.Context, from address.Address, nonce uint64) (*types.Message, error) WaitMessage(ctx context.Context, id string, confidence uint64) (*types.Message, error) GetMessageBySignedCid(ctx context.Context, signedCid cid.Cid) (*types.Message, error) GetMessageByUnsignedCid(ctx context.Context, unsignedCid cid.Cid) (*types.Message, error) ListMessage(ctx context.Context, params *repo.MsgQueryParams) ([]*types.Message, error) ListMessageByFromState(ctx context.Context, from address.Address, state types.MessageState, isAsc bool, pageIndex, pageSize int, t time.Duration) ([]*types.Message, error) ListMessageByAddress(ctx context.Context, addr address.Address) ([]*types.Message, error) ListFailedMessage(ctx context.Context, params *repo.MsgQueryParams) ([]*types.Message, error) ListBlockedMessage(ctx context.Context, params *repo.MsgQueryParams, d time.Duration) ([]*types.Message, error) UpdateMessageStateByID(ctx context.Context, id string, state types.MessageState) error UpdateAllFilledMessage(ctx context.Context) (int, error) UpdateFilledMessageByID(ctx context.Context, id string) (string, error) ReplaceMessage(ctx context.Context, params *types.ReplacMessageParams) (cid.Cid, error) RepublishMessage(ctx context.Context, id string) error MarkBadMessage(ctx context.Context, id string) error RecoverFailedMsg(ctx context.Context, addr address.Address) ([]string, error) ClearUnFillMessage(ctx context.Context, addr address.Address) (int, error) Send(ctx context.Context, params types.QuickSendParams) (string, error) SaveActorCfg(ctx context.Context, actorCfg *types.ActorCfg) error UpdateActorCfg(ctx context.Context, id venusTypes.UUID, changeSpecParams *types.ChangeGasSpecParams) error ListActorCfg(ctx context.Context) ([]*types.ActorCfg, error) GetActorCfgByID(ctx context.Context, id venusTypes.UUID) (*types.ActorCfg, error) }
type INodeService ¶
type INodeService interface { SaveNode(ctx context.Context, node *types.Node) error GetNode(ctx context.Context, name string) (*types.Node, error) HasNode(ctx context.Context, name string) (bool, error) ListNode(ctx context.Context) ([]*types.Node, error) DeleteNode(ctx context.Context, name string) error }
func NewINodeService ¶
func NewINodeService(s *NodeService) INodeService
type MessageService ¶
type MessageService struct {
// contains filtered or unexported fields
}
func NewMessageService ¶
func NewMessageService(ctx context.Context, repo repo.Repo, nc v1.FullNode, fsRepo filestore.FSRepo, addressService *AddressService, sps *SharedParamsService, walletClient gatewayAPI.IWalletClient, msgReceiver publisher.MessageReceiver, ) (*MessageService, error)
func (*MessageService) ClearUnFillMessage ¶
func (ms *MessageService) ClearUnFillMessage(ctx context.Context, addr address.Address) (int, error)
func (*MessageService) GetActorCfgByID ¶
func (ms *MessageService) GetActorCfgByID(ctx context.Context, id venusTypes.UUID) (*types.ActorCfg, 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) ListActorCfg ¶
func (*MessageService) ListBlockedMessage ¶
func (ms *MessageService) ListBlockedMessage(ctx context.Context, params *repo.MsgQueryParams, d time.Duration) ([]*types.Message, error)
func (*MessageService) ListFailedMessage ¶
func (ms *MessageService) ListFailedMessage(ctx context.Context, params *repo.MsgQueryParams) ([]*types.Message, error)
func (*MessageService) ListFilledMessageByAddress ¶
func (*MessageService) ListMessage ¶
func (ms *MessageService) ListMessage(ctx context.Context, params *repo.MsgQueryParams) ([]*types.Message, error)
func (*MessageService) ListMessageByAddress ¶
func (*MessageService) ListMessageByFromState ¶
func (*MessageService) MarkBadMessage ¶
func (ms *MessageService) MarkBadMessage(ctx context.Context, id string) error
func (*MessageService) ProcessNewHead ¶
func (ms *MessageService) ProcessNewHead(ctx context.Context, apply []*venusTypes.TipSet) error
func (*MessageService) PushMessage ¶
func (ms *MessageService) PushMessage(ctx context.Context, msg *venusTypes.Message, meta *types.SendSpec) (string, error)
func (*MessageService) PushMessageWithId ¶
func (ms *MessageService) PushMessageWithId(ctx context.Context, id string, msg *venusTypes.Message, meta *types.SendSpec) (string, error)
func (*MessageService) ReconnectCheck ¶
func (ms *MessageService) ReconnectCheck(ctx context.Context, head *venusTypes.TipSet) error
func (*MessageService) RecoverFailedMsg ¶
func (ms *MessageService) RecoverFailedMsg(ctx context.Context, addr address.Address) ([]string, error)
func (*MessageService) ReplaceMessage ¶
func (ms *MessageService) ReplaceMessage(ctx context.Context, params *types.ReplacMessageParams) (cid.Cid, error)
func (*MessageService) RepublishMessage ¶
func (ms *MessageService) RepublishMessage(ctx context.Context, id string) error
func (*MessageService) SaveActorCfg ¶
func (*MessageService) Send ¶
func (ms *MessageService) Send(ctx context.Context, params types.QuickSendParams) (string, error)
func (*MessageService) StartPushMessage ¶
func (ms *MessageService) StartPushMessage(ctx context.Context, skipPushMsg bool)
func (*MessageService) UpdateActorCfg ¶
func (ms *MessageService) UpdateActorCfg(ctx context.Context, id venusTypes.UUID, changeSpecParams *types.ChangeGasSpecParams) error
func (*MessageService) UpdateAllFilledMessage ¶
func (ms *MessageService) UpdateAllFilledMessage(ctx context.Context) (int, error)
func (*MessageService) UpdateFilledMessageByID ¶
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) error
func (*MessageService) WaitMessage ¶
type MsgSelectMgr ¶
type MsgSelectMgr struct {
// contains filtered or unexported fields
}
func (*MsgSelectMgr) SelectMessage ¶
func (msgSelectMgr *MsgSelectMgr) SelectMessage(ctx context.Context, ts *venusTypes.TipSet) error
SelectMessage not concurrency safe
type MsgSelectResult ¶
type MsgSelectResult struct { Address *types.Address SelectMsg []*types.Message ToPushMsg []*venusTypes.SignedMessage ErrMsg []msgErrInfo }
type NodeEvents ¶
type NodeEvents struct {
// contains filtered or unexported fields
}
func StartNodeEvents ¶
func StartNodeEvents(lc fx.Lifecycle, client v1.FullNode, msgService *MessageService) *NodeEvents
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
func NewNodeService ¶
func NewNodeService(repo repo.NodeRepo) *NodeService
func (*NodeService) DeleteNode ¶
func (ns *NodeService) DeleteNode(ctx context.Context, name string) error
type SharedParamsService ¶
type SharedParamsService struct {
// contains filtered or unexported fields
}
func NewSharedParamsService ¶
func (*SharedParamsService) GetSharedParams ¶
func (sps *SharedParamsService) GetSharedParams(ctx context.Context) (*types.SharedSpec, error)
func (*SharedParamsService) SetSharedParams ¶
func (sps *SharedParamsService) SetSharedParams(ctx context.Context, params *types.SharedSpec) error
type TipsetCache ¶
type TipsetCache struct { Cache map[int64]*venusTypes.TipSet CurrHeight int64 NetworkName string // contains filtered or unexported fields }
func (*TipsetCache) Add ¶
func (tsCache *TipsetCache) Add(list ...*venusTypes.TipSet)
func (*TipsetCache) List ¶
func (tsCache *TipsetCache) List() []*venusTypes.TipSet
func (*TipsetCache) Load ¶
func (tsCache *TipsetCache) Load(path string) error
func (*TipsetCache) Save ¶
func (tsCache *TipsetCache) Save(filePath string) error
Save original data will be cleared
Click to show internal directories.
Click to hide internal directories.