reader

package
v0.0.0-...-914b871 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockData

type BlockData struct {
	Number   uint64
	GasLimit uint64
	GasUsed  uint64
	Time     uint64
	TxnCnt   int
}

func (BlockData) String

func (b BlockData) String() string

type BlockDataRaw

type BlockDataRaw struct {
	Number       string   `json:"number"`
	GasLimit     string   `json:"gasLimit"`
	GasUsed      string   `json:"gasUsed"`
	Time         string   `json:"timestamp"`
	Transactions []string `json:"transactions"`
}

type BlockDataResult

type BlockDataResult struct {
	Result BlockDataRaw `json:"result"`
	Error  ErrMsg       `json:"error"`
}

type BlockNumberResult

type BlockNumberResult struct {
	Result string `json:"result"`
	Error  ErrMsg `json:"error"`
}

type ErrMsg

type ErrMsg struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type GethClient

type GethClient struct {
	// contains filtered or unexported fields
}

func NewGethClient

func NewGethClient(ep string, bdCh chan<- *BlockData, stopc chan struct{}) *GethClient

func (*GethClient) GetBlock

func (g *GethClient) GetBlock(bn uint64) (*BlockData, error)

func (*GethClient) PostRequest

func (g *GethClient) PostRequest(blockNumberReq string) (*http.Response, error)

func (*GethClient) Start

func (g *GethClient) Start()

func (*GethClient) Stop

func (g *GethClient) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL