common

package
v0.0.0-...-3da4c06 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRawStake

func SetRawStake(q quorum.Decider, key bls.SerializedPublicKey, d numeric.Dec) bool

SetRawStake is a hack, return value is if was successful or not at setting

Types

type BlockArgs

type BlockArgs struct {
	WithSigners bool     `json:"withSigners"`
	FullTx      bool     `json:"fullTx"`
	Signers     []string `json:"-"`
	InclStaking bool     `json:"inclStaking"`
}

BlockArgs is struct to include optional block formatting params.

func (*BlockArgs) UnmarshalFromInterface

func (ba *BlockArgs) UnmarshalFromInterface(blockArgs interface{}) error

UnmarshalFromInterface ..

type BlockDataProvider

type BlockDataProvider interface {
	GetLeader(b *types.Block) string
	GetSigners(b *types.Block) ([]string, error)
	GetStakingTxs(b *types.Block) (interface{}, error)
	GetStakingTxHashes(b *types.Block) []common.Hash
}

BlockDataProvider helps with providing data for RPC blocks

type BlockFactory

type BlockFactory interface {
	NewBlock(b *types.Block, args *BlockArgs) (interface{}, error)
}

BlockFactory is the interface of factory for RPC block data

type C

type C struct {
	TotalKnownPeers int `json:"total-known-peers"`
	Connected       int `json:"connected"`
	NotConnected    int `json:"not-connected"`
}

C ..

type Config

type Config struct {
	AstraConfig astraconfig.AstraConfig
	NodeConfig  nodeconfig.ConfigType
	ChainConfig params.ChainConfig
}

type ConsensusInternal

type ConsensusInternal struct {
	ViewID        uint64 `json:"viewId"`
	ViewChangeID  uint64 `json:"viewChangeId"`
	Mode          string `json:"mode"`
	Phase         string `json:"phase"`
	BlockNum      uint64 `json:"blocknum"`
	ConsensusTime int64  `json:"finality"`
}

ConsensusInternal captures consensus internal data

type NodeMetadata

type NodeMetadata struct {
	BLSPublicKey    []string           `json:"blskey"`
	Version         string             `json:"version"`
	NetworkType     string             `json:"network"`
	ChainConfig     params.ChainConfig `json:"chain-config"`
	IsLeader        bool               `json:"is-leader"`
	ShardID         uint32             `json:"shard-id"`
	CurrentBlockNum uint64             `json:"current-block-number"`
	CurrentEpoch    uint64             `json:"current-epoch"`
	BlocksPerEpoch  *uint64            `json:"blocks-per-epoch,omitempty"`
	Role            string             `json:"role"`
	DNSZone         string             `json:"dns-zone"`
	Archival        bool               `json:"is-archival"`
	IsBackup        bool               `json:"is-backup"`
	NodeBootTime    int64              `json:"node-unix-start-time"`
	PeerID          peer.ID            `json:"peerid"`
	Consensus       ConsensusInternal  `json:"consensus"`
	C               C                  `json:"p2p-connectivity"`
	SyncPeers       map[string]int     `json:"sync-peers,omitempty"`
}

NodeMetadata captures select metadata of the RPC answering node

type NodePeerInfo

type NodePeerInfo struct {
	PeerID       peer.ID   `json:"peerid"`
	BlockedPeers []peer.ID `json:"blocked-peers"`
	P            []P       `json:"connected-peers"`
}

NodePeerInfo captures the peer connectivity info of the node

type P

type P struct {
	Topic string    `json:"topic"`
	Peers []peer.ID `json:"peers"`
}

P captures the connected peers per topic

Jump to

Keyboard shortcuts

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