rpc

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: ISC Imports: 37 Imported by: 0

Documentation

Overview

this is to setup and handle all of the incoming JSON RPC requests from clients requiring bitmarkd services

standard golang RPC services can be used on the client side to access these services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Callback

func Callback(conn io.ReadWriteCloser, argument interface{})

listener callback

func CertificateFingerprint added in v0.6.5

func CertificateFingerprint(certificate []byte) [32]byte

compute the fingerprint of a certificate

FreeBSD: openssl x509 -outform DER -in bitmarkd-local-rpc.crt | sha3sum -a 256

func Finalise added in v0.6.5

func Finalise() error

finialise - stop all background tasks

func Initialise added in v0.6.5

func Initialise(rpcConfiguration *RPCConfiguration, httpsConfiguration *HTTPSConfiguration, version string) error

initialise peer backgrouds processes

Types

type AssetGetArguments

type AssetGetArguments struct {
	Fingerprints []string `json:"fingerprints"`
}

type AssetGetReply

type AssetGetReply struct {
	Assets []AssetRecord `json:"assets"`
}

type AssetRecord added in v0.2.3

type AssetRecord struct {
	Record    string      `json:"record"`
	Confirmed bool        `json:"confirmed"`
	AssetId   interface{} `json:"id,omitempty"`
	Data      interface{} `json:"data"`
}

type AssetStatus added in v0.2.0

type AssetStatus struct {
	AssetId   *transactionrecord.AssetIdentifier `json:"id"`
	Duplicate bool                               `json:"duplicate"`
}

Assets registration -------------------

type Assets

type Assets struct {
	// contains filtered or unexported fields
}

func (*Assets) Get

func (assets *Assets) Get(arguments *AssetGetArguments, reply *AssetGetReply) error

type AssetsRegisterReply added in v0.2.0

type AssetsRegisterReply struct {
	Assets []AssetStatus `json:"assets"`
}

type Bitmark

type Bitmark struct {
	// contains filtered or unexported fields
}

func (*Bitmark) Provenance

func (bitmark *Bitmark) Provenance(arguments *ProvenanceArguments, reply *ProvenanceReply) error

func (*Bitmark) Transfer

type BitmarkTransferReply

type BitmarkTransferReply struct {
	TxId     merkle.Digest                                   `json:"txId"`
	PayId    pay.PayId                                       `json:"payId"`
	Payments map[string]transactionrecord.PaymentAlternative `json:"payments"`
}

type Bitmarks

type Bitmarks struct {
	// contains filtered or unexported fields
}

func (*Bitmarks) Create added in v0.2.6

func (bitmarks *Bitmarks) Create(arguments *CreateArguments, reply *CreateReply) error

func (*Bitmarks) Proof added in v0.2.0

func (bitmarks *Bitmarks) Proof(arguments *ProofArguments, reply *ProofReply) error

type BitmarksRecord added in v0.1.2

type BitmarksRecord struct {
	Record  string      `json:"record"`
	TxId    interface{} `json:"txId,omitempty"`
	InBlock uint64      `json:"inBlock"`
	AssetId interface{} `json:"assetId,omitempty"`
	Data    interface{} `json:"data"`
}

can be any of the transaction records

type BlockAsset added in v0.7.0

type BlockAsset struct {
	Number uint64 `json:"number"`
}

type BlockOwner added in v0.7.0

type BlockOwner struct {
	// contains filtered or unexported fields
}

func (*BlockOwner) Transfer added in v0.7.0

func (bitmark *BlockOwner) Transfer(transfer *transactionrecord.BlockOwnerTransfer, reply *BlockOwnerTransferReply) error

func (*BlockOwner) TxIdForBlock added in v0.7.0

func (bitmark *BlockOwner) TxIdForBlock(info *TxIdForBlockArguments, reply *TxIdForBlockReply) error

type BlockOwnerTransferReply added in v0.7.0

type BlockOwnerTransferReply struct {
	TxId     merkle.Digest                                   `json:"txId"`
	PayId    pay.PayId                                       `json:"payId"`
	Payments map[string]transactionrecord.PaymentAlternative `json:"payments"`
}

type Counters added in v0.3.5

type Counters struct {
	Pending  int `json:"pending"`
	Verified int `json:"verified"`
}

type CreateArguments added in v0.2.6

type CreateArguments struct {
	Assets []*transactionrecord.AssetData    `json:"assets"`
	Issues []*transactionrecord.BitmarkIssue `json:"issues"`
}

type CreateReply added in v0.2.6

type CreateReply struct {
	Assets     []AssetStatus                                   `json:"assets"`
	Issues     []IssueStatus                                   `json:"issues"`
	PayId      pay.PayId                                       `json:"payId"`
	PayNonce   reservoir.PayNonce                              `json:"payNonce"`
	Difficulty string                                          `json:"difficulty"`
	Payments   map[string]transactionrecord.PaymentAlternative `json:"payments,omitempty"`
}

type HTTPSConfiguration added in v0.6.5

type HTTPSConfiguration struct {
	MaximumConnections int                 `libucl:"maximum_connections" json:"maximum_connections"`
	Listen             []string            `libucl:"listen" json:"listen"`
	Certificate        string              `libucl:"certificate" json:"certificate"`
	PrivateKey         string              `libucl:"private_key" json:"private_key"`
	Allow              map[string][]string `libucl:"allow" json:"allow"`
}

type InfoArguments

type InfoArguments struct{}

type InfoReply

type InfoReply struct {
	Chain               string   `json:"chain"`
	Mode                string   `json:"mode"`
	Blocks              uint64   `json:"blocks"`
	RPCs                uint64   `json:"rpcs"`
	Peers               uint64   `json:"peers"`
	TransactionCounters Counters `json:"transactionCounters"`
	Difficulty          float64  `json:"difficulty"`
	Version             string   `json:"version"`
	Uptime              string   `json:"uptime"`
	PublicKey           string   `json:"publicKey"`
}

type InternalConnection added in v0.6.5

type InternalConnection struct {
	// contains filtered or unexported fields
}

type to allow rpc system to interface to http request

func (*InternalConnection) Close added in v0.6.5

func (c *InternalConnection) Close() error

func (*InternalConnection) Read added in v0.6.5

func (c *InternalConnection) Read(p []byte) (n int, err error)

func (*InternalConnection) Write added in v0.6.5

func (c *InternalConnection) Write(d []byte) (n int, err error)

type IssueStatus added in v0.2.5

type IssueStatus struct {
	TxId merkle.Digest `json:"txId"`
}

type Node

type Node struct {
	// contains filtered or unexported fields
}

func (*Node) Info

func (node *Node) Info(arguments *InfoArguments, reply *InfoReply) error

func (*Node) List

func (node *Node) List(arguments *NodeArguments, reply *NodeReply) error

type NodeArguments

type NodeArguments struct {
	Start uint64 `json:"start,string"`
	Count int    `json:"count"`
}

type NodeReply

type NodeReply struct {
	Nodes     []announce.RPCEntry `json:"nodes"`
	NextStart uint64              `json:"nextStart,string"`
}

type Owner added in v0.1.2

type Owner struct {
	// contains filtered or unexported fields
}

func (*Owner) Bitmarks added in v0.1.2

func (owner *Owner) Bitmarks(arguments *OwnerBitmarksArguments, reply *OwnerBitmarksReply) error

type OwnerBitmarksArguments added in v0.1.2

type OwnerBitmarksArguments struct {
	Owner *account.Account `json:"owner"`        // base58
	Start uint64           `json:"start,string"` // first record number
	Count int              `json:"count"`        // number of records
}

type OwnerBitmarksReply added in v0.1.2

type OwnerBitmarksReply struct {
	Next uint64                    `json:"next,string"` // start value for the next call
	Data []ownership.Ownership     `json:"data"`        // list of bitmarks either issue or transfer
	Tx   map[string]BitmarksRecord `json:"tx"`          // table of tx records
}

type ProofArguments added in v0.2.0

type ProofArguments struct {
	PayId pay.PayId `json:"payId"`
	Nonce string    `json:"nonce"`
}

type ProofReply added in v0.2.0

type ProofReply struct {
	Status reservoir.TrackingStatus `json:"status"`
}

type ProvenanceArguments

type ProvenanceArguments struct {
	TxId  merkle.Digest `json:"txId"`
	Count int           `json:"count"`
}

type ProvenanceRecord

type ProvenanceRecord struct {
	Record  string      `json:"record"`
	IsOwner bool        `json:"isOwner"`
	TxId    interface{} `json:"txId,omitempty"`
	InBlock uint64      `json:"inBlock"`
	AssetId interface{} `json:"assetId,omitempty"`
	Data    interface{} `json:"data"`
}

can be any of the transaction records

type ProvenanceReply

type ProvenanceReply struct {
	Data []ProvenanceRecord `json:"data"`
}

type RPCConfiguration added in v0.6.5

type RPCConfiguration struct {
	MaximumConnections int      `libucl:"maximum_connections" json:"maximum_connections"`
	Bandwidth          float64  `libucl:"bandwidth" json:"bandwidth"`
	Listen             []string `libucl:"listen" json:"listen"`
	Certificate        string   `libucl:"certificate" json:"certificate"`
	PrivateKey         string   `libucl:"private_key" json:"private_key"`
	Announce           []string `libucl:"announce" json:"announce"`
}

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

Transaction is a rpc entry for transaction related functions

func (*Transaction) Status added in v0.3.30

func (t *Transaction) Status(arguments *TransactionArguments, reply *TransactionStatusReply) error

Status is an rpc api for query transaction status

type TransactionArguments added in v0.3.30

type TransactionArguments struct {
	TxId merkle.Digest `json:"txId"`
}

TransactionArguments is the arguments for statuc rpc request

type TransactionStatusReply added in v0.3.33

type TransactionStatusReply struct {
	Status string `json:"status"`
}

TransactionStatus is a struct for an rpc reply

type TxIdForBlockArguments added in v0.7.0

type TxIdForBlockArguments struct {
	BlockNumber uint64 `json:"blockNumber"`
}

type TxIdForBlockReply added in v0.7.0

type TxIdForBlockReply struct {
	TxId merkle.Digest `json:"txId"`
}

Jump to

Keyboard shortcuts

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