blockhash

package
v0.0.0-...-b400eb5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHash

type BlockHash interface {
	Get() string
}

BlockHash will get the latest block hash from the ethereum blockchain

func NewChanneledBlockHash

func NewChanneledBlockHash(channel channels.ConsumerChannel) BlockHash

NewChanneledBlockHash returns a BlockHash given a ConsumerChannel

func NewRedisBlockHash

func NewRedisBlockHash(channelURI string, redisClient *redis.Client) (BlockHash, error)

NewRedisBlockHash constructs a ConsumerChannel from a channelURI and a redisClient

type ChanneledBlockHash

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

ChanneledBlockHash is a BlockHash implementation that gets the latest block hash by watching a ConsumerChannel

func (*ChanneledBlockHash) Get

func (rbh *ChanneledBlockHash) Get() string

Get retrieves the blockhash from the monitoring go routine

func (*ChanneledBlockHash) Start

func (rbh *ChanneledBlockHash) Start()

Start kicks off a go routine to listen for changes to the blockhash

type ChanneledBlockHashConsumer

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

ChanneledBlockHashConsumer listens to a consumerChannel for block hashes, and sends them over provided channel

func (*ChanneledBlockHashConsumer) Consume

func (rbhc *ChanneledBlockHashConsumer) Consume(delivery channels.Delivery)

Consume processes blockhashes as they arrive from the provided consumer channel

Jump to

Keyboard shortcuts

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