rpc

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: ISC Imports: 23 Imported by: 3

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

View Source
const MaximumGetSize = 100

limit the number of gets

Variables

This section is empty.

Functions

func Callback

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

listener callback

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"`
	AssetIndex interface{} `json:"index,omitempty"`
	Data       interface{} `json:"data"`
}

type AssetStatus added in v0.2.0

type AssetStatus struct {
	AssetIndex *transactionrecord.AssetIndex `json:"index"`
	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

func (bitmark *Bitmark) Transfer(arguments *transactionrecord.BitmarkTransfer, reply *BitmarkTransferReply) error

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 BitmarksIssueReply added in v0.2.0

type BitmarksIssueReply struct {
	Issues     []IssueStatus      `json:"issues"`
	PayId      pay.PayId          `json:"payId"`
	PayNonce   reservoir.PayNonce `json:"payNonce"`
	Difficulty string             `json:"difficulty"`
}

type BitmarksRecord added in v0.1.2

type BitmarksRecord struct {
	Record     string      `json:"record"`
	TxId       interface{} `json:"txId,omitempty"`
	AssetIndex interface{} `json:"index,omitempty"`
	Data       interface{} `json:"data"`
}

can be any of the transaction records

type ConnectorArguments added in v0.3.30

type ConnectorArguments struct{}

type ConnectorReply added in v0.3.30

type ConnectorReply struct {
	Clients []string
}

type Counters added in v0.3.5

type Counters struct {
	Pending  int   `json:"pending"`
	Verified int   `json:"verified"`
	Others   []int `json:"others"`
}

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"`
}

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"`
	TransactionCounters Counters `json:"transactionCounters"`
	Difficulty          float64  `json:"difficulty"`
	Version             string   `json:"version"`
	Uptime              string   `json:"uptime"`
}

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) Connectors added in v0.3.30

func (node *Node) Connectors(arguments *ConnectorArguments, reply *ConnectorReply) error

func (*Node) Info

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

func (*Node) List

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

func (*Node) Subscribers added in v0.3.30

func (node *Node) Subscribers(arguments *SubscriberArguments, reply *SubscriberReply) 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 []block.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"`
	AssetIndex interface{} `json:"index,omitempty"`
	Data       interface{} `json:"data"`
}

can be any of the transaction records

type ProvenanceReply

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

type ServerArgument

type ServerArgument struct {
	Log       *logger.L
	StartTime time.Time
	Version   string
}

the argument passed to the callback

type SubscriberArguments added in v0.3.30

type SubscriberArguments struct{}

type SubscriberReply added in v0.3.30

type SubscriberReply struct {
	Clients []string
}

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

Jump to

Keyboard shortcuts

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