Documentation
¶
Index ¶
- Constants
- type AdminAccountStatus
- type AdminNodeType
- type BlockValidator
- type ExplorerRoute
- type LoginType
- 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 ResultConsensusState
- type ResultNodeTypes
- type ResultPeer
- type ResultPeers
- type ResultSequence
- type ResultStatus
- type ResultTx
- type ResultTxs
- type ResultValidator
- type Sequence
- type Validator
Constants ¶
View Source
const ( AuthUserKey = "user" AuthAppKey = "app" AuthNode = "node" )
View Source
const ( TokenKey = "QToken" AuthKey = "Authorization" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 BlockValidator ¶
type BlockValidator struct {
ChainID string `json:"chain_id"`
ValidatorAddress string `json:"validator_address"`
ValidatorIndex int64 `json:"validator_index"`
Height int64 `json:"height"`
Round int64 `json:"round"`
Type int64 `json:"type"`
Signature string `json:"signature"`
Timestamp time.Time `json:"timestamp"`
Accum int64 `json:"accum"`
CreatedAt time.Time `json:"created_at"`
}
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 time.Time `json:"time"`
DataHash string `json:"data_hash"`
ValidatorsHash string `json:"validators_hash"`
CreatedAt time.Time `json:"-"`
}
ResultBlockBase 块信息
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 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 time.Time `json:"send_start"`
RecvStart time.Time `json:"recv_start"`
CreateAt time.Time `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"`
TotalTxs int64 `json:"total_txs"`
GenesisTime time.Time `json:"genesis_time"`
}
type ResultTx ¶
type ResultTx struct {
ChainID string `json:"chain_id"`
Height int64 `json:"height"`
Index int64 `json:"index"` // index
TxType string `json:"tx_type"` // tx_type
Maxgas int64 `json:"maxgas"` // maxgas
QcpFrom string `json:"qcp_from"` // qcp_from
QcpTo string `json:"qcp_to"` // qcp_to
QcpSequence int64 `json:"qcp_sequence"` // qcp_sequence
QcpTxindex int64 `json:"qcp_txindex"` // qcp_txindex
QcpIsresult bool `json:"qcp_isresult"` // qcp_isresult
Data json.RawMessage `json:"data"` // data
Time time.Time `json:"time"` // time
CreatedAt time.Time `json:"created_at"` // created_at
}
type ResultValidator ¶
type ResultValidator struct {
Validator *Validator `json:"validator"`
Blocks []*BlockValidator `json:"blocks"`
}
type Validator ¶
type Validator struct {
ChainID string `json:"chain_id"`
Address string `json:"address"`
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"`
}
Click to show internal directories.
Click to hide internal directories.