Documentation
¶
Index ¶
- Constants
- func CheckNodeType(nodeType NodeType) bool
- func TxCN(t string, tx string, address string) string
- type AdminAccountStatus
- type AdminNodeType
- type Block
- type BlockHeader
- type BlockValidator
- type ChainNode
- type Coin
- type Coins
- type Evidence
- type EvidenceList
- type ExplorerRoute
- type LoginType
- type Matrix
- type NodeType
- type NodeTypeRouter
- type PriKey
- type RPCError
- type RPCResponse
- func NewRPCErrorResponse(id string, code int, msg string, data string) RPCResponse
- func NewRPCSuccessResponse(cdc *amino.Codec, id string, res interface{}) RPCResponse
- func RPCForbiddenError(id string, err error) RPCResponse
- func RPCInternalError(id string, err error) RPCResponse
- func RPCInvalidParamsError(id string, err error) RPCResponse
- func RPCInvalidRequestError(id string, err error) RPCResponse
- func RPCMethodNotFoundError(id string) RPCResponse
- func RPCParseError(id string, err error) RPCResponse
- func RPCServerError(id string, err error) RPCResponse
- func RPCUnauthorizedError(id string, err error) RPCResponse
- type ResultAccount
- type ResultBlock
- type ResultBlockBase
- type ResultBlockDuration
- type ResultConsensusState
- type ResultEvidence
- type ResultFee
- type ResultMatrix
- type ResultMissing
- type ResultNodeTypes
- type ResultPeer
- type ResultPeers
- type ResultSequence
- type ResultStatus
- type ResultTime
- type ResultTx
- type ResultTxs
- type ResultValidator
- type Sequence
- type Tx
- type TxByte
- type TxSendResult
- type TxStatus
- type Validator
- type Validators
Constants ¶
View Source
const ( AuthUserKey = "user" AuthAppKey = "app" AuthNode = "node" )
View Source
const ( FlagMaxGas = "max-gas" FlagPrometheusPushName = "prometheus.pushName" FlagPrometheusPushGateway = "prometheus.pushGateway" FlagPrometheusServer = "prometheus.prometheusServer" FlagInfluxdbServer = "influxdb.server" FlagInfluxdbUser = "influxdb.user" FlagInfluxdbPassword = "influxdb.password" )
View Source
const ( UrlPrefixNodes = "/nodes" UrlNodeProxy = UrlPrefixNodes + "/:nodeName" UrlPrefixPlugins = "/plugins" )
View Source
const ( //Active 可获得挖矿奖励状态 Active int8 = iota //Inactive Inactive )
View Source
const (
TokenKey = "QToken"
)
Variables ¶
This section is empty.
Functions ¶
func CheckNodeType ¶ added in v0.0.4
Types ¶
type AdminAccountStatus ¶
type AdminAccountStatus int
const ( AdminAccountStatusInit AdminAccountStatus = iota AdminAccountStatusChecked )
func (AdminAccountStatus) String ¶
func (aas AdminAccountStatus) String() string
type AdminNodeType ¶
type AdminNodeType struct {
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
Routers []NodeTypeRouter `json:"routers"`
}
type Block ¶ added in v0.0.4
type Block struct {
Header BlockHeader
Txs [][]byte
Precommits []*BlockValidator
EvidenceList EvidenceList
}
type BlockHeader ¶ added in v0.0.4
type BlockHeader struct {
ID int64 `json:"-"`
ChainID string `json:"chain_id"`
Height int64 `json:"height"`
Time time.Time `json:"time"`
NumTxs int64 `json:"num_txs"`
// prev block info
//LastBlockID BlockID `json:"last_block_id"`
TotalTxs int64 `json:"total_txs"`
// hashes of block data
LastCommitHash string `json:"last_commit_hash"` // commit from validators from the last block
DataHash string `json:"data_hash"` // transactions
// hashes from the app output from the prev block
ValidatorsHash string `json:"validators_hash"` // validators for the current block
ConsensusHash string `json:"consensus_hash"` // consensus params for current block
AppHash string `json:"app_hash"` // state after txs from the previous block
LastResultsHash string `json:"last_results_hash"` // root hash of all results from the txs from the previous block
ProposerAddress string `json:"proposer_address"`
// consensus info
EvidenceHash string `json:"evidence_hash"` // evidence included in the block
}
type BlockValidator ¶
type BlockValidator struct {
ChainID string `json:"chain_id"`
Height int64 `json:"height"`
ValidatorAddress string `json:"validator_address"`
ValidatorIndex int64 `json:"validator_index"`
Round int64 `json:"round"`
Type int64 `json:"type"`
Signature string `json:"signature"`
Timestamp time.Time `json:"timestamp"`
VotingPower int64 `json:"voting_power"` // voting_power
Accum int64 `json:"accum"` // accum
}
type EvidenceList ¶ added in v0.0.4
type ExplorerRoute ¶
type ExplorerRoute string
const ( ExplorerRouteBlock ExplorerRoute = "ResultBlockBase" ExplorerRouteValidtor ExplorerRoute = "Validtor" ExplorerRouteNode ExplorerRoute = "Node" )
func (ExplorerRoute) String ¶
func (er ExplorerRoute) String() string
type NodeTypeRouter ¶
type RPCResponse ¶
type RPCResponse struct {
JSONRPC string `json:"jsonrpc"`
ID string `json:"id"`
Result interface{} `json:"result,omitempty"`
Error *RPCError `json:"error,omitempty"`
}
func NewRPCErrorResponse ¶
func NewRPCErrorResponse(id string, code int, msg string, data string) RPCResponse
func NewRPCSuccessResponse ¶
func NewRPCSuccessResponse(cdc *amino.Codec, id string, res interface{}) RPCResponse
func RPCForbiddenError ¶
func RPCForbiddenError(id string, err error) RPCResponse
func RPCInternalError ¶
func RPCInternalError(id string, err error) RPCResponse
func RPCInvalidParamsError ¶
func RPCInvalidParamsError(id string, err error) RPCResponse
func RPCInvalidRequestError ¶
func RPCInvalidRequestError(id string, err error) RPCResponse
func RPCMethodNotFoundError ¶
func RPCMethodNotFoundError(id string) RPCResponse
func RPCParseError ¶
func RPCParseError(id string, err error) RPCResponse
func RPCServerError ¶
func RPCServerError(id string, err error) RPCResponse
func RPCUnauthorizedError ¶
func RPCUnauthorizedError(id string, err error) RPCResponse
type ResultAccount ¶
type ResultBlock ¶
type ResultBlock struct {
Block *ResultBlockBase `json:"block"`
Txs []*ResultTx `json:"txs"`
Validators []*BlockValidator `json:"validators"`
}
type ResultBlockBase ¶
type ResultBlockBase struct {
ID int64 `json:"-"`
BlockID string `json:"block_id"`
ChainID string `json:"chain_id"`
Height int64 `json:"height"`
NumTxs int64 `json:"num_txs"`
TotalTxs int64 `json:"total_txs"`
Data string `json:"data"`
Time ResultTime `json:"time"`
DataHash string `json:"data_hash"`
ValidatorsHash string `json:"validators_hash"`
CreatedAt ResultTime `json:"-"`
}
ResultBlockBase 块信息
type ResultBlockDuration ¶ added in v0.0.4
type ResultConsensusState ¶
type ResultConsensusState struct {
ChainID string `json:"chain_id"` // chain_id
Height string `json:"height"` // height
Round string `json:"round"` // round
Step string `json:"step"` // step
PrevotesNum int64 `json:"prevotes_num"` // prevotes_num
PrevotesValue string `json:"prevotes_value"` // prevotes_value
PrecommitsNum int64 `json:"precommits_num"` // precommits_num
PrecommitsValue string `json:"precommits_value"` // precommits_value
StartTime string `json:"start_time"` // start_time
}
type ResultEvidence ¶ added in v0.0.4
ResultEvidence 双签返回结果
type ResultMatrix ¶ added in v0.0.4
type ResultMissing ¶ added in v0.0.4
ResultMissing 漏签
type ResultNodeTypes ¶
type ResultNodeTypes struct {
Nodes []AdminNodeType `json:"nodes"`
}
type ResultPeer ¶
type ResultPeer struct {
Moniker string `json:"moniker"`
ID int64 `json:"-"`
PeerID string `json:"id"`
ListenAddr string `json:"listen_addr"`
Network string `json:"network"`
Version string `json:"version"`
Channels string `json:"channels"`
SendStart ResultTime `json:"send_start"`
RecvStart ResultTime `json:"recv_start"`
CreateAt ResultTime `json:"create_at"`
}
type ResultPeers ¶
type ResultPeers struct {
NPeers int64 `json:"n_peers"`
Peers []*ResultPeer `json:"peers"`
}
type ResultSequence ¶
type ResultSequence struct {
Apps []*Sequence `json:"apps"`
}
type ResultStatus ¶
type ResultStatus struct {
ConsensusState *ResultConsensusState `json:"consensus_state"`
TotalValidators int64 `json:"total_validators"`
Height int64 `json:"height"`
TotalTxs int64 `json:"total_txs"`
BlockTimeAvg string `json:"blockTimeAvg"`
}
type ResultTime ¶ added in v0.0.4
func (ResultTime) MarshalJSON ¶ added in v0.0.4
func (rt ResultTime) MarshalJSON() ([]byte, error)
func (ResultTime) String ¶ added in v0.0.4
func (rt ResultTime) String() string
func (ResultTime) Time ¶ added in v0.0.4
func (rt ResultTime) Time() time.Time
func (*ResultTime) UnmarshalJSON ¶ added in v0.0.4
func (rt *ResultTime) UnmarshalJSON(data []byte) (err error)
type ResultTx ¶
type ResultTx struct {
ChainID string `json:"chain_id"`
Hash string `json:"hash"`
Height int64 `json:"height"`
Index int64 `json:"index"` // index
TxType string `json:"tx_type"` // tx_type
TxTypeCN string `json:"tx_type_cn"`
GasWanted int64 `json:"gas_wanted"`
GasUsed int64 `json:"gas_used"`
Fee string `json:"fee"`
TxStatus string `json:"tx_status"`
Status int `json:"status"`
Data json.RawMessage `json:"data"` // data
Time ResultTime `json:"time"` // time
Log string `json:"log"`
CreatedAt ResultTime `json:"created_at"` // created_at
TxDetail map[string][]json.RawMessage `json:"tx_detail"`
}
type ResultValidator ¶
type ResultValidator struct {
Validator *Validator `json:"validator"`
Blocks []*BlockValidator `json:"blocks"`
}
type TxSendResult ¶ added in v0.0.4
type TxSendResult struct {
Hash string `json:"hash"`
}
type Validator ¶
type Validator struct {
Name string `json:"name"`
Details string `json:"details"`
Identity string `json:"identity"`
Logo string `json:"logo"`
Website string `json:"website"`
Owner string `json:"owner"`
ChainID string `json:"chain_id"`
Address string `json:"address"`
ConsPubKey string `json:"consensus_pubkey"` // the consensus public key of the validator; bech encoded in JSON
PubKeyType string `json:"pub_key_type"`
PubKeyValue string `json:"pub_key_value"`
VotingPower int64 `json:"voting_power"`
Accum int64 `json:"accum"`
FirstBlockHeight int64 `json:"first_block_height"`
FirstBlockTime time.Time `json:"first_block_time"`
CreatedAt time.Time `json:"created_at"`
Status int8 `json:"status"`
StatusStr string `json:"statusStr"`
InactiveCode types.InactiveCode `json:"inactiveCode"`
InactiveTime time.Time `json:"inactiveTime"`
InactiveHeight int64 `json:"inactiveHeight"`
BondHeight int64 `json:"bondHeight"`
Percent string `json:"percent"`
PrecommitNum int64 `json:"precommitNum"`
Uptime string `json:"uptime"`
UptimeFloat float64 `json:"-"`
Commission string `json:"commission_rate"`
}
type Validators ¶ added in v0.0.4
type Validators []Validator
func (Validators) Len ¶ added in v0.0.4
func (vals Validators) Len() int
func (Validators) Less ¶ added in v0.0.4
func (vals Validators) Less(i, j int) bool
func (Validators) Swap ¶ added in v0.0.4
func (vals Validators) Swap(i, j int)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.