Single-Machine Deployment
Firehose is capable of indexing Injective data through a valid Injective RPC endpoint.
Before You Begin
If you are not familiar with Firehose, read the Overview page, which should give you enough information about the main pieces involved in spinning up a Firehose environment.
Make sure you have Go installed, as you will need to build the Injective Firehose binary from source.
Spin Up an Injective Environment
Download and Install the Dependencies
Download the latest Firecore binary. Make sure you download the right binary for your computer (ARM or x86). Firecore is a Go project, so you can always build the binary from source.
Add the Firecore binary to the
$PATH
of your system. Verify that the command works:
Clone the Firehose Cosmos GitHub repository, which you will use to generate the Injective-specific Firehose binary.
Build the
fireinjective
binary:
This will generate a new binary in the Go directory of your system. In Mac, it is located at ~/go/bin
by default.
Move the generated binary to the
$PATH
of your system. Verify that the command works:
Now, you have all the necessary tools installed.
Start the Firehose Process
In this tutorial, you will deploy all the Firehose components in the same machine (i.e. this is a single-machine deployment). This is NOT the recommended set-up, as you may run into memory issues.
To avoid data corruption issues, you will deploy two Firecore processes:
Process 1 will run the following components:
reader-node
,merger
andrelayer
.Process 2 will run the following components:
firehose
,substreams-tier1
andsubstreams-tier2
.
These two processes will share the same folder to persist the data, which is called firehose-data
by default. It is important that both processes have concurrent access to the data folder.
Create a new folder, which you will be used to host all the Firehose data generated by the extraction. Make sure the folder has enough permissions to persist data in the filesystem.
Create the configuration file for Process 1, called
reader-merger-relayer.yaml
:
Specifies the components to spin up.
Specifies the first block to stream.
Specifies the Injective-specific binary location (in this case, it is globally accesible in the system).
Specifies the arguments of the
fireinjective
binary. In this case, the RPC Poller mode is used with72560211
as starting block number.Specifies how many blocks must be fetched from the RPC at a time. For example, if it is set to
20
, a batch of 20 blocks will be requested to the RPC.Specifies the RPC endpoint. You can specify several endpoints.
Create the configuration file for Process 2, called
firehose-substreams.yaml
:
Specifies the components to spin up.
Specifies the first block to stream.
Specifies the address where to reach the
relayer
component running in its own isolated Firehose process.substreams-tier1
component flag: specifies the data model of the extracted data.substreams-tier1
component flag: specifies where the Substreams server listens for connections.Lastly, start two Firecore processes in two different command-line terminals.
Last updated