Documentation ¶
Overview ¶
Package worker includes all the tasks and jobs to process bridge swaps.
It contains the following main steps (concurrently):
verify verify registered swaps. swap build swaptx, mpc sign the tx, and send the tx to blockchain. accept the `oracle` node do the accept job, agree or disagree the signing after verifying by oralce itself. stable mark swap status to `stabe` status. replace replace swap with the same tx nonce value when the sent swaptx is not packed into block because of lack fee or other reasons. passbigvalue pass big value swap if the swap value is too large.
Most the above jobs is assigned to the `server` node, the `oracle` node mainly do the `accept` job.
Index ¶
- func AddAcceptRecord(args *tokens.BuildTxArgs, swapTx string) (err error)
- func AddSwapJob(pairCfg *tokens.TokenPairConfig)
- func AddTokenPairDynamically()
- func CheckAcceptRecord(args *tokens.BuildTxArgs) (err error)
- func DeleteCachedSwap(isSwapin bool, txid, bind string)
- func FindAcceptRecords(args *tokens.BuildTxArgs) map[string]int64
- func ReplaceSwapin(txid, pairID, bind, gasPrice string) (string, error)
- func ReplaceSwapout(txid, pairID, bind, gasPrice string) (string, error)
- func StartAcceptSignJob()
- func StartAggregateJob()
- func StartPassBigValueJob()
- func StartReplaceJob()
- func StartScanJob(isServer bool)
- func StartStableJob()
- func StartSwapJob()
- func StartUpdateLatestBlockHeightJob()
- func StartVerifyJob()
- func StartWork(isServer bool)
- type MatchTx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAcceptRecord ¶
func AddAcceptRecord(args *tokens.BuildTxArgs, swapTx string) (err error)
AddAcceptRecord add accept record
func AddTokenPairDynamically ¶
func AddTokenPairDynamically()
AddTokenPairDynamically add token pair dynamically
func CheckAcceptRecord ¶
func CheckAcceptRecord(args *tokens.BuildTxArgs) (err error)
CheckAcceptRecord check accept record
func DeleteCachedSwap ¶
DeleteCachedSwap delete cached swap
func FindAcceptRecords ¶
func FindAcceptRecords(args *tokens.BuildTxArgs) map[string]int64
FindAcceptRecords find accept records
func ReplaceSwapin ¶
ReplaceSwapin api
func ReplaceSwapout ¶
ReplaceSwapout api
func StartUpdateLatestBlockHeightJob ¶
func StartUpdateLatestBlockHeightJob()
StartUpdateLatestBlockHeightJob update latest block height job
Types ¶
Click to show internal directories.
Click to hide internal directories.