Documentation ¶
Index ¶
- func DisplayPeersInfo(url string)
- func SignersFromBlock(header *ethertypes.Header) (author common.Address, signers []common.Address, err error)
- type NodeInfo
- type RedTNode
- func (rt *RedTNode) AllValidators() map[common.Address]*NodeInfo
- func (rt *RedTNode) BlockByHash(blockhash common.Hash) (*ethertypes.Block, error)
- func (rt *RedTNode) Close()
- func (rt *RedTNode) CurrentBlockNumber() (int64, error)
- func (rt *RedTNode) DisplayMyInfo()
- func (rt *RedTNode) DisplayPeersInfo()
- func (rt *RedTNode) EthClient() *ethclient.Client
- func (rt *RedTNode) HeaderByNumber(number int64) (*ethertypes.Header, error)
- func (rt *RedTNode) NodeInfo() (*p2p.NodeInfo, error)
- func (rt *RedTNode) Peers() ([]*p2p.PeerInfo, error)
- func (rt *RedTNode) RpcClient() *rpc.Client
- func (rt *RedTNode) ValidatorInfo(validator common.Address) *NodeInfo
- func (rt *RedTNode) Validators() []common.Address
- type SignersTable
- type StatisticsRedT
- func (st *StatisticsRedT) StatisticsForFullBlock(fullBlock *ethertypes.Block) *StatisticsSummary
- func (st *StatisticsRedT) StatisticsForHeader(header *ethertypes.Header, latestTimestamp uint64) (map[string]any, uint64)
- func (st *StatisticsRedT) StatisticsForHeaderNew(header *ethertypes.Header) *StatisticsSummary
- func (st *StatisticsRedT) UpdateStatisticsForBlock(header *ethertypes.Header) (author common.Address, signers []common.Address, err error)
- func (st *StatisticsRedT) UpdateStatisticsForFullBlock(fullblock *ethertypes.Block) (author common.Address, signers []common.Address, err error)
- func (st *StatisticsRedT) ValidatorInfo(validator common.Address) *NodeInfo
- func (st *StatisticsRedT) ValidatorSet() []common.Address
- type StatisticsSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayPeersInfo ¶
func DisplayPeersInfo(url string)
func SignersFromBlock ¶
func SignersFromBlock(header *ethertypes.Header) (author common.Address, signers []common.Address, err error)
SignersFromBlock returns the author of the block (proposer) and the list of signers
Types ¶
type RedTNode ¶
type RedTNode struct {
// contains filtered or unexported fields
}
func NewRedTNode ¶
NewRedTNode creates a connection to a blockchain node in the RedT network url can be an HTTP or WebSocket schema
func (*RedTNode) BlockByHash ¶ added in v0.4.2
BlockByHash returns the given full block.
func (*RedTNode) CurrentBlockNumber ¶
CurrentBlockNumber asks the blockchain node for the number of the latest current block
func (*RedTNode) DisplayMyInfo ¶
func (rt *RedTNode) DisplayMyInfo()
func (*RedTNode) DisplayPeersInfo ¶
func (rt *RedTNode) DisplayPeersInfo()
func (*RedTNode) HeaderByNumber ¶
func (rt *RedTNode) HeaderByNumber(number int64) (*ethertypes.Header, error)
HeaderByNumber retrieves a header from the internal cache of from the blockchain node if cache miss
func (*RedTNode) ValidatorInfo ¶
func (*RedTNode) Validators ¶
type SignersTable ¶
type StatisticsRedT ¶
type StatisticsRedT struct {
// contains filtered or unexported fields
}
func NewStatistics ¶
func NewStatistics(allValidators map[common.Address]*NodeInfo, valSet []common.Address) *StatisticsRedT
NewStatistics creates and initializes a statistics object that will accumulate counters.
func (*StatisticsRedT) StatisticsForFullBlock ¶ added in v0.4.2
func (st *StatisticsRedT) StatisticsForFullBlock(fullBlock *ethertypes.Block) *StatisticsSummary
StatisticsForFullBlock returns a map with statistical data prepared for HTML templates
func (*StatisticsRedT) StatisticsForHeader ¶
func (st *StatisticsRedT) StatisticsForHeader(header *ethertypes.Header, latestTimestamp uint64) (map[string]any, uint64)
StatisticsForHeader returns a map with statistical data prepared for HTML templates
func (*StatisticsRedT) StatisticsForHeaderNew ¶
func (st *StatisticsRedT) StatisticsForHeaderNew(header *ethertypes.Header) *StatisticsSummary
StatisticsForHeader returns a map with statistical data prepared for HTML templates
func (*StatisticsRedT) UpdateStatisticsForBlock ¶
func (st *StatisticsRedT) UpdateStatisticsForBlock(header *ethertypes.Header) (author common.Address, signers []common.Address, err error)
UpdateStatisticsForBlock uses the info of the block to update the statistics. It receives a Header (not a full Block) and returns the address of the author and an array with the signers of the block
func (*StatisticsRedT) UpdateStatisticsForFullBlock ¶ added in v0.4.2
func (st *StatisticsRedT) UpdateStatisticsForFullBlock(fullblock *ethertypes.Block) (author common.Address, signers []common.Address, err error)
UpdateStatisticsForFullBlock uses the info of the block to update the statistics. It receives a full Block and returns the address of the author and an array with the signers of the block
func (*StatisticsRedT) ValidatorInfo ¶
func (st *StatisticsRedT) ValidatorInfo(validator common.Address) *NodeInfo
ValidatorInfo returns the validator info object associated to the specified address.
func (*StatisticsRedT) ValidatorSet ¶
func (st *StatisticsRedT) ValidatorSet() []common.Address
ValidatorSet returns the current set of validator addresses. It does not make a request to the blockchain node but instead uses the set calculated when the statistics object was created.