jsonrpc

package
v0.0.0-...-bff8ceb Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const URL = "http://localhost:5000/rpc"

Variables

This section is empty.

Functions

func InitRPCServer

func InitRPCServer(file string) error

func RPCCall

func RPCCall(method string, params interface{}, out interface{}) error

Types

type Balance

type Balance struct {
	Address string `json:"address"`
	Balance uint   `json:"balance"`
}

type Blocks

type Blocks struct {
	Blocks []core.Block `json:"blocks"`
	Count  uint64       `json:"count"`
}

type MyTX

type MyTX struct {
	TxID     []byte `json:"txid"`
	Amount   uint   `json:"amount"`
	Sender   string `json:"sender"`
	Receiver string `json:"receiver"`
	Msg      string `json:"msg"`
}

type MyTXs

type MyTXs struct {
	TXs []MyTX `json:"txs"`
}

type NewTX

type NewTX struct {
	TX []byte `json:"tx"`
}

type NewTXArgs

type NewTXArgs struct {
	Sender       string `json:"sender"`
	Receiver     string `json:"receiver"`
	SenderPubKey string `json:"sender_pub_key"`
	Amount       uint   `json:"amount"`
	Msg          string `json:"msg"`
}

type Pool

type Pool struct {
	TXs []string `json:"txs"`
}

type PrevHash

type PrevHash struct {
	Hash []byte `json:"prev_hash"`
}

type PrevTXs

type PrevTXs struct {
	PrevTXs map[string][]byte `json:"prevTXs"`
}

type RPC

type RPC struct{}

func (*RPC) GetBalance

func (rpc *RPC) GetBalance(r *http.Request, args *struct{ Address string }, resp *Balance) error

func (*RPC) GetBlocks

func (rpc *RPC) GetBlocks(r *http.Request, args *struct{ MaxHT, MinHT uint }, resp *Blocks) error

func (*RPC) GetMyTXs

func (rpc *RPC) GetMyTXs(r *http.Request, args *struct{ Address string }, resp *MyTXs) error

func (*RPC) GetPool

func (rpc *RPC) GetPool(r *http.Request, args *struct{}, resp *Pool) error

func (*RPC) GetPrevBlockHash

func (rpc *RPC) GetPrevBlockHash(r *http.Request, args *struct{}, resp *PrevHash) error

func (*RPC) GetPrevTXs

func (rpc *RPC) GetPrevTXs(r *http.Request, args *struct{ TX []byte }, resp *PrevTXs) error

func (*RPC) NewTX

func (rpc *RPC) NewTX(r *http.Request, args *NewTXArgs, resp *NewTX) error

func (*RPC) ReportBlock

func (rpc *RPC) ReportBlock(r *http.Request, args *ReportParams, resp *Report) error

func (*RPC) Send

func (rpc *RPC) Send(r *http.Request, args *struct{ TX []byte }, resp *Send) error

type Report

type Report struct {
	Msg string `json:"msg"`
}

type ReportParams

type ReportParams struct {
	Block []byte `json:"block"`
}

type Send

type Send struct {
	Msg string `json:"msg"`
}

Jump to

Keyboard shortcuts

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