models

package
v0.0.0-...-d704c37 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchMarkDetail

type BenchMarkDetail struct {
	Avg   string
	Max   string
	Stdev string
}

type BenchMarkRequest

type BenchMarkRequest struct {
	TxNums       int    `json:"tx_nums"`
	TxSendPerSec int    `json:"tx_send_per_sec"`
	Connections  int    `json:"connections"`
	Mode         string `json:"mode"`
	Cmd          string `json:"cmd"`
}

bench mark

type BenchMarkResponse

type BenchMarkResponse struct {
	Latency *BenchMarkDetail
	Tps     *BenchMarkDetail
}

type Block

type Block struct {
	BlockID    `json:"block_id"`
	Header     `json:"header"`
	Data       `json:"data"`
	Evidence   types.EvidenceData `json:"evidence"`
	LastCommit []*CommitSig       `json:"last_commit"`
}

type BlockHeightRequest

type BlockHeightRequest struct {
	Height int `json:"height"`
}

type BlockID

type BlockID struct {
	Hash        string        `json:"hash"`
	PartsHeader PartSetHeader `json:"parts"`
}

type BlockMeta

type BlockMeta struct {
	BlockID `json:"block_id"`
	Header  `json:"header"`
}

Block

type BlockParams

type BlockParams struct {
	MaxBytes   int64 `json:"max_bytes"`
	MaxGas     int64 `json:"max_gas"`
	TimeIotaMs int64 `json:"time_iota_ms"`
}

type ChainInfo

type ChainInfo struct {
	LastHeight int64        `json:"last_height"`
	BlockMetas []*BlockMeta `json:"block_metas"`
}

chain

type ChainInfoRequest

type ChainInfoRequest struct {
	Min int `json:"min"`
	Max int `json:"max"`
}

type ChainState

type ChainState struct {
	NodeInfo      NodeInfo      `json:"node_info"`
	SyncInfo      SyncInfo      `json:"sync_info"`
	ValidatorInfo ValidatorInfo `json:"validator_info"`
}

type ChannelStatus

type ChannelStatus struct {
	ID                byte
	SendQueueCapacity int
	SendQueueSize     int
	Priority          int
	RecentlySent      int64
}

type CommandRequest

type CommandRequest struct {
	Cmd string `json:"cmd"`
}

Execution

type CommitSig

type CommitSig struct {
	Type             types.SignedMsgType `json:"type"`
	Height           int64               `json:"height"`
	Round            int                 `json:"round"`
	Timestamp        time.Time           `json:"timestamp"`
	ValidatorAddress string              `json:"validator_address"`
	ValidatorIndex   int                 `json:"validator_index"`
	Signature        string              `json:"signature"`
}

type CommittedTx

type CommittedTx struct {
	Data      *TxCommitData `json:"data"`
	Signature string        `json:"signature"`
	Address   string        `json:"address"`
	Height    int64         `json:"height"`
}

type CommittedTxListRequest

type CommittedTxListRequest struct {
	Begin int `json:"begin_height"`
	End   int `json:"end_height"`
}

type CommonResponse

type CommonResponse struct {
	Code    uint32      `json:"code"`
	CodeMsg string      `json:"code_info"`
	Data    interface{} `json:"data"`
}

type ConnectionStatus

type ConnectionStatus struct {
	Duration    time.Duration
	SendMonitor Status
	RecvMonitor Status
	Channels    []ChannelStatus
}

type ConsensusParams

type ConsensusParams struct {
	Block     BlockParams     `json:"block"`
	Evidence  EvidenceParams  `json:"evidence"`
	Validator ValidatorParams `json:"validator"`
}

type Data

type Data struct {
	Txs  []string `json:"txs"`
	Hash string   `json:"hash"`
}

type EvidenceParams

type EvidenceParams struct {
	MaxAge int64 `json:"max_age"`
}

type ExecuteAsyncResponse

type ExecuteAsyncResponse struct {
	Cmd       string `json:"command"`
	Signature string `json:"signature"`
	Sequence  string `json:"sequence"`
	TimeStamp string `json:"time_stamp"`
	Hash      string `json:"hash"`
}

type ExecuteRequest

type ExecuteRequest struct {
	Cmd  string `json:"cmd"`
	Mode string `json:"mode"`
}

type ExecuteResponse

type ExecuteResponse struct {
	Cmd           string `json:"command"`
	ExecuteResult string `json:"execute_result"`
	Signature     string `json:"signature"`
	Sequence      string `json:"sequence"`
	TimeStamp     string `json:"time_stamp"`
	Hash          string `json:"hash"`
	Height        int64  `json:"height"`
}

type Genesis

type Genesis struct {
	GenesisTime     time.Time          `json:"genesis_time"`
	ChainID         string             `json:"chain_id"`
	ConsensusParams *ConsensusParams   `json:"consensus_params,omitempty"`
	Validators      []GenesisValidator `json:"validators,omitempty"`
	AppHash         HexBytes           `json:"app_hash"`
	AppState        json.RawMessage    `json:"app_state,omitempty"`
}

type GenesisValidator

type GenesisValidator struct {
	Address HexBytes `json:"address"`
	PubKey  HexBytes `json:"pub_key"`
	Power   int64    `json:"power"`
	Name    string   `json:"name"`
}

type GinMsg

type GinMsg struct {
	C *gin.Context
}

func (*GinMsg) CommonResponse

func (g *GinMsg) CommonResponse(httpCode int, code uint32, codeMsg string)

func (*GinMsg) DecodeRequestBody

func (g *GinMsg) DecodeRequestBody(data interface{})

func (*GinMsg) Error

func (g *GinMsg) Error(httpCode int, code uint32, codeMsg string, err error)

func (*GinMsg) Response

func (g *GinMsg) Response(httpCode int, data interface{})

func (*GinMsg) Success

func (g *GinMsg) Success()

func (*GinMsg) SuccessWithData

func (g *GinMsg) SuccessWithData(data interface{})
type Header struct {
	Version  version.Consensus `json:"version"`
	ChainID  string            `json:"chain_id"`
	Height   int64             `json:"height"`
	Time     time.Time         `json:"time"`
	NumTxs   int64             `json:"num_txs"`
	TotalTxs int64             `json:"total_txs"`

	LastBlockID BlockID `json:"last_block_id"`

	LastCommitHash string `json:"last_commit_hash"`
	DataHash       string `json:"data_hash"`

	ValidatorsHash     string `json:"validators_hash"`
	NextValidatorsHash string `json:"next_validators_hash"`
	ConsensusHash      string `json:"consensus_hash"`
	AppHash            string `json:"app_hash"`
	LastResultsHash    string `json:"last_results_hash"`

	EvidenceHash    string `json:"evidence_hash"`
	ProposerAddress string `json:"proposer_address"`
}

type HexBytes

type HexBytes []byte

func (HexBytes) Bytes

func (bz HexBytes) Bytes() []byte

func (HexBytes) Marshal

func (bz HexBytes) Marshal() ([]byte, error)

func (HexBytes) MarshalJSON

func (bz HexBytes) MarshalJSON() ([]byte, error)

func (HexBytes) String

func (bz HexBytes) String() string

func (*HexBytes) Unmarshal

func (bz *HexBytes) Unmarshal(data []byte) error

func (*HexBytes) UnmarshalJSON

func (bz *HexBytes) UnmarshalJSON(data []byte) error

type LoginRequest

type LoginRequest struct {
	Name     string `json:"db_name"`
	Password string `json:"db_password"`
}

type NetInfo

type NetInfo struct {
	Listening bool     `json:"listening"`
	Listeners []string `json:"listeners"`
	NPeers    int      `json:"n_peers"`
	Peers     []Peer   `json:"peers"`
}

net info

type NodeInfo

type NodeInfo struct {
	ProtocolVersion p2p.ProtocolVersion `json:"protocol_version"`
	ID              p2p.ID              `json:"id"`
	ListenAddr      string              `json:"listen_addr"`
	Network         string              `json:"network"`
	Version         string              `json:"version"`
	Channels        HexBytes            `json:"channels"`
	Moniker         string              `json:"moniker"`
}

type OperationKeyLog

type OperationKeyLog struct {
	Key          string         `json:"key"`
	OperationLog []OperationLog `json:"command_log"`
}

badger

type OperationLog

type OperationLog struct {
	Operation string `json:"operation"`
	Address   string `json:"address"`
	Signature string `json:"signature"`
	Time      string `json:"time"`
	Height    string `json:"height"`
	Sequence  string `json:"sequence"`
}

type PartSetHeader

type PartSetHeader struct {
	Total int    `json:"total"`
	Hash  string `json:"hash"`
}

type Peer

type Peer struct {
	NodeInfo         NodeInfo         `json:"node_info"`
	IsOutbound       bool             `json:"is_outbound"`
	ConnectionStatus ConnectionStatus `json:"connection_status"`
	RemoteIP         string           `json:"remote_ip"`
}

type ProofDetail

type ProofDetail struct {
	Total    int      `json:"total"`
	Index    int      `json:"index"`
	LeafHash string   `json:"leaf_hash"`
	Aunts    []string `json:"aunts"`
}

type QueryPrivateWithAddrRequest

type QueryPrivateWithAddrRequest struct {
	Cmd     string `json:"command"`
	Address string `json:"address"`
}

type QueryResponse

type QueryResponse struct {
	Result string `json:"result"`
}

type Status

type Status struct {
	Active   bool          // Flag indicating an active transfer
	Start    time.Time     // Transfer start time
	Duration time.Duration // Time period covered by the statistics
	Idle     time.Duration // Time since the last transfer of at least 1 byte
	Bytes    int64         // Total number of bytes transferred
	Samples  int64         // Total number of samples taken
	InstRate int64         // Instantaneous transfer rate
	CurRate  int64         // Current transfer rate (EMA of InstRate)
	AvgRate  int64         // Average transfer rate (Bytes / Duration)
	PeakRate int64         // Maximum instantaneous transfer rate
	BytesRem int64         // Number of bytes remaining in the transfer
	TimeRem  time.Duration // Estimated time to completion
	Progress utils.Percent // Overall transfer progress
}

type SyncInfo

type SyncInfo struct {
	LatestBlockHash   HexBytes  `json:"latest_block_hash"`
	LatestAppHash     HexBytes  `json:"latest_app_hash"`
	LatestBlockHeight int64     `json:"latest_block_height"`
	LatestBlockTime   time.Time `json:"latest_block_time"`
	CatchingUp        bool      `json:"catching_up"`
}

type TokenResponse

type TokenResponse struct {
	Code    uint32 `json:"code"`
	CodeMsg string `json:"code_info"`
	Token   string `json:"token"`
}

type Transaction

type Transaction struct {
	Hash          string        `json:"hash"`
	Height        int64         `json:"height"`
	Index         uint32        `json:"index"`
	Data          *TxCommitBody `json:"data"`
	ExecuteResult string        `json:"execute_result"`
	Proof         *TxProof      `json:"proof,omitempty"`
}

Transaction

type TransactionCommittedList

type TransactionCommittedList struct {
	Total int64          `json:"total"`
	Data  []*CommittedTx `json:"data"`
}

type TransactionList

type TransactionList struct {
	Height int64         `json:"height"`
	Total  int64         `json:"total"`
	Txs    []Transaction `json:"txs"`
}

type TxCommitBody

type TxCommitBody struct {
	Data      *TxCommitData `json:"data"`
	Signature string        `json:"signature"`
	Address   string        `json:"address"`
}

type TxCommitData

type TxCommitData struct {
	Operation string `json:"operation"`
	Sequence  string `json:"sequence"`
}

type TxHashRequest

type TxHashRequest struct {
	Hash string `json:"hash"`
}

type TxProof

type TxProof struct {
	RootHash string       `json:"root_hash"`
	Proof    *ProofDetail `json:"proof"`
}

type UnConfirmedTxs

type UnConfirmedTxs struct {
	Count      int            `json:"n_txs"`
	Total      int            `json:"total"`
	TotalBytes int64          `json:"total_bytes"`
	Txs        []TxCommitBody `json:"txs"`
}

type ValidatorInfo

type ValidatorInfo struct {
	Address     HexBytes `json:"address"`
	PubKey      HexBytes `json:"pub_key"`
	VotingPower int64    `json:"voting_power"`
}

type ValidatorParams

type ValidatorParams struct {
	PubKeyTypes []string `json:"pub_key_types"`
}

type ValidatorUpdateBody

type ValidatorUpdateBody struct {
	ValidatorUpdate *ValidatorUpdateData `json:"validator_update"`
	Signature       string               `json:"signature"`
	Address         string               `json:"address"`
}

type ValidatorUpdateData

type ValidatorUpdateData struct {
	PublicKey string `json:"public_key"`
	Power     string `json:"power"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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