Documentation ¶
Overview ¶
Package cli provides client command line window
Index ¶
- Constants
- Variables
- func ClearBlock() error
- func ConsoleInit(keystore, url string, show bool, rpchost string, rpcport int) error
- func ShowPubKeyInfo(info model.SelfMinerDO, id string)
- func ShowVersionInfo()
- func Usage()
- type Account
- type AccountInfo
- type AccountManager
- func (am *AccountManager) AccountInfo() (*Account, error)
- func (am *AccountManager) AccountList() ([]string, error)
- func (am *AccountManager) Close()
- func (am *AccountManager) DeleteAccount() (string, error)
- func (am *AccountManager) ExportKey(addr string) (string, error)
- func (am *AccountManager) Lock(addr string) error
- func (am *AccountManager) NewAccount(password string, miner bool) (string, error)
- func (am *AccountManager) NewAccountByImportKey(key string, password string, miner bool) (string, error)
- func (am *AccountManager) UnLock(addr string, password string, duration uint) error
- type BasicInfo
- type Block
- type BlockDetail
- type BlockReceipt
- type CastStat
- type ConnInfo
- type CurrentEraGroupInfo
- type Dashboard
- type ErrorResult
- type ExecutedTransaction
- type ExploreBlockReward
- type ExploreCandidateList
- type ExplorerAccount
- type ExplorerBlockDetail
- type Group
- type GroupCheckInfo
- type GroupStat
- type Gzv
- type JoinedGroupInfo
- type KeyStoreRaw
- type MinerInfo
- type MinerPoolDetail
- type MinerRaw
- type MinerRewardBalance
- type MinerStakeDetails
- type MortGage
- type NodeInfo
- type PageObjects
- type ProposerStat
- type PubKeyInfo
- type RPCReqObj
- type RPCResObj
- type RPCResObjCmd
- type RawMessage
- type Receipt
- type RemoteChainOpImpl
- func (ca *RemoteChainOpImpl) ApplyGuardMiner(gas, gasprice uint64) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) Balance(addr string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) BlockByHash(hash string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) BlockByHeight(h uint64) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) BlockHeight() *RPCResObjCmd
- func (ca *RemoteChainOpImpl) ChangeFundGuardMode(mode int, gas, gasprice uint64) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) Connect(url string) error
- func (ca *RemoteChainOpImpl) Endpoint() string
- func (ca *RemoteChainOpImpl) GroupCheck(addr string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) GroupHeight() *RPCResObjCmd
- func (ca *RemoteChainOpImpl) MinerAbort(mtype int, gas, gasprice uint64, force bool) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) MinerInfo(addr string, detail string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) MinerPoolInfo(addr string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) Nonce(addr string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) QueryFundGuardMode(addr string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) SendRaw(tx *TxRawData) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) StakeAdd(target string, mType int, stake uint64, gas, gasPrice uint64) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) StakeReduce(target string, mType int, value, gas, gasPrice uint64) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) StakeRefund(target string, mType int, gas, gasPrice uint64) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) TicketsInfo(addr string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) TxInfo(hash string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) TxReceipt(hash string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) ViewContract(addr string) *RPCResObjCmd
- func (ca *RemoteChainOpImpl) VoteMinerPool(target string, gas, gasprice uint64) *RPCResObjCmd
- type RespMortMsg
- type RespMsg
- type RewardTransaction
- type RpcDevImpl
- func (api *RpcDevImpl) BalanceByHeight(height uint64, account string) (float64, error)
- func (api *RpcDevImpl) BlockDetail(h string) (*BlockDetail, error)
- func (api *RpcDevImpl) BlockDropInfo(b, e uint64) (map[string]interface{}, error)
- func (api *RpcDevImpl) BlockReceipts(h string) (*BlockReceipt, error)
- func (api *RpcDevImpl) CastStat(begin uint64, end uint64) (map[string]map[string]int32, error)
- func (api *RpcDevImpl) ConnectedNodes() ([]ConnInfo, error)
- func (api *RpcDevImpl) Dashboard() (*Dashboard, error)
- func (api *RpcDevImpl) DebugGetRawTx(hash string) (*Transaction, error)
- func (api *RpcDevImpl) DebugGetRewardTxs(limit int) ([]*rewardTxHash, error)
- func (api *RpcDevImpl) DebugGetTxs(limit int) ([]string, error)
- func (api *RpcDevImpl) GetBlocks(from uint64, end uint64) ([]*Block, error)
- func (api *RpcDevImpl) GetCurrentWorkGroup() ([]*Group, error)
- func (api *RpcDevImpl) GetGroupsAfter(height uint64) ([]*Group, error)
- func (api *RpcDevImpl) GetLivedGroup(height uint64) ([]*Group, error)
- func (api *RpcDevImpl) GetTopBlock() (map[string]interface{}, error)
- func (api *RpcDevImpl) GetTransaction(hash string) (map[string]interface{}, error)
- func (api *RpcDevImpl) GetWorkGroup(height uint64) ([]*Group, error)
- func (api *RpcDevImpl) JumpBlockInfo(begin, end uint64) (map[string][2]int, error)
- func (api *RpcDevImpl) MonitorAllMiners() (map[string]interface{}, error)
- func (api *RpcDevImpl) MonitorBlocks(begin, end uint64) ([]*BlockDetail, error)
- func (api *RpcDevImpl) MonitorNodeInfo() (*NodeInfo, error)
- func (api *RpcDevImpl) Namespace() string
- func (api *RpcDevImpl) NodeInfo() (*NodeInfo, error)
- func (api *RpcDevImpl) ProposalTotalStake(height uint64) (uint64, error)
- func (api *RpcDevImpl) ScriptTransferTx(privateKey string, from string, to string, amount uint64, nonce uint64, ...) (string, error)
- func (api *RpcDevImpl) TransPool() ([]*types.Transaction, error)
- func (api *RpcDevImpl) TxUnSafe(privateKey, target string, value, gas, gasprice, nonce uint64, txType int, ...) (string, error)
- func (api *RpcDevImpl) Version() string
- func (api *RpcDevImpl) WorkGroupNum() (int, error)
- type RpcExplorerImpl
- func (api *RpcExplorerImpl) ExplorerAccount(hash string) (*ExplorerAccount, error)
- func (api *RpcExplorerImpl) ExplorerBlockDetail(height uint64) (*ExplorerBlockDetail, error)
- func (api *RpcExplorerImpl) ExplorerBlockReward(height uint64) (*ExploreBlockReward, error)
- func (api *RpcExplorerImpl) ExplorerGetCandidates() (*[]ExploreCandidateList, error)
- func (api *RpcExplorerImpl) ExplorerGroupsAfter(height uint64) ([]*Group, error)
- func (api *RpcExplorerImpl) Namespace() string
- func (api *RpcExplorerImpl) Version() string
- type RpcGzvImpl
- func (api *RpcGzvImpl) Balance(account string) (float64, error)
- func (api *RpcGzvImpl) BlockHeight() (uint64, error)
- func (api *RpcGzvImpl) CheckPointAt(h uint64) (*types.BlockHeader, error)
- func (api *RpcGzvImpl) GetBlockByHash(hash string) (*Block, error)
- func (api *RpcGzvImpl) GetBlockByHeight(height uint64) (*Block, error)
- func (api *RpcGzvImpl) GetTxsByBlockHash(hash string) ([]string, error)
- func (api *RpcGzvImpl) GetTxsByBlockHeight(height uint64) ([]string, error)
- func (api *RpcGzvImpl) GroupCheck(addr string) (*GroupCheckInfo, error)
- func (api *RpcGzvImpl) GroupHeight() (uint64, error)
- func (api *RpcGzvImpl) Guardmode(addr string) (string, error)
- func (api *RpcGzvImpl) LatestCheckPoint() (*types.BlockHeader, error)
- func (api *RpcGzvImpl) MinerInfo(addr string, detail string) (*MinerStakeDetails, error)
- func (api *RpcGzvImpl) MinerPoolInfo(addr string, height uint64) (*MinerPoolDetail, error)
- func (api *RpcGzvImpl) Namespace() string
- func (api *RpcGzvImpl) Nonce(addr string) (uint64, error)
- func (api *RpcGzvImpl) QueryAccountData(addr string, key string, count int) (interface{}, error)
- func (api *RpcGzvImpl) TransDetail(h string) (*Transaction, error)
- func (api *RpcGzvImpl) Tx(txRaw *TxRawData) (string, error)
- func (api *RpcGzvImpl) TxReceipt(h string) (*ExecutedTransaction, error)
- func (api *RpcGzvImpl) Version() string
- func (api *RpcGzvImpl) ViewAccount(hash string) (*ExplorerAccount, error)
- type RpcMinerImpl
- type StakeDetail
- type Transaction
- type Transactions
- type TxRawData
- type WalletServer
- func (ws *WalletServer) GenHash(txRaw *TxRawData) (string, error)
- func (ws *WalletServer) SignData(signer string, data []byte, unlockPassword string) (string, error)
- func (ws *WalletServer) SignTransaction(txRaw *TxRawData, unlockPassword string) (string, error)
- func (ws *WalletServer) Start() error
Constants ¶
const (
// Section is default section configuration
Section = "gzv"
)
Variables ¶
Functions ¶
func ConsoleInit ¶
func ShowPubKeyInfo ¶
func ShowPubKeyInfo(info model.SelfMinerDO, id string)
func ShowVersionInfo ¶
func ShowVersionInfo()
Types ¶
type AccountManager ¶
type AccountManager struct {
// contains filtered or unexported fields
}
func (*AccountManager) AccountInfo ¶
func (am *AccountManager) AccountInfo() (*Account, error)
AccountInfo show account info
func (*AccountManager) AccountList ¶
func (am *AccountManager) AccountList() ([]string, error)
AccountList show account list
func (*AccountManager) Close ¶
func (am *AccountManager) Close()
func (*AccountManager) DeleteAccount ¶
func (am *AccountManager) DeleteAccount() (string, error)
DeleteAccount delete current unlocked account
func (*AccountManager) ExportKey ¶
func (am *AccountManager) ExportKey(addr string) (string, error)
ExportKey exports the private key of account
func (*AccountManager) Lock ¶
func (am *AccountManager) Lock(addr string) error
Lock lock the account by address
func (*AccountManager) NewAccount ¶
func (am *AccountManager) NewAccount(password string, miner bool) (string, error)
NewAccount create a new account by password
func (*AccountManager) NewAccountByImportKey ¶
func (am *AccountManager) NewAccountByImportKey(key string, password string, miner bool) (string, error)
NewAccountByImportKey create a new account by the input private key
type Block ¶
type Block struct { Height uint64 `json:"height"` Hash common.Hash `json:"hash"` PreHash common.Hash `json:"pre_hash"` CurTime time.Time `json:"cur_time"` PreTime time.Time `json:"pre_time"` Castor groupsig.ID `json:"castor"` Group common.Hash `json:"group_id"` Prove string `json:"prove"` TotalQN uint64 `json:"total_qn"` Qn uint64 `json:"qn"` TxNum uint64 `json:"txs"` StateRoot common.Hash `json:"state_root"` TxRoot common.Hash `json:"tx_root"` ReceiptRoot common.Hash `json:"receipt_root"` ProveRoot common.Hash `json:"prove_root"` Random string `json:"random"` }
type BlockDetail ¶
type BlockDetail struct { Block GenRewardTx *RewardTransaction `json:"gen_reward_tx"` Trans []Transaction `json:"trans"` BodyRewardTxs []RewardTransaction `json:"body_reward_txs"` MinerReward []*MinerRewardBalance `json:"miner_reward"` PreTotalQN uint64 `json:"pre_total_qn"` }
type BlockReceipt ¶
type CastStat ¶
type CastStat struct { Group map[string]GroupStat `json:"group"` Proposer map[string]ProposerStat `json:"proposer"` }
type CurrentEraGroupInfo ¶
type ErrorResult ¶
ErrorResult is rpc request error returned variable parameter
type ExecutedTransaction ¶
type ExecutedTransaction struct { Receipt *Receipt Transaction *Transaction }
type ExploreBlockReward ¶
type ExploreBlockReward struct { ProposalID string `json:"proposal_id"` ProposalReward uint64 `json:"proposal_reward"` ProposalGasFeeReward uint64 `json:"proposal_gas_fee_reward"` VerifierReward RewardTransaction `json:"verifier_reward"` VerifierGasFeeReward uint64 `json:"verifier_gas_fee_reward"` }
type ExploreCandidateList ¶
type ExplorerAccount ¶
type ExplorerBlockDetail ¶
type ExplorerBlockDetail struct { BlockDetail Receipts []*types.Receipt `json:"receipts"` EvictedReceipts []*types.Receipt `json:"evictedReceipts"` }
type GroupCheckInfo ¶
type GroupCheckInfo struct { JoinedGroups []*JoinedGroupInfo `json:"joined_living_groups"` CurrentGroupRoutine *CurrentEraGroupInfo `json:"current_group_routine"` }
type JoinedGroupInfo ¶
type KeyStoreRaw ¶
type MinerPoolDetail ¶
type MinerRewardBalance ¶
type MinerRewardBalance struct { ID groupsig.ID `json:"id"` Proposal bool `json:"proposal"` // Is there a proposal PackRewardTx int `json:"pack_reward_tx"` // The counts of packed reward transaction VerifyBlock int `json:"verify_block"` // Number of blocks verified PreBalance *big.Int `json:"pre_balance"` CurrBalance *big.Int `json:"curr_balance"` ExpectBalance *big.Int `json:"expect_balance"` Explain string `json:"explain"` }
type MinerStakeDetails ¶
type MinerStakeDetails struct { Overview []*MortGage `json:"overview,omitempty"` Details map[string][]*StakeDetail `json:"details,omitempty"` }
type MortGage ¶
type MortGage struct { Stake uint64 `json:"stake"` ApplyHeight uint64 `json:"apply_height"` Type string `json:"type"` Status string `json:"miner_status"` StatusUpdateHeight uint64 `json:"status_update_height"` Identity string `json:"identity"` IdentityUpdateHeight uint64 `json:"identity_update_height"` }
func NewMortGageFromMiner ¶
type NodeInfo ¶
type NodeInfo struct { ID string `json:"id"` Balance float64 `json:"balance"` Status string `json:"status"` WGroupNum int `json:"w_group_num"` AGroupNum int `json:"a_group_num"` NType string `json:"n_type"` TxPoolNum int `json:"tx_pool_num"` BlockHeight uint64 `json:"block_height"` GroupHeight uint64 `json:"group_height"` MortGages []MortGage `json:"mort_gages"` VrfThreshold float64 `json:"vrf_threshold"` }
type PageObjects ¶
type PageObjects struct { Total uint64 `json:"count"` Data []interface{} `json:"data"` }
type ProposerStat ¶
type PubKeyInfo ¶
type RPCReqObj ¶
type RPCReqObj struct { Method string `json:"method"` Params []interface{} `json:"params"` Jsonrpc string `json:"jsonrpc"` ID uint `json:"id"` }
RPCReqObj is complete rpc request body
type RPCResObj ¶
type RPCResObj struct { Jsonrpc string `json:"jsonrpc"` ID uint `json:"id"` Result RawMessage `json:"result,omitempty"` Error *ErrorResult `json:"error,omitempty"` }
RPCResObj is complete rpc response body
type RPCResObjCmd ¶
type RPCResObjCmd struct { Result RawMessage `json:"result,omitempty"` Error *ErrorResult `json:"error,omitempty"` }
type RawMessage ¶
type RawMessage []byte
RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
func (RawMessage) MarshalJSON ¶
func (m RawMessage) MarshalJSON() ([]byte, error)
MarshalJSON returns m as the JSON encoding of m.
func (*RawMessage) UnmarshalJSON ¶
func (m *RawMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON sets *m to a copy of data.
type Receipt ¶
type Receipt struct { Status int `json:"status"` CumulativeGasUsed uint64 `json:"cumulativeGasUsed"` Logs []*types.Log `json:"logs"` TxHash common.Hash `json:"transactionHash" gencodec:"required"` ContractAddress common.Address `json:"contractAddress"` Height uint64 `json:"height"` TxIndex uint16 `json:"tx_index"` }
type RemoteChainOpImpl ¶
type RemoteChainOpImpl struct {
// contains filtered or unexported fields
}
func InitRemoteChainOp ¶
func InitRemoteChainOp(url string, show bool, op accountOp) *RemoteChainOpImpl
InitRemoteChainOp connect node by ip and port
func (*RemoteChainOpImpl) ApplyGuardMiner ¶
func (ca *RemoteChainOpImpl) ApplyGuardMiner(gas, gasprice uint64) *RPCResObjCmd
func (*RemoteChainOpImpl) Balance ¶
func (ca *RemoteChainOpImpl) Balance(addr string) *RPCResObjCmd
Balance query Balance by address
func (*RemoteChainOpImpl) BlockByHash ¶
func (ca *RemoteChainOpImpl) BlockByHash(hash string) *RPCResObjCmd
func (*RemoteChainOpImpl) BlockByHeight ¶
func (ca *RemoteChainOpImpl) BlockByHeight(h uint64) *RPCResObjCmd
func (*RemoteChainOpImpl) BlockHeight ¶
func (ca *RemoteChainOpImpl) BlockHeight() *RPCResObjCmd
func (*RemoteChainOpImpl) ChangeFundGuardMode ¶
func (ca *RemoteChainOpImpl) ChangeFundGuardMode(mode int, gas, gasprice uint64) *RPCResObjCmd
func (*RemoteChainOpImpl) Connect ¶
func (ca *RemoteChainOpImpl) Connect(url string) error
Connect connect node by ip and port
func (*RemoteChainOpImpl) Endpoint ¶
func (ca *RemoteChainOpImpl) Endpoint() string
Endpoint returns current connected ip and port
func (*RemoteChainOpImpl) GroupCheck ¶
func (ca *RemoteChainOpImpl) GroupCheck(addr string) *RPCResObjCmd
func (*RemoteChainOpImpl) GroupHeight ¶
func (ca *RemoteChainOpImpl) GroupHeight() *RPCResObjCmd
func (*RemoteChainOpImpl) MinerAbort ¶
func (ca *RemoteChainOpImpl) MinerAbort(mtype int, gas, gasprice uint64, force bool) *RPCResObjCmd
MinerAbort send stop mining transaction
func (*RemoteChainOpImpl) MinerInfo ¶
func (ca *RemoteChainOpImpl) MinerInfo(addr string, detail string) *RPCResObjCmd
MinerInfo query miner info by address
func (*RemoteChainOpImpl) MinerPoolInfo ¶
func (ca *RemoteChainOpImpl) MinerPoolInfo(addr string) *RPCResObjCmd
MinerPoolInfo query miner pool info by address
func (*RemoteChainOpImpl) Nonce ¶
func (ca *RemoteChainOpImpl) Nonce(addr string) *RPCResObjCmd
Nonce query Balance by address
func (*RemoteChainOpImpl) QueryFundGuardMode ¶
func (ca *RemoteChainOpImpl) QueryFundGuardMode(addr string) *RPCResObjCmd
func (*RemoteChainOpImpl) SendRaw ¶
func (ca *RemoteChainOpImpl) SendRaw(tx *TxRawData) *RPCResObjCmd
SendRaw send transaction to connected node
func (*RemoteChainOpImpl) StakeAdd ¶
func (ca *RemoteChainOpImpl) StakeAdd(target string, mType int, stake uint64, gas, gasPrice uint64) *RPCResObjCmd
StakeAdd adds value for the given target account
func (*RemoteChainOpImpl) StakeReduce ¶
func (ca *RemoteChainOpImpl) StakeReduce(target string, mType int, value, gas, gasPrice uint64) *RPCResObjCmd
StakeReduce send reduce value transaction
func (*RemoteChainOpImpl) StakeRefund ¶
func (ca *RemoteChainOpImpl) StakeRefund(target string, mType int, gas, gasPrice uint64) *RPCResObjCmd
StakeRefund send refund transaction. After the group is dissolved, the token will be refunded
func (*RemoteChainOpImpl) TicketsInfo ¶
func (ca *RemoteChainOpImpl) TicketsInfo(addr string) *RPCResObjCmd
TicketsInfo query tickets by address
func (*RemoteChainOpImpl) TxInfo ¶
func (ca *RemoteChainOpImpl) TxInfo(hash string) *RPCResObjCmd
func (*RemoteChainOpImpl) TxReceipt ¶
func (ca *RemoteChainOpImpl) TxReceipt(hash string) *RPCResObjCmd
func (*RemoteChainOpImpl) ViewContract ¶
func (ca *RemoteChainOpImpl) ViewContract(addr string) *RPCResObjCmd
func (*RemoteChainOpImpl) VoteMinerPool ¶
func (ca *RemoteChainOpImpl) VoteMinerPool(target string, gas, gasprice uint64) *RPCResObjCmd
type RespMortMsg ¶
type RewardTransaction ¶
type RewardTransaction struct { Hash common.Hash `json:"hash"` BlockHash common.Hash `json:"block_hash"` GroupSeed common.Hash `json:"group_id"` TargetIDs []groupsig.ID `json:"target_ids"` Value uint64 `json:"value"` PackFee uint64 `json:"pack_fee"` StatusReport string `json:"status_report"` Success bool `json:"success"` }
type RpcDevImpl ¶
type RpcDevImpl struct {
// contains filtered or unexported fields
}
RpcDevImpl provides api functions for those develop chain features. It is mainly for debug or test use
func (*RpcDevImpl) BalanceByHeight ¶
func (api *RpcDevImpl) BalanceByHeight(height uint64, account string) (float64, error)
func (*RpcDevImpl) BlockDetail ¶
func (api *RpcDevImpl) BlockDetail(h string) (*BlockDetail, error)
func (*RpcDevImpl) BlockDropInfo ¶
func (api *RpcDevImpl) BlockDropInfo(b, e uint64) (map[string]interface{}, error)
func (*RpcDevImpl) BlockReceipts ¶
func (api *RpcDevImpl) BlockReceipts(h string) (*BlockReceipt, error)
func (*RpcDevImpl) ConnectedNodes ¶
func (api *RpcDevImpl) ConnectedNodes() ([]ConnInfo, error)
ConnectedNodes query the information of the connected node
func (*RpcDevImpl) Dashboard ¶
func (api *RpcDevImpl) Dashboard() (*Dashboard, error)
func (*RpcDevImpl) DebugGetRawTx ¶
func (api *RpcDevImpl) DebugGetRawTx(hash string) (*Transaction, error)
func (*RpcDevImpl) DebugGetRewardTxs ¶
func (api *RpcDevImpl) DebugGetRewardTxs(limit int) ([]*rewardTxHash, error)
func (*RpcDevImpl) DebugGetTxs ¶
func (api *RpcDevImpl) DebugGetTxs(limit int) ([]string, error)
func (*RpcDevImpl) GetBlocks ¶
func (api *RpcDevImpl) GetBlocks(from uint64, end uint64) ([]*Block, error)
func (*RpcDevImpl) GetCurrentWorkGroup ¶
func (api *RpcDevImpl) GetCurrentWorkGroup() ([]*Group, error)
func (*RpcDevImpl) GetGroupsAfter ¶
func (api *RpcDevImpl) GetGroupsAfter(height uint64) ([]*Group, error)
func (*RpcDevImpl) GetLivedGroup ¶
func (api *RpcDevImpl) GetLivedGroup(height uint64) ([]*Group, error)
func (*RpcDevImpl) GetTopBlock ¶
func (api *RpcDevImpl) GetTopBlock() (map[string]interface{}, error)
func (*RpcDevImpl) GetTransaction ¶
func (api *RpcDevImpl) GetTransaction(hash string) (map[string]interface{}, error)
get transaction by hash
func (*RpcDevImpl) GetWorkGroup ¶
func (api *RpcDevImpl) GetWorkGroup(height uint64) ([]*Group, error)
func (*RpcDevImpl) JumpBlockInfo ¶
func (api *RpcDevImpl) JumpBlockInfo(begin, end uint64) (map[string][2]int, error)
func (*RpcDevImpl) MonitorAllMiners ¶
func (api *RpcDevImpl) MonitorAllMiners() (map[string]interface{}, error)
func (*RpcDevImpl) MonitorBlocks ¶
func (api *RpcDevImpl) MonitorBlocks(begin, end uint64) ([]*BlockDetail, error)
MonitorBlocks monitoring platform calls block sync
func (*RpcDevImpl) MonitorNodeInfo ¶
func (api *RpcDevImpl) MonitorNodeInfo() (*NodeInfo, error)
func (*RpcDevImpl) Namespace ¶
func (api *RpcDevImpl) Namespace() string
func (*RpcDevImpl) NodeInfo ¶
func (api *RpcDevImpl) NodeInfo() (*NodeInfo, error)
func (*RpcDevImpl) ProposalTotalStake ¶
func (api *RpcDevImpl) ProposalTotalStake(height uint64) (uint64, error)
func (*RpcDevImpl) ScriptTransferTx ¶
func (*RpcDevImpl) TransPool ¶
func (api *RpcDevImpl) TransPool() ([]*types.Transaction, error)
TransPool query buffer transaction information
func (*RpcDevImpl) TxUnSafe ¶
func (api *RpcDevImpl) TxUnSafe(privateKey, target string, value, gas, gasprice, nonce uint64, txType int, data []byte) (string, error)
TxUnSafe sends a transaction by submitting the privateKey. It is not safe for users, used for testing purpose
func (*RpcDevImpl) Version ¶
func (api *RpcDevImpl) Version() string
func (*RpcDevImpl) WorkGroupNum ¶
func (api *RpcDevImpl) WorkGroupNum() (int, error)
type RpcExplorerImpl ¶
type RpcExplorerImpl struct {
// contains filtered or unexported fields
}
RpcExplorerImpl provides rpc service for blockchain explorer use
func (*RpcExplorerImpl) ExplorerAccount ¶
func (api *RpcExplorerImpl) ExplorerAccount(hash string) (*ExplorerAccount, error)
ExplorerAccount is used in the blockchain browser to query account information
func (*RpcExplorerImpl) ExplorerBlockDetail ¶
func (api *RpcExplorerImpl) ExplorerBlockDetail(height uint64) (*ExplorerBlockDetail, error)
ExplorerBlockDetail is used in the blockchain browser to query block details
func (*RpcExplorerImpl) ExplorerBlockReward ¶
func (api *RpcExplorerImpl) ExplorerBlockReward(height uint64) (*ExploreBlockReward, error)
ExplorerBlockReward export reward transaction by block height
func (*RpcExplorerImpl) ExplorerGetCandidates ¶
func (api *RpcExplorerImpl) ExplorerGetCandidates() (*[]ExploreCandidateList, error)
func (*RpcExplorerImpl) ExplorerGroupsAfter ¶
func (api *RpcExplorerImpl) ExplorerGroupsAfter(height uint64) ([]*Group, error)
ExplorerGroupsAfter is used in the blockchain browser to query groups after the specified height
func (*RpcExplorerImpl) Namespace ¶
func (api *RpcExplorerImpl) Namespace() string
func (*RpcExplorerImpl) Version ¶
func (api *RpcExplorerImpl) Version() string
type RpcGzvImpl ¶
type RpcGzvImpl struct {
// contains filtered or unexported fields
}
RpcGzvImpl provides rpc service for users to interact with remote nodes
func (*RpcGzvImpl) Balance ¶
func (api *RpcGzvImpl) Balance(account string) (float64, error)
Balance is query balance interface
func (*RpcGzvImpl) BlockHeight ¶
func (api *RpcGzvImpl) BlockHeight() (uint64, error)
BlockHeight query block height
func (*RpcGzvImpl) CheckPointAt ¶
func (api *RpcGzvImpl) CheckPointAt(h uint64) (*types.BlockHeader, error)
func (*RpcGzvImpl) GetBlockByHash ¶
func (api *RpcGzvImpl) GetBlockByHash(hash string) (*Block, error)
func (*RpcGzvImpl) GetBlockByHeight ¶
func (api *RpcGzvImpl) GetBlockByHeight(height uint64) (*Block, error)
func (*RpcGzvImpl) GetTxsByBlockHash ¶
func (api *RpcGzvImpl) GetTxsByBlockHash(hash string) ([]string, error)
func (*RpcGzvImpl) GetTxsByBlockHeight ¶
func (api *RpcGzvImpl) GetTxsByBlockHeight(height uint64) ([]string, error)
func (*RpcGzvImpl) GroupCheck ¶
func (api *RpcGzvImpl) GroupCheck(addr string) (*GroupCheckInfo, error)
func (*RpcGzvImpl) GroupHeight ¶
func (api *RpcGzvImpl) GroupHeight() (uint64, error)
GroupHeight query group height
func (*RpcGzvImpl) LatestCheckPoint ¶
func (api *RpcGzvImpl) LatestCheckPoint() (*types.BlockHeader, error)
func (*RpcGzvImpl) MinerInfo ¶
func (api *RpcGzvImpl) MinerInfo(addr string, detail string) (*MinerStakeDetails, error)
func (*RpcGzvImpl) MinerPoolInfo ¶
func (api *RpcGzvImpl) MinerPoolInfo(addr string, height uint64) (*MinerPoolDetail, error)
func (*RpcGzvImpl) Namespace ¶
func (api *RpcGzvImpl) Namespace() string
func (*RpcGzvImpl) QueryAccountData ¶
func (api *RpcGzvImpl) QueryAccountData(addr string, key string, count int) (interface{}, error)
func (*RpcGzvImpl) TransDetail ¶
func (api *RpcGzvImpl) TransDetail(h string) (*Transaction, error)
func (*RpcGzvImpl) Tx ¶
func (api *RpcGzvImpl) Tx(txRaw *TxRawData) (string, error)
Tx is user transaction interface, used for sending transaction to the node
func (*RpcGzvImpl) TxReceipt ¶
func (api *RpcGzvImpl) TxReceipt(h string) (*ExecutedTransaction, error)
func (*RpcGzvImpl) Version ¶
func (api *RpcGzvImpl) Version() string
func (*RpcGzvImpl) ViewAccount ¶
func (api *RpcGzvImpl) ViewAccount(hash string) (*ExplorerAccount, error)
ViewAccount is used for querying account information
type RpcMinerImpl ¶
type RpcMinerImpl struct {
// contains filtered or unexported fields
}
RpcGzvImpl provides rpc service for users to interact with remote nodes
func (*RpcMinerImpl) BasicData ¶
func (rm *RpcMinerImpl) BasicData() (*BasicInfo, error)
func (*RpcMinerImpl) MortData ¶
func (rm *RpcMinerImpl) MortData() ([]MortGage, error)
func (*RpcMinerImpl) Namespace ¶
func (api *RpcMinerImpl) Namespace() string
func (*RpcMinerImpl) Version ¶
func (api *RpcMinerImpl) Version() string
type StakeDetail ¶
type Transaction ¶
type Transaction struct { Data []byte `json:"data"` Value float64 `json:"value"` Nonce uint64 `json:"nonce"` Source *common.Address `json:"source"` Target *common.Address `json:"target"` Type int8 `json:"type"` GasLimit uint64 `json:"gas_limit"` GasPrice uint64 `json:"gas_price"` Hash common.Hash `json:"hash"` ExtraData string `json:"extra_data"` }
type Transactions ¶
type Transactions struct { Hash string `json:"hash"` Source string `json:"source"` Target string `json:"target"` Value string `json:"value"` Height uint64 `json:"height"` BlockHash string `json:"block_hash"` }
Transactions in the buffer pool transaction list
type TxRawData ¶
type TxRawData struct { Source string `json:"source"` Target string `json:"target"` Value uint64 `json:"value"` GasLimit uint64 `json:"gas_limit"` GasPrice uint64 `json:"gas_price"` TxType int `json:"type"` Nonce uint64 `json:"nonce"` Data []byte `json:"data"` Sign string `json:"sign"` ExtraData []byte `json:"extra_data"` }
type WalletServer ¶
func NewWalletServer ¶
func NewWalletServer(host string, port int, aop accountOp) *WalletServer
func (*WalletServer) SignTransaction ¶
func (ws *WalletServer) SignTransaction(txRaw *TxRawData, unlockPassword string) (string, error)
func (*WalletServer) Start ¶
func (ws *WalletServer) Start() error