Documentation ¶
Index ¶
- Constants
- func AddBlock(mb *MgoBlock, overwrite bool) (err error)
- func AddContract(mc *MgoContract) error
- func AddSyncInfo(msi *MgoSyncInfo) error
- func AddTransaction(mt *MgoTransaction, overwrite bool) error
- func DeleteBlock(hash string) error
- func DeleteLatestSyncInfo() error
- func DeleteTransaction(hash string) error
- func Fsync(async bool) error
- func InitLatestSyncInfo() error
- func MongoServerInit(addrs []string, dbname, user, pass string)
- func UpdateBlockInfo(key string, blocktime, td uint64) error
- func UpdateSyncInfo(num, timestamp, td uint64) error
- type Erc20Receipt
- type ExchangeReceipt
- type MgoBlock
- type MgoContract
- type MgoSyncInfo
- type MgoTransaction
Constants ¶
View Source
const (
KeyOfLatestSyncInfo string = "latest"
)
Variables ¶
This section is empty.
Functions ¶
func AddContract ¶
func AddContract(mc *MgoContract) error
func AddSyncInfo ¶
func AddSyncInfo(msi *MgoSyncInfo) error
func AddTransaction ¶
func AddTransaction(mt *MgoTransaction, overwrite bool) error
func DeleteBlock ¶
func DeleteLatestSyncInfo ¶
func DeleteLatestSyncInfo() error
func DeleteTransaction ¶
func InitLatestSyncInfo ¶
func InitLatestSyncInfo() error
func MongoServerInit ¶
MongoServerInit int mongodb server session
func UpdateBlockInfo ¶
func UpdateSyncInfo ¶
Types ¶
type Erc20Receipt ¶
type Erc20Receipt struct { LogType string `bson:"logType"` LogIndex int `bson:"logIndex"` Erc20 string `bson:"erc20"` From string `bson:"from"` To string `bson:"to"` Value string `bson:"value"` }
Erc20Receipt erc20 tx receipt
type ExchangeReceipt ¶
type ExchangeReceipt struct { LogType string `bson:"txnsType"` LogIndex int `bson:"logIndex"` Exchange string `bson:"exchange"` Address string `bson:"address"` TokenFromAmount string `bson:"tokenFromAmount"` TokenToAmount string `bson:"tokenToAmount"` }
ExchangeReceipt exchange tx receipt
type MgoBlock ¶
type MgoBlock struct { Key string `bson:"_id"` Number uint64 `bson:"number"` Hash string `bson:"hash"` ParentHash string `bson:"parentHash"` Nonce uint64 `bson:"ticketOrder"` // spec Miner string `bson:"miner"` Difficulty uint64 `bson:"difficulty"` TotalDifficulty uint64 `bson:"totalDifficulty"` Size uint64 `bson:"size"` GasLimit uint64 `bson:"gasLimit"` GasUsed uint64 `bson:"gasUsed"` Timestamp uint64 `bson:"timestamp"` BlockTime uint64 `bson:"blockTime"` TxCount int `bson:"txcount"` AvgGasprice string `bson:"avgGasprice"` Reward string `bson:"reward"` SelectedTicket string `bson:"selectedTicket"` // spec RetreatTickets []string `bson:"retreatTickets"` // spec RetreatMiners []string `bson:"retreatMiners"` // spec TicketNumber int `bson:"ticketNumber"` // spec }
func FindBlockByNumber ¶
func FindBlocksInRange ¶
type MgoContract ¶
func FindContract ¶
func FindContract(address string) (*MgoContract, error)
type MgoSyncInfo ¶
type MgoSyncInfo struct { Key string `bson:"_id"` Number uint64 `bson:"number"` Timestamp uint64 `bson:"timestamp"` TotalDifficulty uint64 `bson:"totalDifficulty"` }
func FindLatestSyncInfo ¶
func FindLatestSyncInfo() (*MgoSyncInfo, error)
type MgoTransaction ¶
type MgoTransaction struct { Key string `bson:"_id"` Hash string `bson:"hash"` Nonce uint64 `bson:"nonce"` BlockHash string `bson:"blockHash"` BlockNumber uint64 `bson:"blockNumber"` TransactionIndex int `bson:"transactionIndex"` From string `bson:"from"` To string `bson:"to"` Value string `bson:"value"` ValueInt uint64 `bson:"ivalue"` ValueDec uint64 `bson:"dvalue"` GasLimit uint64 `bson:"gasLimit"` GasPrice string `bson:"gasPrice"` GasUsed uint64 `bson:"gasUsed"` Timestamp uint64 `bson:"timestamp"` Input string `bson:"input"` Status uint64 `bson:"status"` CoinType string `bson:"coinType"` Type string `bson:"type"` // spec Log interface{} `bson:"log"` // spec Erc20Receipts []*Erc20Receipt `bson:"erc20Receipts,omitempty"` ExchangeReceipts []*ExchangeReceipt `bson:"exchangeReceipts,omitempty"` }
func FindTransaction ¶
func FindTransaction(hash string) (*MgoTransaction, error)
Click to show internal directories.
Click to hide internal directories.