jsonrpc

package
v0.0.0-...-571fd38 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package jsonrpc is the json-rpc2 module in ngbiz

All commands/methods should follow these rules: - All (private or public) keys are encoded with base58 - All bytes are encoded in base64 (forced by protobuf) - All numbers are float64, coin uint is NG. So when generating tx, its necessary to multiply the values/fee with 1000000 to make unit be MicroNG - All protobuf's bytes are in base64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetBlockTemplateParams

type GetBlockTemplateParams struct {
	PrivateKey string `json:"private_key"`
}

type GetWorkParams

type GetWorkParams struct {
	PrivateKey string `json:"private_key"`
}

type GetWorkReply

type GetWorkReply struct {
	RawHeader string `json:"header"`
}

type Server

type Server struct {
	*ServerConfig
	*jsonrpc2http.Server
	// contains filtered or unexported fields
}

Server is a json-rpc v2 server.

func NewServer

func NewServer(pow *consensus.PoWork, config ServerConfig) *Server

NewServer will create a new Server, with registered *jsonrpc2http.HTTPHandler. But not running.

func (*Server) Serve

func (s *Server) Serve()

Serve will make the server running.

type ServerConfig

type ServerConfig struct {
	Host                 string
	Port                 int
	DisableP2PMethods    bool
	DisableMiningMethods bool
}

type SubmitWorkParams

type SubmitWorkParams struct {
	Nonce     string `json:"nonce"`
	RawHeader string `json:"header"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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