Documentation
¶
Index ¶
- Constants
- func LoadEnv()
- func SetupLogging()
- func TestAddress() string
- func UrlPathEscape(s string) string
- type Account
- type AccountResponse
- type AccountResponseResult
- type Client
- func (ctx *Client) APIMutate(method string, endpoint string, payload []byte) ([]byte, error)
- func (ctx *Client) APIQuery(endpoint string) ([]byte, error)
- func (ctx *Client) Account() (*Account, error)
- func (ctx *Client) BroadcastTransaction(txn *TransactionBroadcastPayload, gasInfo *GasInfo) ([]byte, error)
- func (ctx *Client) Count() (int, error)
- func (ctx *Client) Create(key string, value string, gasInfo *GasInfo, leaseInfo *LeaseInfo) error
- func (ctx *Client) Debugf(msg string, v ...interface{})
- func (ctx *Client) Delete(key string, gasInfo *GasInfo) error
- func (ctx *Client) DeleteAll(gasInfo *GasInfo) error
- func (ctx *Client) Errorf(msg string, v ...interface{})
- func (ctx *Client) Fatalf(msg string, v ...interface{})
- func (ctx *Client) GetLease(key string) (int64, error)
- func (ctx *Client) GetNShortestLeases(n uint64) ([]*GetNShortestLeasesResponseResultKeyLease, error)
- func (ctx *Client) Has(key string) (bool, error)
- func (ctx *Client) Infof(msg string, v ...interface{})
- func (ctx *Client) KeyValues() ([]*KeyValue, error)
- func (ctx *Client) Keys() ([]string, error)
- func (ctx *Client) MultiUpdate(keyValues []*KeyValue, gasInfo *GasInfo) error
- func (ctx *Client) ProcessTransaction(txn *Transaction)
- func (ctx *Client) ProvenRead(key string) (string, error)
- func (ctx *Client) Read(key string) (string, error)
- func (ctx *Client) Rename(key string, newKey string, gasInfo *GasInfo) error
- func (ctx *Client) RenewAllLeases(gasInfo *GasInfo, leaseInfo *LeaseInfo) error
- func (ctx *Client) RenewLease(key string, gasInfo *GasInfo, leaseInfo *LeaseInfo) error
- func (ctx *Client) RenewLeaseAll(gasInfo *GasInfo, leaseInfo *LeaseInfo) error
- func (ctx *Client) SendTransaction(txn *Transaction) ([]byte, error)
- func (ctx *Client) SignTransaction(txn *TransactionBroadcastPayload) (string, error)
- func (ctx *Client) TxCount(gasInfo *GasInfo) (int, error)
- func (ctx *Client) TxGetLease(key string, gasInfo *GasInfo) (int64, error)
- func (ctx *Client) TxGetNShortestLeases(n uint64, gasInfo *GasInfo) ([]*GetNShortestLeasesResponseResultKeyLease, error)
- func (ctx *Client) TxHas(key string, gasInfo *GasInfo) (bool, error)
- func (ctx *Client) TxKeyValues(gasInfo *GasInfo) ([]*KeyValue, error)
- func (ctx *Client) TxKeys(gasInfo *GasInfo) ([]string, error)
- func (ctx *Client) TxRead(key string, gasInfo *GasInfo) (string, error)
- func (root *Client) UUID(uuid string) *Client
- func (ctx *Client) Update(key string, value string, gasInfo *GasInfo, leaseInfo *LeaseInfo) error
- func (ctx *Client) ValidateTransaction(txn *Transaction) (*TransactionBroadcastPayload, error)
- func (ctx *Client) Version() (string, error)
- func (ctx *Client) Warnf(msg string, v ...interface{})
- type Coin
- type CountResponse
- type CountResponseResult
- type ErrorResponse
- type GasInfo
- type GetLeaseResponse
- type GetLeaseResponseResult
- type GetNShortestLeasesResponse
- type GetNShortestLeasesResponseResult
- type GetNShortestLeasesResponseResultKeyLease
- type HasResponse
- type HasResponseResult
- type KeyLease
- type KeyValue
- type KeyValuesResponse
- type KeyValuesResponseResult
- type KeysResponse
- type KeysResponseResult
- type LeaseInfo
- type Options
- type ReadResponse
- type ReadResponseResult
- type Test
- type Transaction
- type TransactionBroadcastPayload
- type TransactionBroadcastPayloadSignPayload
- type TransactionBroadcastRequest
- type TransactionBroadcastResponse
- type TransactionFee
- type TransactionFeeAmount
- type TransactionMsg
- type TransactionMsgValue
- type TransactionSignature
- type TransactionSignaturePubKey
- type TransactionValidateRequest
- type TransactionValidateRequestBaseReq
- type TransactionValidateResponse
- type VersionResponse
- type VersionResponseApplicationVersion
Constants ¶
View Source
const ADDRESS_PREFIX string = "bluzelle"
View Source
const BLOCK_TIME_IN_SECONDS = 5
View Source
const BROADCAST_MAX_RETRIES = 10
View Source
const BROADCAST_RETRY_INTERVAL = time.Second
View Source
const DEFAULT_CHAIN_ID string = "bluzelle"
View Source
const DEFAULT_ENDPOINT string = "http://localhost:1317"
View Source
const HD_PATH string = "m/44'/118'/0'/0/0"
View Source
const INVALID_LEASE_TIME = "Invalid lease time"
View Source
const KEY_CANNOT_CONTAIN_A_SLASH string = "Key cannot contain a slash"
View Source
const KEY_IS_REQUIRED string = "Key is required"
View Source
const NEW_KEY_IS_REQUIRED string = "New Key is required"
View Source
const TOKEN_NAME = "ubnt"
View Source
const TX_COMMAND = "/txs"
View Source
const VALUE_IS_REQUIRED string = "Value is required"
Variables ¶
This section is empty.
Functions ¶
func SetupLogging ¶
func SetupLogging()
func TestAddress ¶
func TestAddress() string
func UrlPathEscape ¶
PathEscape escapes the string so it can be safely placed inside a URL path segment, replacing special characters (including /) with %XX sequences as needed.
Types ¶
type AccountResponse ¶
type AccountResponse struct {
Result *AccountResponseResult `json:"result"`
}
type AccountResponseResult ¶
type AccountResponseResult struct {
Value *Account `json:"value"`
}
type Client ¶
type Client struct { Address string // contains filtered or unexported fields }
func NewTestClient ¶
func (*Client) BroadcastTransaction ¶
func (ctx *Client) BroadcastTransaction(txn *TransactionBroadcastPayload, gasInfo *GasInfo) ([]byte, error)
func (*Client) GetNShortestLeases ¶
func (ctx *Client) GetNShortestLeases(n uint64) ([]*GetNShortestLeasesResponseResultKeyLease, error)
func (*Client) MultiUpdate ¶
func (*Client) ProcessTransaction ¶
func (ctx *Client) ProcessTransaction(txn *Transaction)
func (*Client) RenewAllLeases ¶
func (*Client) RenewLease ¶
func (*Client) RenewLeaseAll ¶
func (*Client) SendTransaction ¶
func (ctx *Client) SendTransaction(txn *Transaction) ([]byte, error)
func (*Client) SignTransaction ¶
func (ctx *Client) SignTransaction(txn *TransactionBroadcastPayload) (string, error)
func (*Client) TxGetLease ¶
func (*Client) TxGetNShortestLeases ¶
func (ctx *Client) TxGetNShortestLeases(n uint64, gasInfo *GasInfo) ([]*GetNShortestLeasesResponseResultKeyLease, error)
func (*Client) ValidateTransaction ¶
func (ctx *Client) ValidateTransaction(txn *Transaction) (*TransactionBroadcastPayload, error)
Get required min gas
type CountResponse ¶
type CountResponse struct {
Result *CountResponseResult `json:"result"`
}
type CountResponseResult ¶
type CountResponseResult struct {
Count string `json:"count"`
}
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
type GasInfo ¶
type GasInfo struct { MaxGas int `json:"max_gas"` MaxFee int `json:"max_fee"` GasPrice int `json:"gas_price"` }
func TestGasInfo ¶
func TestGasInfo() *GasInfo
type GetLeaseResponse ¶
type GetLeaseResponse struct {
Result *GetLeaseResponseResult `json:"result"`
}
type GetLeaseResponseResult ¶
type GetLeaseResponseResult struct {
Lease string `json:"lease"`
}
type GetNShortestLeasesResponse ¶
type GetNShortestLeasesResponse struct {
Result *GetNShortestLeasesResponseResult `json:"result"`
}
type GetNShortestLeasesResponseResult ¶
type GetNShortestLeasesResponseResult struct {
KeyLeases []*KeyLease `json:"keyleases"`
}
func (*GetNShortestLeasesResponseResult) GetHumanizedKeyLeases ¶
func (result *GetNShortestLeasesResponseResult) GetHumanizedKeyLeases() ([]*GetNShortestLeasesResponseResultKeyLease, error)
type HasResponse ¶
type HasResponse struct {
Result *HasResponseResult `json:"result"`
}
type HasResponseResult ¶
type HasResponseResult struct {
Has bool `json:"has"`
}
type KeyValuesResponse ¶
type KeyValuesResponse struct {
Result *KeyValuesResponseResult `json:"result"`
}
type KeyValuesResponseResult ¶
type KeyValuesResponseResult struct {
KeyValues []*KeyValue `json:"keyvalues"`
}
type KeysResponse ¶
type KeysResponse struct {
Result *KeysResponseResult `json:"result"`
}
type KeysResponseResult ¶
type KeysResponseResult struct {
Keys []string `json:"keys"`
}
type LeaseInfo ¶
type ReadResponse ¶
type ReadResponse struct {
Result *ReadResponseResult `json:"result"`
}
type ReadResponseResult ¶
type ReadResponseResult struct {
Value string `json:"value"`
}
type Test ¶
type Test struct { Client *Client Key1 string Key2 string Key3 string Value1 string Value2 string Value3 string }
func (*Test) TestTearDown ¶
type Transaction ¶
type TransactionBroadcastPayload ¶
type TransactionBroadcastPayload struct { Fee *TransactionFee `json:"fee"` Memo string `json:"memo"` Msg []*TransactionMsg `json:"msg"` Signatures []*TransactionSignature `json:"signatures"` }
type TransactionBroadcastPayloadSignPayload ¶
type TransactionBroadcastPayloadSignPayload struct { AccountNumber string `json:"account_number"` ChainId string `json:"chain_id"` Fee *TransactionFee `json:"fee"` Memo string `json:"memo"` Msgs []*TransactionMsg `json:"msgs"` Sequence string `json:"sequence"` }
type TransactionBroadcastRequest ¶
type TransactionBroadcastRequest struct { Transaction *TransactionBroadcastPayload `json:"tx"` Mode string `json:"mode"` }
type TransactionFee ¶
type TransactionFee struct { Amount []*TransactionFeeAmount `json:"amount"` Gas string `json:"gas"` }
type TransactionFeeAmount ¶
type TransactionMsg ¶
type TransactionMsg struct { Type string `json:"type"` Value *TransactionMsgValue `json:"value"` }
type TransactionMsgValue ¶
type TransactionMsgValue struct { Key string `json:"Key,omitempty"` KeyValues []*KeyValue `json:"KeyValues,omitempty"` Lease string `json:"Lease,omitempty"` N string `json:"N,omitempty"` NewKey string `json:"NewKey,omitempty"` Owner string `json:"Owner"` UUID string `json:"UUID"` Value string `json:"Value,omitempty"` }
type TransactionSignature ¶
type TransactionSignature struct { AccountNumber string `json:"account_number"` PubKey *TransactionSignaturePubKey `json:"pub_key"` Sequence string `json:"sequence"` Signature string `json:"signature"` }
type TransactionValidateRequest ¶
type TransactionValidateRequest struct { BaseReq *TransactionValidateRequestBaseReq `json:"BaseReq"` Key string `json:"Key,omitempty"` KeyValues []*KeyValue `json:"KeyValues,omitempty"` Lease string `json:"Lease,omitempty"` N string `json:"N,omitempty"` NewKey string `json:"NewKey,omitempty"` Owner string `json:"Owner"` UUID string `json:"UUID"` Value string `json:"Value,omitempty"` }
type TransactionValidateResponse ¶
type TransactionValidateResponse struct { Type string `json:"type"` Value *TransactionBroadcastPayload `json:"value"` }
type VersionResponse ¶
type VersionResponse struct {
ApplicationVersion *VersionResponseApplicationVersion `json:"application_version"`
}
type VersionResponseApplicationVersion ¶
type VersionResponseApplicationVersion struct {
Version string `json:"version"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.