rpc

package
v0.0.0-...-bdc138e Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: GPL-3.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBlockReply

type GetBlockReply struct {
	Number           string   `json:"number"`
	Hash             string   `json:"hash"`
	ParentHash       string   `json:"parentHash"`
	Nonce            string   `json:"nonce"`
	Sha3Uncles       string   `json:"sha3Uncles"`
	LogsBloom        string   `json:"logsBloom"`
	TransactionsRoot string   `json:"transactionsRoot"`
	StateRoot        string   `json:"stateRoot"`
	Miner            string   `json:"miner"`
	Difficulty       string   `json:"difficulty"`
	TotalDifficulty  string   `json:"totalDifficulty"`
	Size             string   `json:"size"`
	ExtraData        string   `json:"extraData"`
	GasLimit         string   `json:"gasLimit"`
	GasUsed          string   `json:"gasUsed"`
	Timestamp        string   `json:"timestamp"`
	Transactions     []Tx     `json:"transactions"`
	Uncles           []string `json:"uncles"`
	// https://github.com/ethereum/EIPs/issues/95
	SealFields []string `json:"sealFields"`
}

type GetBlockReplyPart

type GetBlockReplyPart struct {
	Number     string `json:"number"`
	Difficulty string `json:"difficulty"`
}

type JSONRpcResp

type JSONRpcResp struct {
	Id     *json.RawMessage       `json:"id"`
	Result *json.RawMessage       `json:"result"`
	Error  map[string]interface{} `json:"error"`
}

type RPCClient

type RPCClient struct {
	sync.RWMutex
	Url  string
	Name string
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(name, url, timeout string) *RPCClient

func (*RPCClient) Check

func (r *RPCClient) Check() bool

func (*RPCClient) GetBalance

func (r *RPCClient) GetBalance(address string) (*big.Int, error)

func (*RPCClient) GetBlockByHash

func (r *RPCClient) GetBlockByHash(hash string) (*GetBlockReply, error)

func (*RPCClient) GetBlockByHeight

func (r *RPCClient) GetBlockByHeight(height int64) (*GetBlockReply, error)

func (*RPCClient) GetPeerCount

func (r *RPCClient) GetPeerCount() (int64, error)

func (*RPCClient) GetPendingBlock

func (r *RPCClient) GetPendingBlock() (*GetBlockReplyPart, error)

func (*RPCClient) GetTxReceipt

func (r *RPCClient) GetTxReceipt(hash string) (*TxReceipt, error)

func (*RPCClient) GetUncleByBlockNumberAndIndex

func (r *RPCClient) GetUncleByBlockNumberAndIndex(height int64, index int) (*GetBlockReply, error)

func (*RPCClient) GetWork

func (r *RPCClient) GetWork() ([]string, error)

func (*RPCClient) SendTransaction

func (r *RPCClient) SendTransaction(from, to, gas, gasPrice, value string, autoGas bool) (string, error)

func (*RPCClient) Sick

func (r *RPCClient) Sick() bool

func (*RPCClient) Sign

func (r *RPCClient) Sign(from string, s string) (string, error)

func (*RPCClient) SubmitBlock

func (r *RPCClient) SubmitBlock(params []string) (bool, error)

type Tx

type Tx struct {
	Gas      string `json:"gas"`
	GasPrice string `json:"gasPrice"`
	Hash     string `json:"hash"`
}

type TxReceipt

type TxReceipt struct {
	TxHash  string `json:"transactionHash"`
	GasUsed string `json:"gasUsed"`
}

Jump to

Keyboard shortcuts

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