Documentation ¶
Index ¶
- Constants
- func ToString(queryMap interface{}) string
- func ToStringD(queryMap bson.D) string
- type Block
- type BlockNonce
- type Bloom
- type DataMessage
- type MBlock
- type MTransaction
- type MongoContext
- func (c *MongoContext) GetCollection(db string, collection string) *mgo.Collection
- func (c *MongoContext) SetCollection(collection string, s func(*mgo.Collection) error) error
- func (c *MongoContext) SetCollectionByDB(db string, collection string, s func(*mgo.Collection) error) error
- func (c *MongoContext) SetCollectionCount(collection string, s func(*mgo.Collection) (int, error)) (int, error)
- type MongoRepository
- type NodeMessage
- type Transaction
Constants ¶
const ( // BloomByteLength represents the number of bytes used in a header log bloom. BloomByteLength = 256 // BloomBitLength represents the number of bits used in a header log bloom. BloomBitLength = 8 * BloomByteLength )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { Difficulty string `json:"difficulty"` Extra string `json:"extraData"` GasLimit string `json:"gasLimit"` GasUsed string `json:"gasUsed"` Hash string `json:"hash"` Bloom string `json:"logsBloom"` Coinbase string `json:"miner"` MixDigest string `json:"mixHash"` Nonce string `json:"nonce"` Number string `json:"number"` ParentHash string `json:"parentHash"` ReceiptHash string `json:"receiptsRoot"` UncleHash string `json:"sha3Uncles"` Size string `json:"size"` Root string `json:"stateRoot"` Time string `json:"timestamp"` TotalDifficulty string `json:"totalDifficulty"` TXs []Transaction `json:"transactions"` TxHash string `json:"transactionsRoot"` Uncles []string `json:"uncles"` }
Block represents a block header in the Ethereum blockchain.
type BlockNonce ¶
type BlockNonce [8]byte
A BlockNonce is a 64-bit hash which proves (combined with the mix-hash) that a sufficient amount of computation has been carried out on a block.
type DataMessage ¶
type DataMessage struct { ID string `bson:"_id"` BlockNumber int `bson:"block_number"` TransactionID string `bson:"transaction_id"` SequenceNum int `bson:"sequence_num"` BlockHash string `bson:"block_hash"` CursorNum int `bson:"cursor_num"` CursorLabel int `bson:"cursor_label"` Lifetime int `bson:"lifetime"` Sender string `bson:"sender"` Cntract string `bson:"contract"` Method string `bson:"method"` Param struct { Filehash string `bson:"filehash"` Info struct { Username string `bson:"username"` Filename string `bson:"filename"` Filesize uint64 `bson:"filesize"` Filepolicy string `bson:"filepolicy"` Filenumber uint64 `bson:"filenumber"` Simorass uint64 `bson:"simorass"` Optype uint64 `bson:"optype"` Storeaddr string `bson:"storeaddr"` } `bson:"info"` } `bson:"param"` SigAlg int `bson:"sig_alg"` Signature string `bson:"signature"` CreatedTime string `bson:"created_time"` Version int `bson:"version"` }
DataMessage struct
type MBlock ¶
type MBlock struct { Difficulty bson.Decimal128 `bson:"difficulty"` Extra string `bson:"extraData"` GasLimit bson.Decimal128 `bson:"gasLimit"` GasUsed bson.Decimal128 `bson:"gasUsed"` Hash string `bson:"hash"` Bloom string `bson:"logsBloom"` Coinbase string `bson:"miner"` MixDigest string `bson:"mixHash"` Nonce string `bson:"nonce"` Number bson.Decimal128 `bson:"number"` ParentHash string `bson:"parentHash"` ReceiptHash string `bson:"receiptsRoot"` UncleHash string `bson:"sha3Uncles"` Size bson.Decimal128 `bson:"size"` Root string `bson:"stateRoot"` Time bson.Decimal128 `bson:"timestamp"` TotalDifficulty bson.Decimal128 `bson:"totalDifficulty"` TXs []MTransaction `bson:"transactions"` TxHash string `bson:"transactionsRoot"` Uncles []string `bson:"uncles"` }
MBlock represents a block header in Mongodbq.
type MTransaction ¶
type MTransaction struct { BlockHash string `bson:"blockHash"` BlockNumber bson.Decimal128 `bson:"blockNumber"` From string `bson:"from"` Gas bson.Decimal128 `bson:"gas"` GasPrice bson.Decimal128 `bson:"gasPrice"` Hash string `bson:"hash"` Input string `bson:"input"` Nonce string `bson:"nonce"` To string `bson:"to"` TransactionIndex bson.Decimal128 `bson:"transactionIndex"` Value bson.Decimal128 `bson:"value"` V string `bson:"v"` R string `bson:"r"` S string `bson:"s"` }
MTransaction represents a transaction that will serialize to the RPC representation of a transaction
type MongoContext ¶
type MongoContext struct {
// contains filtered or unexported fields
}
MongoContext struct
func (*MongoContext) GetCollection ¶
func (c *MongoContext) GetCollection(db string, collection string) *mgo.Collection
GetCollection method
func (*MongoContext) SetCollection ¶
func (c *MongoContext) SetCollection(collection string, s func(*mgo.Collection) error) error
SetCollection method
func (*MongoContext) SetCollectionByDB ¶
func (c *MongoContext) SetCollectionByDB(db string, collection string, s func(*mgo.Collection) error) error
SetCollectionByDB on server
func (*MongoContext) SetCollectionCount ¶
func (c *MongoContext) SetCollectionCount(collection string, s func(*mgo.Collection) (int, error)) (int, error)
SetCollectionCount method
type MongoRepository ¶
type MongoRepository struct {
// contains filtered or unexported fields
}
MongoRepository struct
func NewMongoRepository ¶
func NewMongoRepository(endpoint string) *MongoRepository
NewMongoRepository creates a new MongoRepository
func (*MongoRepository) CallDataSliceIPRequest ¶
func (r *MongoRepository) CallDataSliceIPRequest(guid string) (*util.DataDBInfo, error)
CallDataSliceIPRequest on server
func (*MongoRepository) CallIsDataExists ¶
func (r *MongoRepository) CallIsDataExists(merkleroothash string) (uint64, error)
CallIsDataExists check
func (*MongoRepository) CallNodeRequest ¶
func (r *MongoRepository) CallNodeRequest(seedip string) (*util.NodeDBInfo, error)
CallNodeRequest on server
type NodeMessage ¶
type NodeMessage struct { ID bson.ObjectId `bson:"_id"` MessageID int `bson:"message_id"` TransactionID string `bson:"transaction_id"` Authorization []interface{} `bson:"authorization"` HandlerAccountName string `bson:"handler_account_name"` Type string `bson:"type"` Node struct { NodeID string `bson:"node_id"` BasicInfo struct { NodeIP string `bson:"node_ip"` NodePort string `bson:"node_port"` NodeAddress string `bson:"node_address"` SeedIP string `bson:"seed_ip"` SlaveIP []string `bson:"slave_ip"` } `bson:"basic_info"` } `bson:"node"` CreatedAt time.Time `bson:"createdAt"` }
NodeMessage struct
type Transaction ¶
type Transaction struct { BlockHash string `json:"blockHash"` BlockNumber string `json:"blockNumber"` From string `json:"from"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` Hash string `json:"hash"` Input string `json:"input"` Nonce string `json:"nonce"` To string `json:"to"` TransactionIndex string `json:"transactionIndex"` Value string `json:"value"` V string `json:"v"` R string `json:"r"` S string `json:"s"` }
Transaction represents a transaction that will serialize to the RPC representation of a transaction