Documentation ¶
Overview ¶
Package rpc is a Tendermint RPC wrapper package to broadcast transaction and query ABCI query.
Simply create, sign and broadcast transaction via functions in tx.go
// Get KeyEntry key := keys.ImportKey(...) rpc.Transfer(0, "<TO ADDRESS>", "<AMOUNT>", key, fee, lastHeight) // Send AMO Coin rpc.Transfer(144, ...) // Send UDC 144 rpc.Stake("<VALIDATOR ADDRESS>", "<AMOUNT>", key, fee, lastHeight) rpc.Propose("<DRAFT ID>", "<CONFIG>", "<DESCRIPTION>")
Query AMO Blockchain ABCI query via functions in query.go Return types of ABCI Query are defined in https://github.com/amolabs/docs/blob/master/rpc.md
rpc.Balance(0, "<ADDRESS>") // Query AMO coin balance of address rpc.Balance(144, "<ADDRESS>") // Query UDC 144 balance of address rpc.Parcel("<PARCEL ID>") // Query parcel meta data
Index ¶
- Variables
- func ABCIQuery(path string, queryData interface{}) ([]byte, error)
- func QueryAppConfig() ([]byte, error)
- func QueryAppVersion() ([]byte, error)
- func QueryBalance(udc uint32, address string) ([]byte, error)
- func QueryDID(did string) ([]byte, error)
- func QueryDelegate(address string) ([]byte, error)
- func QueryDraft(draftID string) ([]byte, error)
- func QueryParcel(parcelID string) ([]byte, error)
- func QueryRequest(target, recipient string) ([]byte, error)
- func QueryStake(address string) ([]byte, error)
- func QueryStorage(storageID string) ([]byte, error)
- func QueryUDC(udcID string) ([]byte, error)
- func QueryUDCLock(udcID, address string) ([]byte, error)
- func QueryUsage(target, recipient string) ([]byte, error)
- func QueryVC(vcid string) ([]byte, error)
- func QueryVote(draftID, address string) ([]byte, error)
- type ABCIQueryParams
- type ABCIQueryResponse
- type BroadcastParams
- type TmQueryResult
- type TmStatusResult
- type TmTxResult
- func BroadcastTx(tx []byte) (TmTxResult, error)
- func Burn(udcID, amount string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Cancel(target, recipient string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Close(storageID string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func DIDClaim(target, docFile string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func DIDDismiss(target string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func DIDIssue(target, docFile string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func DIDRevoke(target string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Delegate(to, amount string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Discard(target string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Grant(target, recipient, custody, extra string, key keys.KeyEntry, ...) (TmTxResult, error)
- func Issue(udcID, amount string, desc string, operators []string, key keys.KeyEntry, ...) (TmTxResult, error)
- func Lock(udcID, holder, amount string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Propose(draftID, config, desc string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Register(target, custody, proxy, extra string, key keys.KeyEntry, ...) (TmTxResult, error)
- func Request(target, payment, recipient, dealer, dealerFee, extra string, key keys.KeyEntry, ...) (TmTxResult, error)
- func Retract(amount string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Revoke(target, recipient string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Setup(storageID, url, regFee, hostFee string, key keys.KeyEntry, ...) (TmTxResult, error)
- func SignSendTx(txType string, payload interface{}, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Stake(validator, amount string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Transfer(udc uint32, to, asset string, isParcel bool, key keys.KeyEntry, ...) (TmTxResult, error)
- func Vote(draftID string, approve bool, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- func Withdraw(amount string, key keys.KeyEntry, fee, lastHeight string) (TmTxResult, error)
- type TxSig
- type TxToSend
- type TxToSign
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RpcRemote = "http://0.0.0.0:26657" DryRun = false AddressByteSize = 20 TxBroadcastOption string )
Functions ¶
func QueryAppConfig ¶ added in v1.3.0
func QueryAppVersion ¶ added in v1.8.1
func QueryDelegate ¶
func QueryDraft ¶ added in v1.4.1
func QueryParcel ¶
func QueryRequest ¶
func QueryStake ¶
func QueryStorage ¶ added in v1.4.1
func QueryUDCLock ¶ added in v1.4.2
func QueryUsage ¶
Types ¶
type ABCIQueryParams ¶
type ABCIQueryResponse ¶
type BroadcastParams ¶
type BroadcastParams struct {
Tx []byte `json:"tx"`
}
type TmQueryResult ¶
type TmQueryResult struct {
Response ABCIQueryResponse `json:"response"`
}
XXX: Weired, but tendermint does this anyway
type TmStatusResult ¶
type TmStatusResult struct { NodeInfo json.RawMessage `json:"node_info"` SyncInfo json.RawMessage `json:"sync_info"` ValidatorInfo json.RawMessage `json:"validator_info"` }
func NodeStatus ¶
func NodeStatus() (TmStatusResult, error)
type TmTxResult ¶
type TmTxResult struct { CheckTx struct { Code int64 `json:"code,omitempty"` Info string `json:"info,omitempty"` } `json:"check_tx"` DeliverTx struct { Code int64 `json:"code,omitempty"` Info string `json:"info,omitempty"` } `json:"deliver_tx"` Hash string `json:"hash"` Height string `json:"height"` // number as a string }
func BroadcastTx ¶
func BroadcastTx(tx []byte) (TmTxResult, error)
func DIDDismiss ¶ added in v1.9.0
func SignSendTx ¶
Click to show internal directories.
Click to hide internal directories.