Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockHash ¶
func GetBlockHash(elasticURL, blockIndexName, organization, peerName, channelId string, blockNumber uint64) (string, error)
Returns the hash of the specified block from the specified index.
func SendBlockNumber ¶
func SendBlockNumber(url string, lastBlockNumber BlockNumber) error
Types ¶
type BlockIndexFilterResponse ¶
type BlockIndexFilterResponse struct { BlockIndexFilterHitsObject struct { BlockIndexFilterHit []struct { BlockIndexData struct { BlockHash string `json:"block_hash"` } `json:"_source"` } `json:"hits"` } `json:"hits"` }
This struct is for parsing block filter query response from Elasticsearch
type BlockNumber ¶
type BlockNumber struct { BlockNumber uint64 `json:"blockNumber"` ChannelId string `json:"channelId"` }
This struct is for getting the block number from the block number response.
func GetBlockNumber ¶
func GetBlockNumber(url string) (*BlockNumber, error)
Sends a GET Http request to the sepcified URL, parses the response and returns the block number.
type BlockNumberResponse ¶
type BlockNumberResponse struct { Index string `json:"_index"` Type string `json:"_type"` Id string `json:"_id"` BlockNumber BlockNumber `json:"_source"` }
This struct is for parsing the block number response from Elasticsearch.
Click to show internal directories.
Click to hide internal directories.