Documentation
¶
Index ¶
- Variables
- func InitPubDB(pdb *stormdb.PubRewardDB)
- type API
- func (r *API) Address() common.Address
- func (r *API) AllowRevealSecret(lockSecretHash common.Hash, tokenAddress common.Address) (err error)
- func (r *API) BalanceProofForPFS(channelIdentifier common.Hash) (proof *ProofForPFS, err error)
- func (r *API) CancelPrepareForCooperativeSettle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
- func (r *API) CancelPrepareForWithdraw(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
- func (r *API) CancelTransfer(lockSecretHash common.Hash, tokenAddress common.Address) error
- func (r *API) ChannelInformationFor3rdParty(ChannelIdentifier common.Hash, thirdAddr common.Address) (result *ChannelFor3rd, err error)
- func (r *API) Close(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
- func (r *API) ContractCallTXQuery(req *ContractCallTXQueryParams) (list []*models.TXInfo, err error)
- func (r *API) CooperativeSettle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
- func (r *API) DepositAndOpenChannel(tokenAddress, partnerAddress common.Address, settleTimeout, revealTimeout int, ...) (ch *channeltype.Serialization, err error)
- func (r *API) ExpectTokenSwap(lockSecretHash string, ...) (err error)
- func (r *API) FindPath(targetAddress, tokenAddress common.Address, amount *big.Int) (routes []pfsproxy.FindPathResponse, err error)
- func (r *API) ForceUnlock(channelIdentifier, secret common.Hash) (err error)
- func (r *API) GetAllFeeChargeRecord() (resp interface{}, err error)
- func (r *API) GetBalanceByTokenAddress(tokenAddress common.Address) (balances []*AccountTokenBalanceVo, err error)
- func (r *API) GetBuildInfo() *BuildInfo
- func (r *API) GetChannel(ChannelIdentifier common.Hash) (c *channeltype.Serialization, err error)
- func (r *API) GetChannelEvents(channelIdentifier common.Hash, fromBlock, toBlock int64) (data []transfer.Event, err error)
- func (r *API) GetChannelList(tokenAddress common.Address, partnerAddress common.Address) (cs []*channeltype.Serialization, err error)
- func (r *API) GetDaysIncome(tokenAddress common.Address, n int) (resp []*DaysIncome, err error)
- func (r *API) GetFeePolicy() (fp *models.FeePolicy, err error)
- func (r *API) GetIncomeDetails(tokenAddress common.Address, fromTime, toTime int64, limit int) (list []*IncomeDetail, err error)
- func (r *API) GetNetworkEvents(fromBlock, toBlock int64) ([]interface{}, error)
- func (r *API) GetNodeNetworkState(nodeAddress common.Address) (deviceType string, isOnline bool)
- func (r *API) GetReceivedTransfers(tokenAddress common.Address, fromBlock, toBlock, fromTime, toTime int64) ([]*models.ReceivedTransfer, error)
- func (r *API) GetSentTransferDetails(tokenAddress common.Address, from, to int64) ([]*models.SentTransferDetail, error)
- func (r *API) GetTokenList() (tokens []common.Address)
- func (r *API) GetTokenNetworkEvents(tokenAddress common.Address, fromBlock, toBlock int64) (data []interface{}, err error)
- func (r *API) GetTokenTokenNetorks() (tokens []string)
- func (r *API) GetUnfinishedReceivedTransfer(lockSecretHash common.Hash, tokenAddress common.Address) (resp *TransferDataResponse)
- func (r *API) NotifyNetworkDown() error
- func (r *API) PrepareForCooperativeSettle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
- func (r *API) PrepareForWithdraw(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
- func (r *API) RegisterSecret(secret common.Hash, tokenAddress common.Address) (err error)
- func (r *API) RegisterSecretOnChain(secret common.Hash) (err error)
- func (r *API) SetFeePolicy(fp *models.FeePolicy) error
- func (r *API) Settle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
- func (r *API) StartHealthCheckFor(nodeAddress common.Address) (deviceType string, isOnline bool)
- func (r *API) Stop()
- func (r *API) SystemStatus() (resp interface{}, err error)
- func (r *API) TokenSwapAndWait(lockSecretHash string, ...) error
- func (r *API) Tokens() (addresses []common.Address)
- func (r *API) Transfer(token common.Address, amount *big.Int, target common.Address, ...) (result *utils.AsyncResult, err error)
- func (r *API) TransferAsync(tokenAddress common.Address, amount *big.Int, target common.Address, ...) (result *utils.AsyncResult, err error)
- func (r *API) TransferInternal(tokenAddress common.Address, amount *big.Int, target common.Address, ...) (result *utils.AsyncResult, err error)
- func (r *API) Withdraw(tokenAddress, partnerAddress common.Address, amount *big.Int) (c *channeltype.Serialization, err error)
- type AccountTokenBalanceVo
- type AckHelper
- type BuildInfo
- type ChannelFor3rd
- type ContractCallTXQueryParams
- type DaysIncome
- type EventEventTransferReceivedSuccessWrapper
- type EventTransferSentFailedWrapper
- type EventTransferSentSuccessWrapper
- type FeeModule
- type IncomeDetail
- type NoFeePolicy
- type OneDayIncome
- type ProofForPFS
- type ReceivedMediatedTrasnferListener
- type RevealSecretListener
- type SecretRequestPredictor
- type SentMediatedTransferListener
- type Service
- func (rs *Service) GetBlockNumber() int64
- func (rs *Service) GetChannelStatus(channelIdentifier common.Hash) (int, int64)
- func (rs *Service) GetDao() models.Dao
- func (rs *Service) GetNodeChargeFee(nodeAddress, tokenAddress common.Address, amount *big.Int) *big.Int
- func (rs *Service) SendAndWait(recipient common.Address, message encoding.SignedMessager, ...) error
- func (rs *Service) SetBuildInfo(goVersion, gitCommit, buildDate, version string)
- func (rs *Service) Start() (err error)
- func (rs *Service) Stop()
- func (rs *Service) UpdateChannel(c *channeltype.Serialization, tx models.TX) error
- func (rs *Service) UpdateChannelAndSaveAck(c *channel.Channel, tag interface{})
- func (rs *Service) UpdateChannelContractBalance(c *channeltype.Serialization) error
- func (rs *Service) UpdateChannelNoTx(c *channeltype.Serialization) error
- func (rs *Service) UpdateChannelState(c *channeltype.Serialization) error
- type TokenSwap
- type TransferDataResponse
Constants ¶
This section is empty.
Variables ¶
var RewardDB *stormdb.PubRewardDB
RewardDB reward path: supernode--metalife PUB--ssb client
Functions ¶
func InitPubDB ¶
func InitPubDB(pdb *stormdb.PubRewardDB)
Types ¶
type API ¶
type API struct {
Photon *Service
}
API photon for user
#nolint
func (*API) AllowRevealSecret ¶
func (r *API) AllowRevealSecret(lockSecretHash common.Hash, tokenAddress common.Address) (err error)
AllowRevealSecret : 1. find state manager by lockSecretHash and tokenAddress 2. check secret matches lockSecretHash or not 3. remove the predictor
func (*API) BalanceProofForPFS ¶
func (r *API) BalanceProofForPFS(channelIdentifier common.Hash) (proof *ProofForPFS, err error)
BalanceProofForPFS proof for path finding service ,test only
func (*API) CancelPrepareForCooperativeSettle ¶
func (r *API) CancelPrepareForCooperativeSettle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
CancelPrepareForCooperativeSettle cancel a mark. return when state has been updated to database
func (*API) CancelPrepareForWithdraw ¶
func (r *API) CancelPrepareForWithdraw(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
CancelPrepareForWithdraw cancel a mark. return when state has been updated to database
func (*API) CancelTransfer ¶
CancelTransfer : cancel a transfer when haven't send secret
func (*API) ChannelInformationFor3rdParty ¶
func (r *API) ChannelInformationFor3rdParty(ChannelIdentifier common.Hash, thirdAddr common.Address) (result *ChannelFor3rd, err error)
ChannelInformationFor3rdParty generate all information need by 3rd party
func (*API) Close ¶
func (r *API) Close(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
Close a channel opened with `partner_address` for the given `token_address`. return when state has been +d to database
func (*API) ContractCallTXQuery ¶
func (r *API) ContractCallTXQuery(req *ContractCallTXQueryParams) (list []*models.TXInfo, err error)
ContractCallTXQuery 根据条件查询所有合约调用的信息
func (*API) CooperativeSettle ¶
func (r *API) CooperativeSettle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
CooperativeSettle a channel opened with `partner_address` for the given `token_address`. return when state has been updated to database
func (*API) DepositAndOpenChannel ¶
func (r *API) DepositAndOpenChannel(tokenAddress, partnerAddress common.Address, settleTimeout, revealTimeout int, deposit *big.Int, newChannel bool) (ch *channeltype.Serialization, err error)
DepositAndOpenChannel a channel with the peer at `partner_address`
with the given `token_address`.
deposit必须大于0 settleTimeout: 如果为0 表示已经知道通道存在,只是为了存款,如果大于0,表示希望完全创建通道. 此接口并不等待交易打包才返回,因此如果是新创建通道,就算是成功了ch也会是nil 如果是单纯deposit,那么err为nil时,ch一定有效
func (*API) ExpectTokenSwap ¶
func (r *API) ExpectTokenSwap(lockSecretHash string, makerToken, takerToken, makerAddress, takerAddress common.Address, makerAmount, takerAmount *big.Int, routeInfo []pfsproxy.FindPathResponse) (err error)
ExpectTokenSwap Register an expected transfer for this node.
If a MediatedMessage is received for the `maker_asset` with `maker_amount` then proceed to send a MediatedTransfer to `maker_address` for `taker_asset` with `taker_amount`.
func (*API) FindPath ¶
func (r *API) FindPath(targetAddress, tokenAddress common.Address, amount *big.Int) (routes []pfsproxy.FindPathResponse, err error)
FindPath 向PFS询问路由,要求启用收费
func (*API) ForceUnlock ¶
ForceUnlock : only for debug
func (*API) GetAllFeeChargeRecord ¶
GetAllFeeChargeRecord :
func (*API) GetBalanceByTokenAddress ¶
func (r *API) GetBalanceByTokenAddress(tokenAddress common.Address) (balances []*AccountTokenBalanceVo, err error)
GetBalanceByTokenAddress : get account's balance and locked account on token
func (*API) GetChannel ¶
func (r *API) GetChannel(ChannelIdentifier common.Hash) (c *channeltype.Serialization, err error)
GetChannel get channel by address
func (*API) GetChannelEvents ¶
func (r *API) GetChannelEvents(channelIdentifier common.Hash, fromBlock, toBlock int64) (data []transfer.Event, err error)
GetChannelEvents events of this channel
func (*API) GetChannelList ¶
func (r *API) GetChannelList(tokenAddress common.Address, partnerAddress common.Address) (cs []*channeltype.Serialization, err error)
GetChannelList Returns a list of channels associated with the optionally given
`token_address` and/or `partner_address
Args:
token_address (bin): an optionally provided token address partner_address (bin): an optionally provided partner address Return: A list containing all channels the node participates. Optionally filtered by a token address and/or partner address. Raises: KeyError: An error occurred when the token address is unknown to the node.
func (*API) GetDaysIncome ¶
GetDaysIncome 获取过去n天的收益统计
func (*API) GetFeePolicy ¶
GetFeePolicy 如果没有启动收费会返回错误,否则返回当前账户设置的收费信息
func (*API) GetIncomeDetails ¶
func (r *API) GetIncomeDetails(tokenAddress common.Address, fromTime, toTime int64, limit int) (list []*IncomeDetail, err error)
GetIncomeDetails 收益明细查询接口,这里的收益包含手续费收益和收到的data不为""的交易
func (*API) GetNetworkEvents ¶
GetNetworkEvents all photon events
func (*API) GetNodeNetworkState ¶
GetNodeNetworkState Returns the currently network status of `node_address
func (*API) GetReceivedTransfers ¶
func (r *API) GetReceivedTransfers(tokenAddress common.Address, fromBlock, toBlock, fromTime, toTime int64) ([]*models.ReceivedTransfer, error)
GetReceivedTransfers query received transfers from dao
func (*API) GetSentTransferDetails ¶
func (r *API) GetSentTransferDetails(tokenAddress common.Address, from, to int64) ([]*models.SentTransferDetail, error)
GetSentTransferDetails query sent transfers from dao
func (*API) GetTokenList ¶
GetTokenList returns all available tokens
func (*API) GetTokenNetworkEvents ¶
func (r *API) GetTokenNetworkEvents(tokenAddress common.Address, fromBlock, toBlock int64) (data []interface{}, err error)
GetTokenNetworkEvents return events about this token
func (*API) GetTokenTokenNetorks ¶
GetTokenTokenNetorks return all tokens and token networks
func (*API) GetUnfinishedReceivedTransfer ¶
func (r *API) GetUnfinishedReceivedTransfer(lockSecretHash common.Hash, tokenAddress common.Address) (resp *TransferDataResponse)
GetUnfinishedReceivedTransfer :
func (*API) PrepareForCooperativeSettle ¶
func (r *API) PrepareForCooperativeSettle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
PrepareForCooperativeSettle mark a channel prepared for settle, return when state has been updated to database
func (*API) PrepareForWithdraw ¶
func (r *API) PrepareForWithdraw(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
PrepareForWithdraw mark a channel prepared for withdraw, return when state has been updated to database
func (*API) RegisterSecret ¶
RegisterSecret :
func (*API) RegisterSecretOnChain ¶
RegisterSecretOnChain : only for debug
func (*API) SetFeePolicy ¶
SetFeePolicy 更新该账户所有的收费信息,不保留历史记录
func (*API) Settle ¶
func (r *API) Settle(tokenAddress, partnerAddress common.Address) (c *channeltype.Serialization, err error)
Settle a closed channel with `partner_address` for the given `token_address`.return when state has been updated to database
func (*API) StartHealthCheckFor ¶
StartHealthCheckFor Returns the currently network status of `node_address`.
func (*API) SystemStatus ¶
SystemStatus :
func (*API) TokenSwapAndWait ¶
func (r *API) TokenSwapAndWait(lockSecretHash string, makerToken, takerToken, makerAddress, takerAddress common.Address, makerAmount, takerAmount *big.Int, secret string, routeInfo []pfsproxy.FindPathResponse) error
TokenSwapAndWait Start an atomic swap operation by sending a MediatedTransfer with
`maker_amount` of `maker_token` to `taker_address`. Only proceed when a new valid MediatedTransfer is received with `taker_amount` of `taker_token`.
func (*API) Transfer ¶
func (r *API) Transfer(token common.Address, amount *big.Int, target common.Address, secret common.Hash, timeout time.Duration, isDirectTransfer bool, data string, routeInfo []pfsproxy.FindPathResponse) (result *utils.AsyncResult, err error)
Transfer transfer and wait
func (*API) TransferAsync ¶
func (r *API) TransferAsync(tokenAddress common.Address, amount *big.Int, target common.Address, secret common.Hash, isDirectTransfer bool, data string, routeInfo []pfsproxy.FindPathResponse) (result *utils.AsyncResult, err error)
TransferAsync :
func (*API) TransferInternal ¶
func (r *API) TransferInternal(tokenAddress common.Address, amount *big.Int, target common.Address, secret common.Hash, isDirectTransfer bool, data string, routeInfo []pfsproxy.FindPathResponse) (result *utils.AsyncResult, err error)
TransferInternal :
func (*API) Withdraw ¶
func (r *API) Withdraw(tokenAddress, partnerAddress common.Address, amount *big.Int) (c *channeltype.Serialization, err error)
Withdraw on a channel opened with `partner_address` for the given `token_address`. return when state has been updated to database
type AccountTokenBalanceVo ¶
type AccountTokenBalanceVo struct { TokenAddress string `json:"token_address"` Balance *big.Int `json:"balance"` LockedAmount *big.Int `json:"locked_amount"` }
AccountTokenBalanceVo for api
type AckHelper ¶
type AckHelper struct {
// contains filtered or unexported fields
}
AckHelper save ack for sent and recevied message
type BuildInfo ¶
type BuildInfo struct { GoVersion string `json:"go_version"` GitCommit string `json:"git_commit"` BuildDate string `json:"build_date"` Version string `json:"version"` }
BuildInfo 保存构建信息
type ChannelFor3rd ¶
type ChannelFor3rd struct { ChannelIdentifier common.Hash `json:"channel_identifier"` OpenBlockNumber int64 `json:"open_block_number"` TokenAddrss common.Address `json:"token_address"` PartnerAddress common.Address `json:"partner_address"` UpdateTransfer updateTransfer `json:"update_transfer"` Unlocks []*unlock `json:"unlocks"` Punishes []*punish `json:"punishes"` }
ChannelFor3rd is for 3rd party to call update transfer
type ContractCallTXQueryParams ¶
type ContractCallTXQueryParams struct { ChannelIdentifier string `json:"channel_identifier"` OpenBlockNumber int64 `json:"open_block_number"` TokenAddress string `json:"token_address"` TXType models.TXInfoType `json:"tx_type"` TXStatus models.TXInfoStatus `json:"tx_status"` }
ContractCallTXQueryParams 请求参数
type DaysIncome ¶
type DaysIncome struct { TokenAddress common.Address `json:"token_address"` TotalAmount *big.Int `json:"total_amount"` Days int `json:"days"` Details []*OneDayIncome `json:"details"` }
DaysIncome 一周的收益统计
type EventEventTransferReceivedSuccessWrapper ¶
type EventEventTransferReceivedSuccessWrapper struct { transfer.EventTransferReceivedSuccess BlockNumber int64 Name string }
EventEventTransferReceivedSuccessWrapper wrapper
type EventTransferSentFailedWrapper ¶
type EventTransferSentFailedWrapper struct { transfer.EventTransferSentFailed BlockNumber int64 Name string }
EventTransferSentFailedWrapper wrapper
type EventTransferSentSuccessWrapper ¶
type EventTransferSentSuccessWrapper struct { transfer.EventTransferSentSuccess BlockNumber int64 Name string }
EventTransferSentSuccessWrapper wrapper
type FeeModule ¶
type FeeModule struct {
// contains filtered or unexported fields
}
FeeModule :
func NewFeeModule ¶
NewFeeModule :
func (*FeeModule) GetNodeChargeFee ¶
func (fm *FeeModule) GetNodeChargeFee(nodeAddress, tokenAddress common.Address, amount *big.Int) *big.Int
GetNodeChargeFee : impl of FeeCharge
func (*FeeModule) SetFeePolicy ¶
SetFeePolicy :
func (*FeeModule) SubmitFeePolicyToPFS ¶
SubmitFeePolicyToPFS :
type IncomeDetail ¶
type IncomeDetail struct { Amount *big.Int `json:"amount"` Data string `json:"data"` Type string `json:"type"` // 0=转账收益 1-手续费收益 TimeStamp int64 `json:"time_stamp"` }
IncomeDetail 收益接口返回的收益明细信息
type NoFeePolicy ¶
type NoFeePolicy struct { }
NoFeePolicy charge no fee
func (*NoFeePolicy) GetNodeChargeFee ¶
func (n *NoFeePolicy) GetNodeChargeFee(nodeAddress, tokenAddress common.Address, amount *big.Int) *big.Int
GetNodeChargeFee always return 0
type OneDayIncome ¶
OneDayIncome 一天的收益统计
type ProofForPFS ¶
type ProofForPFS struct { BalanceProof balanceProof `json:"balance_proof"` Signature []byte `json:"balance_signature"` LockAmount *big.Int `json:"lock_amount"` }
ProofForPFS proof for path finding service, test only
type ReceivedMediatedTrasnferListener ¶
type ReceivedMediatedTrasnferListener func(msg *encoding.MediatedTransfer) (remove bool)
ReceivedMediatedTrasnferListener return true this listener should not be called next time
type RevealSecretListener ¶
type RevealSecretListener func(msg *encoding.RevealSecret) (remove bool)
RevealSecretListener return true this listener should not be called next time
type SecretRequestPredictor ¶
type SecretRequestPredictor func(msg *encoding.SecretRequest) (ignore bool)
SecretRequestPredictor return true to ignore this message,otherwise continue to process
type SentMediatedTransferListener ¶
type SentMediatedTransferListener func(msg *encoding.MediatedTransfer) (remove bool)
SentMediatedTransferListener return true this listener should not be called next time
type Service ¶
type Service struct { /* module */ Config *params.Config Chain *rpc.BlockChainService Transport network.Transporter Protocol *network.PhotonProtocol MessageHandler *photonMessageHandler StateMachineEventHandler *stateMachineEventHandler BlockChainEvents *blockchain.Events FeePolicy fee.Charger //Mediation fee NotifyHandler *notify.Handler PfsProxy pfsproxy.PfsProxy /* */ PrivateKey *ecdsa.PrivateKey NodeAddress common.Address Token2ChannelGraph map[common.Address]*graph.ChannelGraph Token2TokenNetwork map[common.Address]common.Address Transfer2StateManager map[common.Hash]*transfer.StateManager Transfer2Result map[common.Hash]*utils.AsyncResult SwapKey2TokenSwap map[swapKey]*TokenSwap /* This is a map from a hashlock to a list of channels, the same hashlock can be used in more than one token (for tokenswaps), a channel should be removed from this list only when the Lock is released/withdrawn but not when the secret is registered. */ Token2LockSecretHash2Channels map[common.Address]map[common.Hash][]*channel.Channel FileLocker *flock.Flock BlockNumber *atomic.Value /* chan for user request */ UserReqChan chan *apiReq ProtocolMessageSendComplete chan *protocolMessage /* these four maps designed for token swap,but it can be extended for purpose usage. for example: cross chain. */ SecretRequestPredictorMap map[common.Hash]SecretRequestPredictor //for tokenswap RevealSecretListenerMap map[common.Hash]RevealSecretListener //for tokenswap /* important!: we must valid the mediated transfer is valid or not first, then to test if this mediated transfer matchs any token swap. */ ReceivedMediatedTrasnferListenerMap map[*ReceivedMediatedTrasnferListener]bool //for tokenswap SentMediatedTransferListenerMap map[*SentMediatedTransferListener]bool //for tokenswap HealthCheckMap map[common.Address]bool StopCreateNewTransfers bool // 是否停止接收新交易,默认false,目前仅在用户调用prepare-update接口的时候,会被置为true,直到重启 // boolean to check whether stop receiving new transfers, default to false. Currently it sets to true when clients invoke prepare-update, till it reconnects. EthConnectionStatus chan netshare.Status ChanHistoryContractEventsDealComplete chan struct{} BuildInfo *BuildInfo ChanSubmitBalanceProofToPFS chan *channel.Channel // 供submitBalanceProofToPfsLoop线程使用 // contains filtered or unexported fields }
Service is a photon node most of Service's member is not thread safe, and should not visit outside the loop method.
func NewPhotonService ¶
func NewPhotonService(chain *rpc.BlockChainService, privateKey *ecdsa.PrivateKey, transport network.Transporter, config *params.Config, notifyHandler *notify.Handler, dao models.Dao, pubdb *stormdb.PubRewardDB) (rs *Service, err error)
NewPhotonService create photon service
func (*Service) GetBlockNumber ¶
GetBlockNumber return latest blocknumber of ethereum
func (*Service) GetChannelStatus ¶
GetChannelStatus return status of channel
func (*Service) GetNodeChargeFee ¶
func (rs *Service) GetNodeChargeFee(nodeAddress, tokenAddress common.Address, amount *big.Int) *big.Int
GetNodeChargeFee implement of FeeCharger
func (*Service) SendAndWait ¶
func (rs *Service) SendAndWait(recipient common.Address, message encoding.SignedMessager, timeout time.Duration) error
SendAndWait Send `message` to `recipient` and wait for the response or `timeout`.
Args: recipient (address): The address of the node that will receive the message. message: The transfer message. timeout (float): How long should we wait for a response from `recipient`. Returns: None: If the wait timed out object: The result from the event
func (*Service) SetBuildInfo ¶
SetBuildInfo 启动时保存构建信息
func (*Service) UpdateChannel ¶
func (rs *Service) UpdateChannel(c *channeltype.Serialization, tx models.TX) error
UpdateChannel 数据库中更新通道状态,同时通知App
func (*Service) UpdateChannelAndSaveAck ¶
UpdateChannelAndSaveAck 保证通道更新和消息确认是一个原子操作
func (*Service) UpdateChannelContractBalance ¶
func (rs *Service) UpdateChannelContractBalance(c *channeltype.Serialization) error
UpdateChannelContractBalance 数据库更新,同时通知app
func (*Service) UpdateChannelNoTx ¶
func (rs *Service) UpdateChannelNoTx(c *channeltype.Serialization) error
UpdateChannelNoTx 数据库更新,同时通知App,与updateChannelState的区别就在于回调函数的
func (*Service) UpdateChannelState ¶
func (rs *Service) UpdateChannelState(c *channeltype.Serialization) error
UpdateChannelState 数据库更新,同时通知app
type TokenSwap ¶
type TokenSwap struct { LockSecretHash common.Hash Secret common.Hash // maker will use FromToken common.Address FromAmount *big.Int FromNodeAddress common.Address //the node address of the owner of the `from_token` ToToken common.Address ToAmount *big.Int ToNodeAddress common.Address //the node address of the owner of the `to_token` RouteInfo []pfsproxy.FindPathResponse }
TokenSwap for tokenswap api
type TransferDataResponse ¶
type TransferDataResponse struct { Initiator string `json:"initiator_address"` Target string `json:"target_address"` Token string `json:"token_address"` Amount *big.Int `json:"amount"` Secret string `json:"secret"` LockSecretHash string `json:"lock_secret_hash"` Expiration int64 `json:"expiration"` Fee *big.Int `json:"fee"` IsDirect bool `json:"is_direct"` }
TransferDataResponse :
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
debug
Package debug interfaces Go runtime debugging facilities.
|
Package debug interfaces Go runtime debugging facilities. |
Package log provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
|
Package log provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable. |