Documentation ¶
Index ¶
- Constants
- type AccountInfo
- type Client
- type ClientAgent
- func (c *ClientAgent) GetAccountBalance(address types.Address) (balance uint64, err error)
- func (c *ClientAgent) GetAccountInfo(address types.Address) (acc AccountInfo, err error)
- func (c *ClientAgent) GetAccountNonce(address types.Address) (nonce uint64, err error)
- func (c *ClientAgent) GetMiningStats() (st MiningStats, err error)
- func (c *ClientAgent) GetNodeInfo() (info NodeInfo, err error)
- func (c *ClientAgent) GetNodeStatus() (st NodeStatus, err error)
- func (c *ClientAgent) GetTransactionInfo(txid types.TransactionID) (info TransactionInfo, err error)
- func (c *ClientAgent) GetTxList(address types.Address, startLayer uint64) (txs []types.TransactionID, err error)
- func (c *ClientAgent) LuckyAccountInfo(address types.Address) (acc AccountInfo)
- func (c *ClientAgent) LuckyCoinbase(address types.Address)
- func (c *ClientAgent) LuckyMiningStats() (st MiningStats)
- func (c *ClientAgent) LuckyNodeInfo() (info NodeInfo)
- func (c *ClientAgent) LuckyNodeStatus() (st NodeStatus)
- func (c *ClientAgent) LuckyTransactionInfo(txid types.TransactionID) (info TransactionInfo)
- func (c *ClientAgent) LuckyTransfer(amount uint64, from types.Address, nonce uint64, key ed25519.PrivateKey, ...) types.TransactionID
- func (c *ClientAgent) LuckyTxList(address types.Address, startLayer uint64) (txs []types.TransactionID)
- func (c *ClientAgent) SetCoinbase(address types.Address) (err error)
- func (c *ClientAgent) Transfer(amount uint64, from types.Address, nonce uint64, key ed25519.PrivateKey, ...) (txid types.TransactionID, err error)
- type MiningStats
- type MiningStatus
- type NodeInfo
- type NodeStatus
- type TransactionInfo
- type TxStatus
Constants ¶
const DefaultEndpoint = "localhost:9090"
const DefaultFee = 10
DefaultFee for transfer in the Spacemesh network
const DefaultGasLimit = 100
DefaultGasLimit for tranfer in the Spacemesh network
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶
AccountInfo describes account sate
type ClientAgent ¶
type ClientAgent struct {
// contains filtered or unexported fields
}
func (*ClientAgent) GetAccountBalance ¶
func (c *ClientAgent) GetAccountBalance(address types.Address) (balance uint64, err error)
GetAccountBalance returns account balance
func (*ClientAgent) GetAccountInfo ¶
func (c *ClientAgent) GetAccountInfo(address types.Address) (acc AccountInfo, err error)
GetAccountInfo returns account state information
func (*ClientAgent) GetAccountNonce ¶
func (c *ClientAgent) GetAccountNonce(address types.Address) (nonce uint64, err error)
GetAccountNonce returns account nonce
func (*ClientAgent) GetMiningStats ¶
func (c *ClientAgent) GetMiningStats() (st MiningStats, err error)
GetMiningStats calls to node for the mining stats
func (*ClientAgent) GetNodeInfo ¶
func (c *ClientAgent) GetNodeInfo() (info NodeInfo, err error)
GetNodeInfo calls to node for the integral node information
func (*ClientAgent) GetNodeStatus ¶
func (c *ClientAgent) GetNodeStatus() (st NodeStatus, err error)
GetNodeStatus calls to node for the node status
func (*ClientAgent) GetTransactionInfo ¶
func (c *ClientAgent) GetTransactionInfo(txid types.TransactionID) (info TransactionInfo, err error)
GetTransactionInfo returns whole transaction information by transaction id
func (*ClientAgent) GetTxList ¶
func (c *ClientAgent) GetTxList(address types.Address, startLayer uint64) (txs []types.TransactionID, err error)
GetTxList lists network transfers from/to specified account
func (*ClientAgent) LuckyAccountInfo ¶
func (c *ClientAgent) LuckyAccountInfo(address types.Address) (acc AccountInfo)
LuckyAccountInfo returns account state information. It panics if error occurred
func (*ClientAgent) LuckyCoinbase ¶
func (c *ClientAgent) LuckyCoinbase(address types.Address)
LuckyCoinbase sets coinbase address. It panics on error
func (*ClientAgent) LuckyMiningStats ¶
func (c *ClientAgent) LuckyMiningStats() (st MiningStats)
LuckyMiningStats calls to node for the mining stats. It panics on error
func (*ClientAgent) LuckyNodeInfo ¶
func (c *ClientAgent) LuckyNodeInfo() (info NodeInfo)
LuckyNodeInfo calls to node for the integral node information. It panics on error
func (*ClientAgent) LuckyNodeStatus ¶
func (c *ClientAgent) LuckyNodeStatus() (st NodeStatus)
LuckyNodeStatus calls to node for the node status. It panics on error
func (*ClientAgent) LuckyTransactionInfo ¶
func (c *ClientAgent) LuckyTransactionInfo(txid types.TransactionID) (info TransactionInfo)
LuckyTransactionInfo returns whole transaction information by transaction id. It panics on error
func (*ClientAgent) LuckyTransfer ¶
func (c *ClientAgent) LuckyTransfer( amount uint64, from types.Address, nonce uint64, key ed25519.PrivateKey, to types.Address, fee, gasLimit uint64) types.TransactionID
Transfer creates transaction and submits it to network. It panics on error
func (*ClientAgent) LuckyTxList ¶
func (c *ClientAgent) LuckyTxList(address types.Address, startLayer uint64) (txs []types.TransactionID)
LuckyTxList lists network transfers from/to specified account. It panics on error
func (*ClientAgent) SetCoinbase ¶
func (c *ClientAgent) SetCoinbase(address types.Address) (err error)
SetCoinbase sets coinbase address
func (*ClientAgent) Transfer ¶
func (c *ClientAgent) Transfer( amount uint64, from types.Address, nonce uint64, key ed25519.PrivateKey, to types.Address, fee, gasLimit uint64) (txid types.TransactionID, err error)
Transfer creates transaction and submits it to network
type MiningStats ¶
type MiningStats struct { Status MiningStatus `json:"status"` Coinbase types.Address `json:"-"` //SmeshingRemainingBytes int `json:"remainingBytes,string"` DataDir string `json:"dataDir"` }
MiningStats describes mining
type MiningStatus ¶
type MiningStatus int
MiningStatus is enumeration of smesher mining statuses
const ( MiningUnknown MiningStatus = iota MiningIdle MiningInProgress MiningDone )
func (MiningStatus) String ¶
func (st MiningStatus) String() string
type NodeInfo ¶
type NodeInfo struct { NodeStatus MiningStats }
NodeInfo is an integral node information
type NodeStatus ¶
type NodeStatus struct { Synced bool `json:"synced"` SyncedLayer uint64 `json:"syncedLayer,string"` CurrentLayer uint64 `json:"currentLayer,string"` //VerifiedLayer uint64 `json:"verifiedLayer,string"` Peers uint64 `json:"peers,string"` MinPeers uint64 `json:"minPeers,string"` MaxPeers uint64 `json:"maxPeers,string"` }
NodeStatus describes mesh node
type TransactionInfo ¶
type TransactionInfo struct { Id types.TransactionID From types.Address To types.Address Amount uint64 `json:"amount,string"` Fee uint64 `json:"fee,string"` Status TxStatus Timestamp time.Time LayerId uint64 `json:"layerId,string"` }
TransactionInfo contains whole transaction information