Documentation ¶
Index ¶
- Variables
- func CollectionItemNum(collect string) (count int, err error)
- func Contract(hash string) (contract Transaction, txs []Transaction, err error)
- func ContractsCount() (int, error)
- func CreateSqlite() (err error)
- func GetHTTPResp(url string) (bytez []byte, err error)
- func Height() (maxHeight int, err error)
- func Init()
- func OneBlock(hash string) (block Block, txs []Transaction, err error)
- func OneBlockBySqlite(hash string) (block Block, txs []Transaction, err error)
- func OneContract(hash string) (contract Transaction, txs []Transaction, err error)
- func Save(br *BlockRepo) (err error)
- func SaveBlockBySqlite(blocks []Block) (err error)
- func SaveContractMeta(meta ContractMeta) error
- func SaveTxBySqlite(txs []Transaction) (err error)
- func TryLock(owner string, long int) (bool, error)
- func TxsCount() (int, error)
- type Block
- func BlockByHeight(height int) (block Block, err error)
- func BlockByHeightBySqlite(height int) (block Block, err error)
- func BlocksFromTo(from, to int) (blocks []Block, err error)
- func BlocksFromToBySqlite(from, to int) (blocks []Block, err error)
- func LatestBlocksBySqlite(limit int) (blocks []Block, err error)
- type BlockRepo
- type ContractMeta
- type DBMutex
- type DisplayItem
- type HTTPResponse
- type NodeInfo
- type Repo
- type Status
- type Transaction
- func LatestContracts(limit int, skip int) (txs []Transaction, err error)
- func LatestTxs(limit int, skip int) (txs []Transaction, err error)
- func OneTransaction(hash string) (tx Transaction, err error)
- func OneTransactionBySqlite(hash string) (tx Transaction, err error)
- func TransactionFromTo(from, to int) (txs []Transaction, err error)
- func TransactionFromToBySqlite(from, to int) (txs []Transaction, err error)
- func TransactionsByBlkhash(hash string) (txs []Transaction, err error)
- func TransactionsByBlkhashBySqlite(hash string) (txs []Transaction, err error)
- func Txs(limit int) (txs []Transaction, err error)
- func TxsByBlkHeight(height int) (txs []Transaction, err error)
- func TxsQuery(fromTo string) (txs []Transaction, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BLOCK_COLLECT = "block" TX_COLLECT = "transaction" CONTRACT_META_COLLECT = "contract_meta" MONGO_URL string DB_NAME string ChainID string )
View Source
var MutexCollect = "mutex"
Functions ¶
func CollectionItemNum ¶
func Contract ¶
func Contract(hash string) (contract Transaction, txs []Transaction, err error)
func ContractsCount ¶
func CreateSqlite ¶
func CreateSqlite() (err error)
func GetHTTPResp ¶
func OneBlockBySqlite ¶
func OneBlockBySqlite(hash string) (block Block, txs []Transaction, err error)
func OneContract ¶
func OneContract(hash string) (contract Transaction, txs []Transaction, err error)
func SaveBlockBySqlite ¶
func SaveContractMeta ¶
func SaveContractMeta(meta ContractMeta) error
func SaveTxBySqlite ¶
func SaveTxBySqlite(txs []Transaction) (err error)
Types ¶
type Block ¶
type Block struct { Hash string ParentHash string ChainID string Height int `bson:"_id"` Time time.Time NumTxs int LastCommitHash string DataHash string ValidatorsHash string AppHash string ProposerAddress string }
func BlockByHeight ¶
func BlockByHeightBySqlite ¶
func BlocksFromTo ¶
func BlocksFromToBySqlite ¶
func LatestBlocksBySqlite ¶
type BlockRepo ¶
type BlockRepo struct { Blocks []Block Txs []Transaction }
type ContractMeta ¶
type ContractMeta struct { Hash string `json:"hash" bson:"_id"` ABI string `json:"abi" bson:"abi"` }
func OneContractMeta ¶
func OneContractMeta(hash string) (meta *ContractMeta, err error)
type DisplayItem ¶
func BlocksToDisplayItems ¶
func BlocksToDisplayItems(blocks []Block, limit int) (items []DisplayItem)
func LatestBlocks ¶
func LatestBlocks(limit int) (displayData []DisplayItem, err error)
type HTTPResponse ¶
type HTTPResponse struct { JSONRPC string `json:"jsonrpc"` ID string `json:"id"` Result *json.RawMessage `json:"result"` Error string `json:"error"` }
type Repo ¶
type Repo interface { Init() Save(br *BlockRepo) (err error) SaveContractMeta(meta ContractMeta) (err error) LatestBlocks(limit int) (displayData []DisplayItem, err error) BlocksFromTo(from, to int) (blocks []Block, err error) CollectionItemNum(collect string) (count int, err error) Contract(hash string) (tx Transaction, txs []Transaction, err error) Height() (maxHeight int, err error) Contracts(limit int) (txs []Transaction, err error) ContractsCount() (int, error) LatestContracts(limit int, skip int) (txs []Transaction, err error) TxsQuery(fromTo string) (txs []Transaction, err error) Txs(limit int) (txs []Transaction, err error) TxsCount() (int, error) LatestTxs(limit int, skip int) (txs []Transaction, err error) OneContract(hash string) (contract Transaction, txs []Transaction, err error) OneContractMeta(hash string) (*ContractMeta, error) OneTransaction(hash string) (tx Transaction, err error) TransactionsByBlkhash(hash string) (txs []Transaction, err error) TxsByBlkHeight(height int) (txs []Transaction, err error) TransactionFromTo(from, to int) (txs []Transaction, err error) BlockByHeight(height int) (block Block, err error) OneBlock(hash string) (block Block, txs []Transaction, err error) }
type Status ¶
type Transaction ¶
type Transaction struct { Payload []byte `json:"-"` PayloadHex string ContractMeta ContractMeta `bson:"-"` Hash string `bson:"_id"` From string To string Receipt string Amount string Nonce uint64 Gas string Size int64 Block string Contract string Time time.Time Height int }
func LatestContracts ¶
func LatestContracts(limit int, skip int) (txs []Transaction, err error)
func OneTransaction ¶
func OneTransaction(hash string) (tx Transaction, err error)
func OneTransactionBySqlite ¶
func OneTransactionBySqlite(hash string) (tx Transaction, err error)
func TransactionFromTo ¶
func TransactionFromTo(from, to int) (txs []Transaction, err error)
func TransactionFromToBySqlite ¶
func TransactionFromToBySqlite(from, to int) (txs []Transaction, err error)
func TransactionsByBlkhash ¶
func TransactionsByBlkhash(hash string) (txs []Transaction, err error)
func TransactionsByBlkhashBySqlite ¶
func TransactionsByBlkhashBySqlite(hash string) (txs []Transaction, err error)
func Txs ¶
func Txs(limit int) (txs []Transaction, err error)
func TxsByBlkHeight ¶
func TxsByBlkHeight(height int) (txs []Transaction, err error)
func TxsQuery ¶
func TxsQuery(fromTo string) (txs []Transaction, err error)
Click to show internal directories.
Click to hide internal directories.