Firehose Acme
StreamingFast Firehose template sample for A Company that Makes Everything
Last updated
StreamingFast Firehose template sample for A Company that Makes Everything
Last updated
Instrumenting a new chain from scratch requires the node native code to be instrumented to output Firehose logs, but this is only one side of the coin. A Firehose instrumentation of a new chain requires also a firehose-<chain>
program that contains chain-specific code to read the data output by the instrumented node, and serves data throughout the Firehose stack.
This firehose-<chain>
is a Golang project that contains the CLI, the , and a bunch of other small boilerplate code around the Firehose set of libraries.
To ease the work of Firehose implementors, we provide a "template" project that is the main starting point for instrumenting new, unsupported blockchain nodes.
It consists of basic code and a Dummy Blockchain prototype. The idea is that you can play with this instance to see blocks produced and test some Firehose behaviors.
firehose-acme
Clone the repository:
Install the fireacme
binary:
And validate that everything is working as expected:
Obtain the Dummy Blockchain by installing from source:
And validate that it was installed correctly:
The following messages will be printed to the terminal window if:
All of the configuration changes were made correctly,
All system paths have been set correctly,
And the Dummy Blockchain was installed and set up correctly.
To integrate the target blockchain modify devel/standard/standard.yaml
and change the start.flags.mindreader-node-path
flag to point to the custom integration's blockchain node binary.
Update the proto file sf/acme/type/v1/type.proto
to model your chain's data model.
After updating the references to "Acme" the Protocol Buffers need to be regenerated. Use the generate
shell script to make the updates.
Each blockchain has specific pieces of data, and implementation details that are paticular to that blockchain. Reach out to us if you need guidance here.
Important: Studying the StreamingFast Ethereum and other implementations and instrumentations should serve as a foundation for other custom integrations.
After completing all of the previous steps the base integration is ready for initial testing.
If all changes were made correctly the updated project should compile successfully.
You can reach out to the StreamingFast team on Discord. We usually maintain these Go-side integrations and keep them up-to-date. We can review, and do the renames as needed.
You can also rename the project and all files and references to acme
to your own chain's name. Choose two names, a long-form and a short form for the custom integration following the naming conventions outlined below.
For example:
arweave
and arw
Then finalize the rename:
Rename cmd/fireacme
-> cmd/firearw
(short form)
Search and replace fireacme
=> firearw
(short form)
Conduct a global search and replace from: acme
=> arweave
(long form)
Conduct a global search to replace ACME
=> ARWEAVE
(long form)
Conduct a global search to replace Acme
=> Arweave
(long form)
A simple shell script that starts firehose-acme
with sane default is located at . The configuration file used to launch all the applications at once is located at
Run the script from your local cloned firehose-acme
version as done in :
The file is the interface between the instrumented node's output and the Firehose ingestion process.