Documentation ¶
Index ¶
- func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec
- func NewJSONCodec(conn io.ReadWriteCloser, srv *rpc.Server) rpc.ServerCodec
- func ServeConn(conn io.ReadWriteCloser)
- type BatchArg
- type Client
- type CurrentBlock
- type Error
- type GetBlockByHeightRequest
- type JSONRPC2
- type MinerInfo
- type MonitorRPC
- func (rpc *MonitorRPC) CurrentBlock(h int64, fullTx bool) (currentBlock *CurrentBlock, err error)
- func (rpc *MonitorRPC) GetInfo() (result map[string]interface{}, err error)
- func (rpc *MonitorRPC) NodeInfo() (nodeInfo *NodeInfo, err error)
- func (rpc *MonitorRPC) NodeStats() (nodeStats *NodeStats, err error)
- type NodeInfo
- type NodeStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientCodec ¶
func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec
NewClientCodec returns a new rpc.ClientCodec using JSON-RPC 2.0 on conn.
func NewJSONCodec ¶
func NewJSONCodec(conn io.ReadWriteCloser, srv *rpc.Server) rpc.ServerCodec
NewJSONCodec returns a new rpc.ServerCodec using JSON-RPC on conn.
func ServeConn ¶
func ServeConn(conn io.ReadWriteCloser)
ServeConn runs the JSON-RPC server on a single connection. ServeConn blocks, serving the connection until the client hangs up. The caller typically invokes ServeConn with go-routine.
Types ¶
type BatchArg ¶
type BatchArg struct {
// contains filtered or unexported fields
}
BatchArg is a param for internal RPC JSONRPC2.Batch.
type Client ¶
Client represents a JSON RPC 2.0 Client. There may be multiple outstanding Calls associated with a single Client, and a Client may be used by multiple goroutines simultaneously.
It also provides all methods of net/rpc Client.
func NewClient ¶
func NewClient(conn io.ReadWriteCloser) *Client
NewClient returns a new Client to handle requests to the set of services at the other end of the connection.
func NewClientWithCodec ¶
func NewClientWithCodec(codec rpc.ClientCodec) *Client
NewClientWithCodec returns a new Client using the given rpc.ClientCodec.
type CurrentBlock ¶
type CurrentBlock struct { HeadHash string `json:"headHash"` Height uint64 `json:"height"` Timestamp *big.Int `json:"timestamp"` Difficulty *big.Int `json:"difficulty"` Creator string `json:"creator"` TxCount int `json:"txcount"` }
CurrentBlock is the informations about the best block
type Error ¶
type Error struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
Error represent JSON-RPC 2.0 "Error object".
func ServerError ¶
ServerError convert errors returned by Client.Call() into Error. User should check for rpc.ErrShutdown and io.ErrUnexpectedEOF before calling ServerError.
type GetBlockByHeightRequest ¶
GetBlockByHeightRequest request param for GetBlockByHeight api
type JSONRPC2 ¶
type JSONRPC2 struct{}
JSONRPC2 is an internal RPC service used to process batch requests.
type MonitorRPC ¶
type MonitorRPC struct { Debug bool // contains filtered or unexported fields }
MonitorRPC json_rpc client
func NewSeeleRPC ¶
func NewSeeleRPC(url string, options ...func(rpc *MonitorRPC)) *MonitorRPC
NewSeeleRPC create new json_rpc
func (*MonitorRPC) CurrentBlock ¶
func (rpc *MonitorRPC) CurrentBlock(h int64, fullTx bool) (currentBlock *CurrentBlock, err error)
CurrentBlock returns the current block info.
func (*MonitorRPC) GetInfo ¶
func (rpc *MonitorRPC) GetInfo() (result map[string]interface{}, err error)
GetInfo gets the account address that mining rewards will be send to.
func (*MonitorRPC) NodeInfo ¶
func (rpc *MonitorRPC) NodeInfo() (nodeInfo *NodeInfo, err error)
NodeInfo returns the current node info.
func (*MonitorRPC) NodeStats ¶
func (rpc *MonitorRPC) NodeStats() (nodeStats *NodeStats, err error)
NodeStats returns the current node info.
type NodeInfo ¶
type NodeInfo struct { Name string `json:"name"` Node string `json:"node"` Port int `json:"port"` NetVersion string `json:"netVersion"` Protocol string `json:"protocol"` API string `json:"api"` Os string `json:"os"` OsVer string `json:"os_v"` Client string `json:"client"` History bool `json:"canUpdateHistory"` Shard uint `json:"shard"` }
NodeInfo is the collection of meta information about a node that is displayed on the monitoring page.