Documentation
¶
Overview ¶
Package rpc - 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 ¶
- func Callback(conn io.ReadWriteCloser, argument interface{})
- func CertificateFingerprint(certificate []byte) [32]byte
- func Finalise() error
- func Initialise(rpcConfiguration *RPCConfiguration, httpsConfiguration *HTTPSConfiguration, ...) error
- func ListenAndServeTLSKeyPair(addr string, handler http.Handler, cfg *tls.Config) error
- type AssetGetArguments
- type AssetGetReply
- type AssetRecord
- type AssetStatus
- type Assets
- type AssetsRegisterReply
- type Bitmark
- type BitmarkTransferReply
- type Bitmarks
- type BitmarksRecord
- type BlockAsset
- type BlockInfo
- type BlockOwner
- type BlockOwnerTransferReply
- type Counters
- type CreateArguments
- type CreateReply
- type HTTPSConfiguration
- type InfoArguments
- type InfoReply
- type InternalConnection
- type IssueStatus
- type Node
- type NodeArguments
- type NodeReply
- type Owner
- type OwnerBitmarksArguments
- type OwnerBitmarksReply
- type ProofArguments
- type ProofReply
- type ProvenanceArguments
- type ProvenanceRecord
- type ProvenanceReply
- type RPCConfiguration
- type Share
- func (share *Share) Balance(arguments *ShareBalanceArguments, reply *ShareBalanceReply) error
- func (share *Share) Create(bmfr *transactionrecord.BitmarkShare, reply *ShareCreateReply) error
- func (share *Share) Grant(arguments *transactionrecord.ShareGrant, reply *ShareGrantReply) error
- func (share *Share) Swap(arguments *transactionrecord.ShareSwap, reply *ShareSwapReply) error
- type ShareBalanceArguments
- type ShareBalanceReply
- type ShareCreateReply
- type ShareGrantReply
- type ShareSwapReply
- type Transaction
- type TransactionArguments
- type TransactionStatusReply
- type TxIdForBlockArguments
- type TxIdForBlockReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Callback ¶
func Callback(conn io.ReadWriteCloser, argument interface{})
Callback - callback to process RPC requests
func CertificateFingerprint ¶ added in v0.6.5
CertificateFingerprint - compute the fingerprint of a certificate
FreeBSD: openssl x509 -outform DER -in bitmarkd-local-rpc.crt | sha3sum -a 256
func Initialise ¶ added in v0.6.5
func Initialise(rpcConfiguration *RPCConfiguration, httpsConfiguration *HTTPSConfiguration, version string) error
Initialise - setup peer background processes
Types ¶
type AssetGetArguments ¶
type AssetGetArguments struct {
Fingerprints []string `json:"fingerprints"`
}
AssetGetArguments - arguments for RPC request
type AssetGetReply ¶
type AssetGetReply struct {
Assets []AssetRecord `json:"assets"`
}
AssetGetReply - results from get RPC request
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"` }
AssetRecord - structure of asset records in the response
type AssetStatus ¶ added in v0.2.0
type AssetStatus struct { AssetId *transactionrecord.AssetIdentifier `json:"id"` Duplicate bool `json:"duplicate"` }
AssetStatus - arguments for RPC request
type Assets ¶
type Assets struct {
// contains filtered or unexported fields
}
Assets - type for the RPC
func (*Assets) Get ¶
func (assets *Assets) Get(arguments *AssetGetArguments, reply *AssetGetReply) error
Get - RPC to fetch asset data
type AssetsRegisterReply ¶ added in v0.2.0
type AssetsRegisterReply struct {
Assets []AssetStatus `json:"assets"`
}
AssetsRegisterReply - results from RPC request
type Bitmark ¶
type Bitmark struct {
// contains filtered or unexported fields
}
Bitmark - type for the RPC
func (*Bitmark) Provenance ¶
func (bitmark *Bitmark) Provenance(arguments *ProvenanceArguments, reply *ProvenanceReply) error
Provenance - list the provenance from s transaction id
func (*Bitmark) Transfer ¶
func (bitmark *Bitmark) Transfer(arguments *transactionrecord.BitmarkTransferCountersigned, reply *BitmarkTransferReply) error
Transfer - transfer a bitmark
type BitmarkTransferReply ¶
type BitmarkTransferReply struct { TxId merkle.Digest `json:"txId"` BitmarkId merkle.Digest `json:"bitmarkId"` PayId pay.PayId `json:"payId"` Payments map[string]transactionrecord.PaymentAlternative `json:"payments"` }
BitmarkTransferReply - result from transfer RPC
type Bitmarks ¶
type Bitmarks struct {
// contains filtered or unexported fields
}
Bitmarks - type for the RPC
func (*Bitmarks) Create ¶ added in v0.2.6
func (bitmarks *Bitmarks) Create(arguments *CreateArguments, reply *CreateReply) error
Create - create assets and issues
func (*Bitmarks) Proof ¶ added in v0.2.0
func (bitmarks *Bitmarks) Proof(arguments *ProofArguments, reply *ProofReply) error
Proof - supply proof that client-side hashing to confirm free issue was done
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"` }
BitmarksRecord - can be any of the transaction records
type BlockAsset ¶ added in v0.7.0
type BlockAsset struct {
Number uint64 `json:"number"`
}
BlockAsset - special record for owned blocks
type BlockOwner ¶ added in v0.7.0
type BlockOwner struct {
// contains filtered or unexported fields
}
BlockOwner - the type of the RPC
func (*BlockOwner) Transfer ¶ added in v0.7.0
func (bitmark *BlockOwner) Transfer(transfer *transactionrecord.BlockOwnerTransfer, reply *BlockOwnerTransferReply) error
Transfer - transfer the ownership of a block to new account and/or payment addresses
func (*BlockOwner) TxIdForBlock ¶ added in v0.7.0
func (bitmark *BlockOwner) TxIdForBlock(info *TxIdForBlockArguments, reply *TxIdForBlockReply) error
TxIdForBlock - RPC to get transaction id for block ownership record
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"` }
BlockOwnerTransferReply - results of transferring block ownership
type CreateArguments ¶ added in v0.2.6
type CreateArguments struct { Assets []*transactionrecord.AssetData `json:"assets"` Issues []*transactionrecord.BitmarkIssue `json:"issues"` }
CreateArguments - arguments for creating a bitmark
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,omitempty"` Payments map[string]transactionrecord.PaymentAlternative `json:"payments,omitempty"` }
CreateReply - results from create RPC
type HTTPSConfiguration ¶ added in v0.6.5
type HTTPSConfiguration struct { MaximumConnections int `gluamapper:"maximum_connections" json:"maximum_connections"` Listen []string `gluamapper:"listen" json:"listen"` Certificate string `gluamapper:"certificate" json:"certificate"` PrivateKey string `gluamapper:"private_key" json:"private_key"` Allow map[string][]string `gluamapper:"allow" json:"allow"` }
HTTPSConfiguration - configuration file data for HTTPS setup
type InfoReply ¶
type InfoReply struct { Chain string `json:"chain"` Mode string `json:"mode"` Block BlockInfo `json:"block"` RPCs uint64 `json:"rpcs"` Peers uint64 `json:"peers"` TransactionCounters Counters `json:"transactionCounters"` Difficulty float64 `json:"difficulty"` Hashrate float64 `json:"hashrate,omitempty"` Version string `json:"version"` Uptime string `json:"uptime"` PublicKey string `json:"publicKey"` }
InfoReply - results from info request
type InternalConnection ¶ added in v0.6.5
type InternalConnection struct {
// contains filtered or unexported fields
}
InternalConnection - type to allow rpc system to interface to http request
func (*InternalConnection) Close ¶ added in v0.6.5
func (c *InternalConnection) Close() error
type IssueStatus ¶ added in v0.2.5
IssueStatus - results from an issue
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node - type for RPC calls
type NodeArguments ¶
NodeArguments - arguments for RPC
type NodeReply ¶
type NodeReply struct { Nodes []announce.RPCEntry `json:"nodes"` NextStart uint64 `json:"nextStart,string"` }
NodeReply - result from RPC
type Owner ¶ added in v0.1.2
type Owner struct {
// contains filtered or unexported fields
}
Owner - type for the RPC
func (*Owner) Bitmarks ¶ added in v0.1.2
func (owner *Owner) Bitmarks(arguments *OwnerBitmarksArguments, reply *OwnerBitmarksReply) error
Bitmarks - list bitmarks belonging to an account
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 }
OwnerBitmarksArguments - arguments for RPC
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 }
OwnerBitmarksReply - result of owner RPC
type ProofArguments ¶ added in v0.2.0
ProofArguments - arguments for RPC
type ProofReply ¶ added in v0.2.0
type ProofReply struct {
Status reservoir.TrackingStatus `json:"status"`
}
ProofReply - results from a proof RPC
type ProvenanceArguments ¶
ProvenanceArguments - arguments for provenance RPC
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"` }
ProvenanceRecord - can be any of the transaction records
type ProvenanceReply ¶
type ProvenanceReply struct {
Data []ProvenanceRecord `json:"data"`
}
ProvenanceReply - results from provenance RPC
type RPCConfiguration ¶ added in v0.6.5
type RPCConfiguration struct { MaximumConnections int `gluamapper:"maximum_connections" json:"maximum_connections"` Bandwidth float64 `gluamapper:"bandwidth" json:"bandwidth"` Listen []string `gluamapper:"listen" json:"listen"` Certificate string `gluamapper:"certificate" json:"certificate"` PrivateKey string `gluamapper:"private_key" json:"private_key"` Announce []string `gluamapper:"announce" json:"announce"` }
RPCConfiguration - configuration file data for RPC setup
type Share ¶ added in v0.10.0
type Share struct {
// contains filtered or unexported fields
}
Share - type for RPC
func (*Share) Balance ¶ added in v0.10.0
func (share *Share) Balance(arguments *ShareBalanceArguments, reply *ShareBalanceReply) error
Balance - list balances for an account
func (*Share) Create ¶ added in v0.10.0
func (share *Share) Create(bmfr *transactionrecord.BitmarkShare, reply *ShareCreateReply) error
Create - create fractional bitmark
func (*Share) Grant ¶ added in v0.10.0
func (share *Share) Grant(arguments *transactionrecord.ShareGrant, reply *ShareGrantReply) error
Grant - grant a number of shares to another account
func (*Share) Swap ¶ added in v0.10.0
func (share *Share) Swap(arguments *transactionrecord.ShareSwap, reply *ShareSwapReply) error
Swap - atomically swap shares between accounts
type ShareBalanceArguments ¶ added in v0.10.0
type ShareBalanceArguments struct {}
ShareBalanceArguments - arguments for RPC
type ShareBalanceReply ¶ added in v0.10.0
type ShareBalanceReply struct {
}ShareBalanceReply - balances of shares belonging to an account
type ShareCreateReply ¶ added in v0.10.0
type ShareCreateReply struct {}
ShareCreateReply - results from creating a share
type ShareGrantReply ¶ added in v0.10.0
type ShareGrantReply struct {}
ShareGrantReply - result of granting some shares to another account
type ShareSwapReply ¶ added in v0.10.0
type ShareSwapReply struct {}
ShareSwapReply - result of a share swap
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction - an RPC entry for transaction related functions
func (*Transaction) Status ¶ added in v0.3.30
func (t *Transaction) Status(arguments *TransactionArguments, reply *TransactionStatusReply) error
Status - query transaction status
type TransactionArguments ¶ added in v0.3.30
TransactionArguments - arguments for status RPC request
type TransactionStatusReply ¶ added in v0.3.33
type TransactionStatusReply struct {
Status string `json:"status"`
}
TransactionStatusReply - results from status RPC
type TxIdForBlockArguments ¶ added in v0.7.0
type TxIdForBlockArguments struct {
BlockNumber uint64 `json:"blockNumber"`
}
TxIdForBlockArguments - get the id for a given block number
type TxIdForBlockReply ¶ added in v0.7.0
TxIdForBlockReply - results for block id