-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## tl;dr - Adds interfaces for streaming raw log messages from smart contracts on a blockchain - Adds configuration for building and configuring the log streamer - Mocks the Geth client for chain streaming ## Notes There are many ways to get messages from a blockchain, each with trade-offs. 1. Query `eth_getLogs` on an archive node to retrieve log messages 2. Query `eth_getLogs` on an archive node to retrieve old log messages, then subscribe for new log messages in real-time 3. Have an ethereum node pipe log messages to stdout and have them ingested directly into a better archival service. I have opted for 1 here, since it's the simplest and most reliable. We can move to 2 if we want to improve latency for new blocks. Moving to 3 is more complicated. StreamingFast has a [Firehose](https://firehose.streamingfast.io/) package that can be used on top of a node to rapidly ingest logs, and deal with complicated cases like reorgs. But that takes a bunch of infrastructure that I'm not sure node operators are going to be up to. Options 1 and 2 work with any blockchain node. It may be possible to work with StreamingFast to get a hosted Firehose deployed that node operators can work with, possibly via [Substreams](https://substreams.streamingfast.io/) to sink directly into a DB. But that's going to take time.
- Loading branch information
Showing
9 changed files
with
1,259 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
with-expecter: True | ||
inpackage: True | ||
dir: "{{.InterfaceDir}}" | ||
mockname: "Mock{{.InterfaceName}}" | ||
outpkg: "{{.PackageName}}" | ||
filename: "mock_{{.InterfaceName}}_test.go" | ||
packages: | ||
github.com/xmtp/xmtpd/pkg/indexer/blockchain: | ||
interfaces: | ||
ChainClient: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.