Documentation ¶
Overview ¶
Package node provides a client for the node
Index ¶
- type Block
- type BlockWrapper
- type ChainInfo
- type Client
- func (c *Client) GetBlock(ctx context.Context, hash string) (*Block, error)
- func (c *Client) GetBlockHeaders(ctx context.Context, from string, count int) ([]Block, error)
- func (c *Client) GetChainInfo(ctx context.Context) (*ChainInfo, error)
- func (c *Client) NewRequest(ctx context.Context, method, url string) (*http.Request, error)
- type SoftFork
- type Tx
- type Txs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Txs Txs `json:"tx"` Hash string `json:"hash"` NextBlockHash string `json:"nextblockhash"` PreviousBlockHash string `json:"previousblockhash"` }
Block is a block
type BlockWrapper ¶
type BlockWrapper struct { Txs json.RawMessage `json:"tx"` Hash string `json:"hash"` }
BlockWrapper is a wrapper for a block
type ChainInfo ¶
type ChainInfo struct { Chain string `json:"chain"` Blocks int `json:"blocks"` Headers int `json:"headers"` BestBlockHash string `json:"bestblockhash"` Difficulty float64 `json:"difficulty"` MedianTime int `json:"mediantime"` VerificationProgress float64 `json:"verificationprogress"` ChainWork string `json:"chainwork"` Pruned bool `json:"pruned"` SoftForks []SoftFork `json:"softforks"` }
ChainInfo is the chain info
type Client ¶
Client is the node client
func (*Client) GetBlockHeaders ¶
GetBlockHeaders returns a list of block headers
func (*Client) GetChainInfo ¶
GetChainInfo returns the chain info
Click to show internal directories.
Click to hide internal directories.