Documentation ¶
Index ¶
- Constants
- Variables
- func BackUpStateStore(dataDir string, suffix string) error
- func GetBttcByKey(privKey string) (defaultAddr string, _err error)
- func GetBttcNonDaemon(env cmds.Environment) (defaultAddr string, _err error)
- func GetChainIdFromDisk(stateStorer storage.StateStorer) (int64, error)
- func GetOnlineServer(chainId int64) string
- func GetStateStorePath(dataDir string) string
- func GetTxHash(stateStore storage.StateStorer) ([]byte, error)
- func GetTxNextBlock(ctx context.Context, backend transaction.Backend, monitor transaction.Monitor, ...) ([]byte, error)
- func GetVaultNonDaemon(env cmds.Environment) (defaultAddr string, err error)
- func GetWalletImportPrvKey(env cmds.Environment) (string, error)
- func InitStateStore(dataDir string) (ret storage.StateStorer, err error)
- func StoreChainIdIfNotExists(chainID int64, statestore storage.StateStorer) error
- func StoreChainIdToDisk(ChainId int64, stateStorer storage.StateStorer) error
- func StoreOnline(lastOnlineInfo *LastOnlineInfo) error
- type ChainInfo
- type LastOnlineInfo
- type LastOnlineInfoRet
- type LevelDbReportStatusInfo
- type ReportOnlineLastTimeDaily
- type ReportStatusInfo
- type SettleInfo
Constants ¶
View Source
const ( MaxDelay = 1 * time.Minute CancellationDepth = 6 )
View Source
const ( ConstCodeInit = 1 ConstCodeSuccess = 2 ConstCodeError = 3 )
code
Variables ¶
View Source
var ( ChainObject ChainInfo SettleObject SettleInfo StateStore storage.StateStorer )
View Source
var ( CodeBttc = ConstCodeInit ErrBttc error CodeStatus = ConstCodeInit ErrStatus error )
View Source
var DefaultStoreChainId = int64(-1)
Functions ¶
func BackUpStateStore ¶
func GetBttcByKey ¶
func GetBttcNonDaemon ¶
func GetBttcNonDaemon(env cmds.Environment) (defaultAddr string, _err error)
after btfs init
func GetChainIdFromDisk ¶
func GetChainIdFromDisk(stateStorer storage.StateStorer) (int64, error)
get chain id from leveldb
func GetOnlineServer ¶
func GetStateStorePath ¶
func GetTxNextBlock ¶
func GetVaultNonDaemon ¶
func GetVaultNonDaemon(env cmds.Environment) (defaultAddr string, err error)
after btfs init
func GetWalletImportPrvKey ¶
func GetWalletImportPrvKey(env cmds.Environment) (string, error)
after btfs init
func InitStateStore ¶
func InitStateStore(dataDir string) (ret storage.StateStorer, err error)
func StoreChainIdIfNotExists ¶
func StoreChainIdIfNotExists(chainID int64, statestore storage.StateStorer) error
func StoreChainIdToDisk ¶
func StoreChainIdToDisk(ChainId int64, stateStorer storage.StateStorer) error
add chain id into leveldb
func StoreOnline ¶
func StoreOnline(lastOnlineInfo *LastOnlineInfo) error
Types ¶
type ChainInfo ¶
type ChainInfo struct { Chainconfig config.ChainConfig Backend transaction.Backend OverlayAddress common.Address Signer crypto.Signer ChainID int64 PeerID string TransactionMonitor transaction.Monitor TransactionService transaction.Service }
func InitChain ¶
func InitChain( ctx context.Context, stateStore storage.StateStorer, signer crypto.Signer, pollingInterval time.Duration, chainID int64, peerid string, chainconfig *config.ChainConfig, ) (*ChainInfo, error)
InitChain will initialize the Ethereum backend at the given endpoint and set up the Transaction Service to interact with it using the provided signer.
type LastOnlineInfo ¶
type LastOnlineInfo struct { LastSignedInfo onlinePb.SignedInfo LastSignature string LastTime time.Time }
func GetLastOnline ¶
func GetLastOnline() (*LastOnlineInfo, error)
func GetReportOnlineListDailyOK ¶
func GetReportOnlineListDailyOK() ([]*LastOnlineInfo, error)
GetReportOnlineListDailyOK store tx list
func SetReportOnlineListDailyOK ¶
func SetReportOnlineListDailyOK(r *LastOnlineInfo) ([]*LastOnlineInfo, error)
SetReportOnlineListDailyOK store online daily list
type LastOnlineInfoRet ¶
type LastOnlineInfoRet struct { LastSignedInfo onlinePb.SignedInfo `json:"last_signed_info"` LastSignature string `json:"last_signature"` LastTime time.Time `json:"last_time""` }
type LevelDbReportStatusInfo ¶
type LevelDbReportStatusInfo struct { Peer string `json:"peer"` BttcAddress string `json:"bttc_addr"` StatusContract string `json:"status_contract"` Nonce uint32 `json:"nonce"` TxHash string `json:"tx_hash"` GasSpend string `json:"gas_spend"` ReportTime time.Time `json:"report_time"` IncreaseNonce uint32 `json:"increase_nonce"` }
func GetReportStatusListOK ¶
func GetReportStatusListOK() ([]*LevelDbReportStatusInfo, error)
GetReportStatusListOK store tx list
func SetReportStatusListOK ¶
func SetReportStatusListOK(r *LevelDbReportStatusInfo) ([]*LevelDbReportStatusInfo, error)
SetReportStatusListOK store tx list
type ReportOnlineLastTimeDaily ¶
func GetReportOnlineLastTimeDaily ¶
func GetReportOnlineLastTimeDaily() (*ReportOnlineLastTimeDaily, error)
func SetReportOnlineLastTimeDailyOK ¶
func SetReportOnlineLastTimeDailyOK() (*ReportOnlineLastTimeDaily, error)
type ReportStatusInfo ¶
func GetReportStatus ¶
func GetReportStatus() (*ReportStatusInfo, error)
func SetReportStatusOK ¶
func SetReportStatusOK() (*ReportStatusInfo, error)
type SettleInfo ¶
type SettleInfo struct { Factory vault.Factory VaultService vault.Service ChequeStore vault.ChequeStore CashoutService vault.CashoutService SwapService *swap.Service OracleService priceoracle.Service BttcService bttc.Service }
func InitSettlement ¶
func InitSettlement( ctx context.Context, stateStore storage.StateStorer, chaininfo *ChainInfo, deployGasPrice string, chainID int64, ) (*SettleInfo, error)
Click to show internal directories.
Click to hide internal directories.