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 ¶
- 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 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 CertificateFingerprint ¶ added in v0.6.5
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 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 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 ¶
func (bitmark *Bitmark) Transfer(arguments *transactionrecord.BitmarkTransferCountersigned, reply *BitmarkTransferReply) error
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"` }
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 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,omitempty"` Payments map[string]transactionrecord.PaymentAlternative `json:"payments,omitempty"` }
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"` }
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
type IssueStatus ¶ added in v0.2.5
type NodeArguments ¶
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 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 ProofReply ¶ added in v0.2.0
type ProofReply struct {
Status reservoir.TrackingStatus `json:"status"`
}
type ProvenanceArguments ¶
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 `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"` }
type Share ¶ added in v0.10.0
type Share struct {
// contains filtered or unexported fields
}
func (*Share) Balance ¶ added in v0.10.0
func (share *Share) Balance(arguments *ShareBalanceArguments, reply *ShareBalanceReply) error
func (*Share) Create ¶ added in v0.10.0
func (share *Share) Create(bmfr *transactionrecord.BitmarkShare, reply *ShareCreateReply) error
func (*Share) Grant ¶ added in v0.10.0
func (share *Share) Grant(arguments *transactionrecord.ShareGrant, reply *ShareGrantReply) error
func (*Share) Swap ¶ added in v0.10.0
func (share *Share) Swap(arguments *transactionrecord.ShareSwap, reply *ShareSwapReply) error
type ShareBalanceArguments ¶ added in v0.10.0
type ShareBalanceArguments struct {}
type ShareBalanceReply ¶ added in v0.10.0
type ShareBalanceReply struct {
}type ShareCreateReply ¶ added in v0.10.0
type ShareCreateReply struct {}
type ShareGrantReply ¶ added in v0.10.0
type ShareGrantReply struct {}
type ShareSwapReply ¶ added in v0.10.0
type ShareSwapReply struct {}
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
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"`
}