cli

package
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2020 License: GPL-3.0 Imports: 54 Imported by: 0

Documentation

Overview

Package cli provides client command line window

Index

Constants

View Source
const (
	// Section is default section configuration
	Section = "gzv"
)

Variables

View Source
var (
	ErrPassword    = fmt.Errorf("password error")
	ErrUnlocked    = fmt.Errorf("please unlock the account first")
	ErrUnConnected = fmt.Errorf("please connect to one node first")
	ErrInternal    = fmt.Errorf("internal error")
)

Functions

func ClearBlock

func ClearBlock() error

ClearBlock delete local blockchain data

func ConsoleInit

func ConsoleInit(keystore, url string, show bool, rpchost string, rpcport int) error

func ShowPubKeyInfo

func ShowPubKeyInfo(info model.SelfMinerDO, id string)

func ShowVersionInfo

func ShowVersionInfo()

func Usage

func Usage()

Types

type Account

type Account struct {
	Address  string
	Pk       string
	Sk       string
	Password string
	Miner    *MinerRaw
}

func (*Account) MinerSk

func (a *Account) MinerSk() string

type AccountInfo

type AccountInfo struct {
	Account
	Status       int8
	UnLockExpire time.Time
}

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

func (*AccountManager) UnLock

func (am *AccountManager) UnLock(addr string, password string, duration uint) error

UnLock unlock the account by address and password

type BasicInfo

type BasicInfo struct {
	CurTime       string         `json:"cur_time"`
	ClientVersion string         `json:"client_version"`
	ChainId       uint16         `json:"chain_id"`
	BlockHeight   uint64         `json:"block_height"`
	GroupHeight   uint64         `json:"group_height"`
	Addr          common.Address `json:"addr"`
}

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 BlockReceipt struct {
	Receipts        []*types.Receipt `json:"receipts"`
	EvictedReceipts []*types.Receipt `json:"evictedReceipts"`
}

type CastStat

type CastStat struct {
	Group    map[string]GroupStat    `json:"group"`
	Proposer map[string]ProposerStat `json:"proposer"`
}

type ConnInfo

type ConnInfo struct {
	ID      string `json:"id"`
	IP      string `json:"ip"`
	TCPPort string `json:"tcp_port"`
}

type CurrentEraGroupInfo

type CurrentEraGroupInfo struct {
	Selected         bool        `json:"selected"`
	GroupSeed        common.Hash `json:"id"`
	SeedHeight       uint64      `json:"seed_height"`
	MinerActionStage string      `json:"miner_action_stage"`
}

type Dashboard

type Dashboard struct {
	BlockHeight uint64     `json:"block_height"`
	GroupHeight uint64     `json:"group_height"`
	WorkGNum    int        `json:"work_g_num"`
	NodeInfo    *NodeInfo  `json:"node_info"`
	Conns       []ConnInfo `json:"conns"`
}

type ErrorResult

type ErrorResult struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

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 ExploreCandidateList struct {
	ID    string `json:"id"`
	Stake uint64 `json:"stake"`
}

type ExplorerAccount

type ExplorerAccount struct {
	Balance   *big.Int               `json:"balance"`
	Nonce     uint64                 `json:"nonce"`
	Type      uint32                 `json:"type"`
	CodeHash  string                 `json:"code_hash"`
	ABI       []tvm.ABIVerify        `json:"abi"`
	Code      string                 `json:"code"`
	StateData map[string]interface{} `json:"state_data"`
}

type ExplorerBlockDetail

type ExplorerBlockDetail struct {
	BlockDetail
	Receipts        []*types.Receipt `json:"receipts"`
	EvictedReceipts []*types.Receipt `json:"evictedReceipts"`
}

type Group

type Group struct {
	Seed          common.Hash `json:"id"`
	BeginHeight   uint64      `json:"begin_height"`
	DismissHeight uint64      `json:"dismiss_height"`
	Threshold     int32       `json:"threshold"`
	Members       []string    `json:"members"`
	MemSize       int         `json:"mem_size"`
	GroupHeight   uint64      `json:"group_height"`
}

type GroupCheckInfo

type GroupCheckInfo struct {
	JoinedGroups        []*JoinedGroupInfo   `json:"joined_living_groups"`
	CurrentGroupRoutine *CurrentEraGroupInfo `json:"current_group_routine"`
}

type GroupStat

type GroupStat struct {
	Dismissed bool  `json:"dismissed"`
	VCount    int32 `json:"v_count"`
}

type Gzv

type Gzv struct {
	InitCha chan bool
	// contains filtered or unexported fields
}

func NewGzv

func NewGzv() *Gzv

func (*Gzv) Run

func (gzv *Gzv) Run()

type JoinedGroupInfo

type JoinedGroupInfo struct {
	Seed          common.Hash `json:"id"`
	WorkHeight    uint64      `json:"work_height"`
	DismissHeight uint64      `json:"dismiss_height"`
}

type KeyStoreRaw

type KeyStoreRaw struct {
	Key     []byte
	IsMiner bool
}

type MinerInfo

type MinerInfo struct {
	PK          string
	VrfPK       string
	ID          string
	Stake       uint64
	NType       byte
	ApplyHeight uint64
	AbortHeight uint64
}

type MinerPoolDetail

type MinerPoolDetail struct {
	CurrentStake uint64 `json:"current_stake"`
	FullStake    uint64 `json:"full_stake"`
	Tickets      uint64 `json:"tickets"`
	Identity     uint64 `json:"identity"`
	ValidTickets uint64 `json:"valid_tickets"`
}

type MinerRaw

type MinerRaw struct {
	BPk   string
	BSk   string
	VrfPk string
	VrfSk string
}

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

func NewMortGageFromMiner(miner *types.Miner) *MortGage

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 ProposerStat struct {
	Stake      uint64  `json:"stake"`
	StakeRatio float64 `json:"stake_ratio"`
	PCount     int32   `json:"p_count"`
}

type PubKeyInfo

type PubKeyInfo struct {
	PubKey string `json:"pub_key"`
	ID     string `json:"id"`
}

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 RespMortMsg struct {
	Code  int8       `json:"code"`
	Count uint64     `json:"count"`
	Data  []MortGage `json:"data"`
}

type RespMsg

type RespMsg struct {
	Code  int8        `json:"code"`
	Count uint64      `json:"count"`
	Data  []BasicInfo `json:"data"`
}

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) CastStat

func (api *RpcDevImpl) CastStat(begin uint64, end uint64) (map[string]map[string]int32, error)

CastStat cast block statistics

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 (api *RpcDevImpl) ScriptTransferTx(privateKey string, from string, to string, amount uint64, nonce uint64, txType int, gasPrice uint64) (string, error)

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) Guardmode

func (api *RpcGzvImpl) Guardmode(addr string) (string, error)

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) Nonce

func (api *RpcGzvImpl) Nonce(addr string) (uint64, error)

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 StakeDetail struct {
	Value           uint64 `json:"value"`
	UpdateHeight    uint64 `json:"update_height"`
	MType           string `json:"m_type"`
	Status          string `json:"stake_status"`
	CanReduceHeight uint64 `json:"can_reduce_height"`
}

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

type WalletServer struct {
	Host string
	Port int
	// contains filtered or unexported fields
}

func NewWalletServer

func NewWalletServer(host string, port int, aop accountOp) *WalletServer

func (*WalletServer) GenHash

func (ws *WalletServer) GenHash(txRaw *TxRawData) (string, error)

func (*WalletServer) SignData

func (ws *WalletServer) SignData(signer string, data []byte, unlockPassword string) (string, error)

func (*WalletServer) SignTransaction

func (ws *WalletServer) SignTransaction(txRaw *TxRawData, unlockPassword string) (string, error)

func (*WalletServer) Start

func (ws *WalletServer) Start() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL