comet

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingSubmitter = errors.New("missing submitter in the comet block")
	ErrMissingCommand   = errors.New("missing command in the comet block")
)
View Source
var (
	EXCLUDE_COMMAND_TYPES = []string{
		"Submit Order",
		"Cancel Order",
		"Amend Order",
		"Withdraw",
		"Proposal",
		"Vote on Proposal",

		"Node Signature",
		"Liquidity Provision Order",
		"Cancel LiquidityProvision Order",
		"Amend LiquidityProvision Order",

		"Submit Oracle Data",
		"Delegate",
		"Undelegate",
		"Key Rotate Submission",

		"Transfer Funds",
		"Cancel Transfer Funds",

		"Ethereum Key Rotate Submission",
		"Protocol Upgrade",
	}
)

Functions

This section is empty.

Types

type BlockSignersData

type BlockSignersData struct {
	Height          int64
	Time            time.Time
	ProposerAddress string
	SignerAddresses []string
}

type CometClient

type CometClient struct {
	// contains filtered or unexported fields
}

func NewCometClient

func NewCometClient(config *config.CometBFTConfig) *CometClient

func (*CometClient) EarliestBlockHeight added in v0.9.0

func (c *CometClient) EarliestBlockHeight(ctx context.Context) (int64, error)

func (*CometClient) GetBlockSigners

func (c *CometClient) GetBlockSigners(ctx context.Context, block int64) (*BlockSignersData, error)

func (*CometClient) GetBlockSignersRange

func (c *CometClient) GetBlockSignersRange(ctx context.Context, fromBlock int64, toBlock int64) ([]BlockSignersData, error)

func (*CometClient) GetLastBlockTxs

func (c *CometClient) GetLastBlockTxs(ctx context.Context) ([]CometTx, error)

func (*CometClient) GetLatestBlockSigners

func (c *CometClient) GetLatestBlockSigners(ctx context.Context) (*BlockSignersData, error)

func (*CometClient) GetTxsForBlock

func (c *CometClient) GetTxsForBlock(ctx context.Context, block int64) ([]CometTx, error)

func (*CometClient) GetTxsForBlockNotFiltered

func (c *CometClient) GetTxsForBlockNotFiltered(ctx context.Context, block int64) ([]CometTx, error)

func (*CometClient) GetTxsForBlockRange

func (c *CometClient) GetTxsForBlockRange(ctx context.Context, fromBlock int64, toBlock int64) ([]CometTx, error)

func (*CometClient) GetTxsForBlockRangeNotFiltered

func (c *CometClient) GetTxsForBlockRangeNotFiltered(ctx context.Context, fromBlock int64, toBlock int64) ([]CometTx, error)

func (*CometClient) GetValidatorForAddressAtBlock

func (c *CometClient) GetValidatorForAddressAtBlock(ctx context.Context, address string, block int64) (*ValidatorData, error)

func (*CometClient) GetValidators

func (c *CometClient) GetValidators(ctx context.Context) ([]CometValidators, error)

func (*CometClient) GetValidatorsForBlock

func (c *CometClient) GetValidatorsForBlock(ctx context.Context, block int64) ([]CometValidators, error)

func (*CometClient) LatestLocalBlockHeight added in v0.9.0

func (c *CometClient) LatestLocalBlockHeight(ctx context.Context) (int64, error)

func (*CometClient) Status added in v0.9.0

func (c *CometClient) Status(ctx context.Context) (*StatusResponse, error)

type CometTx

type CometTx struct {
	Code       int
	Info       *string
	Submitter  string
	Command    string
	Attributes map[string]string
	Height     int64
	HeightIdx  int
}

func RemoveExcludedTxTypes

func RemoveExcludedTxTypes(txs []CometTx) []CometTx

type CometValidators

type CometValidators struct {
	Address          string
	TmPubKey         vega_entities.TendermintPublicKey
	VotingPower      int64
	ProposerPriority int64
	Height           int64
}

type StatusResponse added in v0.9.0

type StatusResponse struct {
	SyncInfo StatusSyncInfo `json:"sync_info"`
}

type StatusSyncInfo added in v0.9.0

type StatusSyncInfo struct {
	LatestBlockHash   string    `json:"latest_block_hash"`
	LatestAppHash     string    `json:"latest_app_hash"`
	LatestBlockHeight int64     `json:"latest_block_height"`
	LatestBlockTime   time.Time `json:"latest_block_time"`

	EarliestBlockHash   string    `json:"earliest_block_hash"`
	EarliestAppHash     string    `json:"earliest_app_hash"`
	EarliestBlockHeight int64     `json:"earliest_block_height"`
	EarliestBlockTime   time.Time `json:"earliest_block_time"`
	CatchingUp          bool      `json:"catching_up"`
}

type ValidatorData

type ValidatorData struct {
	Address  string
	TmPubKey vega_entities.TendermintPublicKey
}

Jump to

Keyboard shortcuts

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