Documentation ¶
Index ¶
Constants ¶
const LoggerTag = "ETHEREUM_TELEPORT"
const SignatureKey = "ethereum"
const TeleportEventType = "teleport_evm"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.7.1
type Config struct { // Client is an instance of Ethereum RPC client. Client ethereum.Client //nolint:staticcheck // deprecated // Addresses is a list of contracts from which logs will be fetched. Addresses []types.Address // Interval specifies how often provider should check for new logs. Interval time.Duration // PrefetchPeriod specifies how far back in time provider should prefetch // logs. It is used only during the initial start of the provider. PrefetchPeriod time.Duration // BlockLimit specifies how from many blocks logs can be fetched at once. BlockLimit uint64 // BlockConfirmations specifies how many blocks should be confirmed before // fetching logs. BlockConfirmations uint64 // Logger is a current logger interface used by the EventProvider. Logger log.Logger }
Config contains a configuration options for EventProvider.
type EventProvider ¶ added in v0.7.1
type EventProvider struct {
// contains filtered or unexported fields
}
EventProvider listens to TeleportGUID events on Ethereum compatible blockchains.
https://github.com/makerdao/dss-teleport
It periodically fetches new TeleportGUID events from the blockchain, converts them into messages.Event and sends them to the channel provided by Events method.
During the initial start of the provider it also fetches older blocks until it reaches the block that is older than the prefetch period. This is done to fetch events that were emitted before the provider was started.
In the event of an error in communication with a node, whether related to network errors or the node itself, the provider will try to repeat requests to the node indefinitely.
func New ¶
func New(cfg Config) (*EventProvider, error)
New returns a new instance of the EventProvider struct.
func (*EventProvider) Events ¶ added in v0.7.1
func (ep *EventProvider) Events() chan *messages.Event
Events implements the publisher.EventPublisher interface.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer signs events using Ethereum signature.
Signer could only sign events that have a "hash" field in the data. The value of that field is used to calculate the signature. The rest of the fields in the data are ignored. The calculated signature is stored in the "ethereum" field of the event's signatures map.