jsonrpc

package
v0.0.0-...-a0a9112 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package jsonrpc is the json-rpc2 module in ngcore

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 GetWorkReply

type GetWorkReply struct {
	WorkID uint64 `json:"id"`
	Block  string `json:"block"`
	Txs    string `json:"txs"`
}

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 {
	WorkID uint64 `json:"id"`
	Nonce  string `json:"nonce"`
	GenTx  string `json:"gen"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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