api

package
v0.0.0-...-80b22ab Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: AGPL-3.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlockHeight

func GetBlockHeight() (int64, bool)

GetBlockHeight returns the latest block height stored by the database

func GetBlockList

func GetBlockList(i int) ([config.ListSize]*types.StoreBlock, bool)

GetBlockList returns a list of blocks from the database

func GetBlockListByValidator

func GetBlockListByValidator(i int, proposer []byte) ([config.ListSize]*types.StoreBlock, bool)

GetBlockListByValidator returns a list of blocks with given proposer from the database

func GetBlockSearch

func GetBlockSearch(term string) ([config.ListSize]*types.StoreBlock, bool)

GetBlockSearch returns a list of blocks from the database according to the search term

func GetBlocksByValidatorSearch

func GetBlocksByValidatorSearch(term, validator string) ([config.ListSize]*types.StoreBlock, bool)

GetBlocksByValidatorSearch returns a list of blocks from the database according to the search term and given validator

func GetEntityCount

func GetEntityCount() (int64, bool)

GetEntityCount returns the latest envelope height stored by the database

func GetEntityList

func GetEntityList(i int) ([config.ListSize]string, bool)

GetEntityList returns a list of entities from the database

func GetEntityProcessCount

func GetEntityProcessCount(entity string) (int64, bool)

GetEntityProcessCount returns the number of processes belonging to a

func GetEntityProcessCountMap

func GetEntityProcessCountMap() (map[string]int64, bool)

GetEntityProcessCountMap returns the entire map of entity process heights

func GetEntitySearch

func GetEntitySearch(term string) ([config.ListSize]string, bool)

GetEntitySearch returns a list of entities from the database according to the search term

func GetEnvelope

func GetEnvelope(height int64) (*types.Envelope, bool)

GetEnvelope gets a single envelope by global height

func GetEnvelopeCount

func GetEnvelopeCount() (int64, bool)

GetEnvelopeCount returns the latest envelope height stored by the database

func GetEnvelopeHeightFromNullifier

func GetEnvelopeHeightFromNullifier(hash string) (int64, bool)

GetEnvelopeHeightFromNullifier finds the height corresponding to a given envelope nullifier

func GetEnvelopeList

func GetEnvelopeList(i int) ([config.ListSize]*types.Envelope, bool)

GetEnvelopeList returns a list of envelopes from the database

func GetEnvelopeListByProcess

func GetEnvelopeListByProcess(i int, process string) ([config.ListSize]*types.Envelope, bool)

GetEnvelopeListByProcess returns a list of envelopes by process

func GetEnvelopeSearch

func GetEnvelopeSearch(term string) ([config.ListSize]*types.Envelope, bool)

GetEnvelopeSearch returns a list of envelopes from the database according to the search term

func GetProcess

func GetProcess(id string) (*types.Process, bool)

GetProcess fetches a process

func GetProcessCount

func GetProcessCount() (int64, bool)

GetProcessCount returns the latest process height stored by the database

func GetProcessEnvelopeCount

func GetProcessEnvelopeCount(process string) (int64, bool)

GetProcessEnvelopeCount returns the height of envelopes belonging to given process stored by the database

func GetProcessEnvelopeCountMap

func GetProcessEnvelopeCountMap() (map[string]int64, bool)

GetProcessEnvelopeCountMap returns the entire map of process envelope heights

func GetProcessList

func GetProcessList(i int) ([config.ListSize]*types.Process, bool)

GetProcessList returns a list of entities from the database

func GetProcessListByEntity

func GetProcessListByEntity(i int, entity string) ([config.ListSize]*types.Process, bool)

GetProcessListByEntity returns a list of processes by entity

func GetProcessSearch

func GetProcessSearch(term string) ([config.ListSize]*types.Process, bool)

GetProcessSearch returns a list of processes from the database according to the search term

func GetStoreBlock

func GetStoreBlock(i int64) (*types.StoreBlock, bool)

GetStoreBlock returns a single block from the database

func GetTransactionSearch

func GetTransactionSearch(term string) ([config.ListSize]*types.Transaction, bool)

GetTransactionSearch returns a list of transactions from the database according to the search term

func GetTxByHash

func GetTxByHash(hash string) (*types.Transaction, bool)

GetTxByHash returns a transaction from the database

func GetTxByHeight

func GetTxByHeight(height int64) (*types.Transaction, bool)

GetTxByHeight returns a transaction from the database

func GetTxHeight

func GetTxHeight() (int64, bool)

GetTxHeight returns the latest tx height stored by the database

func GetTxHeightFromHash

func GetTxHeightFromHash(hash string) (int64, bool)

GetTxHeightFromHash finds the height corresponding to a given tx hash

func GetTxList

func GetTxList(from int) ([config.ListSize]*types.Transaction, bool)

GetTxList returns a list of transactions from the database

func GetValidator

func GetValidator(address string) (*types.Validator, bool)

GetValidator returns a single validator from the database

func GetValidatorBlockHeight

func GetValidatorBlockHeight(proposer string) (int64, bool)

GetValidatorBlockHeight returns the height of blocks belonging to given validator stored by the database

func GetValidatorBlockHeightMap

func GetValidatorBlockHeightMap() (map[string]int64, bool)

GetValidatorBlockHeightMap returns the entire map of validator block heights

func GetValidatorCount

func GetValidatorCount() (int64, bool)

GetValidatorCount returns the latest validator count stored by the database

func GetValidatorList

func GetValidatorList(i int) ([config.ListSize]*types.Validator, bool)

GetValidatorList returns a list of validators from the database

func GetValidatorSearch

func GetValidatorSearch(term string) ([config.ListSize]*types.Validator, bool)

GetValidatorSearch returns a list of validators from the database according to the search term

func PingServer

func PingServer() bool

PingServer pings the web server

Types

type Block

type Block struct {
	Data            [][]byte
	Evidence        string
	Hash            string
	Header          string
	Height          int64
	LastBlockID     string
	LastCommit      string
	ProposerAddress string
	Size            int
	Time            time.Time
}

Block stores all block fields used by frontend, mimics tendermint block type

func GetBlock

func GetBlock(height int64) (*Block, bool)

GetBlock fetches a single block from the vochain node

type Pkeys

type Pkeys struct {
	Pub  []types.Key
	Priv []types.Key
	Comm []types.Key
	Rev  []types.Key
}

Pkeys is the set of cryptographic keys for a process

func GetProcessKeys

func GetProcessKeys(pid string) (*Pkeys, bool)

GetProcessKeys gets process keys

type ProcessResults

type ProcessResults struct {
	State   string
	Type    string
	Results [][]uint32
}

ProcessResults holds the results of a process

func GetProcessResults

func GetProcessResults(id string) (*ProcessResults, bool)

GetProcessResults fetches the results of a process

type VochainStats

type VochainStats struct {
	BlockHeight       int64     `json:"block_height"`
	EntityCount       int64     `json:"entity_count"`
	EnvelopeCount     int64     `json:"envelope_count"`
	ProcessCount      int64     `json:"process_count"`
	TransactionHeight int64     `json:"transaction_height"`
	ValidatorCount    int64     `json:"validator_count"`
	BlockTime         *[5]int32 `json:"block_time"`
	BlockTimeStamp    int32     `json:"block_time_stamp"`
	ChainID           string    `json:"chain_id"`
	GenesisTimeStamp  time.Time `json:"genesis_time_stamp"`
	Height            int64     `json:"height"`
	Network           string    `json:"network"`
	Version           string    `json:"version"`
	LatestBlockHeight int64     `json:"latest_block_height"`
	AvgTxsPerBlock    float64   `json:"avg_txs_per_block"`
	AvgTxsPerMinute   float64   `json:"avg_txs_per_minute"`
	// The hash of the block with the most txs
	MaxBytes          int64  `json:"max_bytes"`
	MaxTxsBlockHash   string `json:"max_txs_block_hash"`
	MaxTxsBlockHeight int64  `json:"max_txs_block_height"`
	// The start of the minute with the most txs
	MaxTxsMinute    time.Time `json:"max_txs_minute"`
	MaxTxsPerBlock  int64     `json:"max_txs_per_block"`
	MaxTxsPerMinute int64     `json:"max_txs_per_minute"`
	Syncing         bool      `json:"syncing"`
}

VochainStats is the type used by the public stats api

func GetStats

func GetStats() (*VochainStats, bool)

GetStats gets the latest statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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