Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/graphprotocol/firehose-cosmos

Cosmos Firehose integration
https://github.com/graphprotocol/firehose-cosmos

Last synced: 8 days ago
JSON representation

Cosmos Firehose integration

Awesome Lists containing this project

README

        

# firehose-cosmos

Firehose integration for Cosmos chains

## Getting Started

To get started, first clone the repository and install all dependencies:

```bash
git clone https://github.com/graphprotocol/firehose-cosmos.git
go mod download
```

Once done, let's build the development binary:

```bash
make build
```

You should be able to use the `./build/firecosmos` binary moving forward.

To install the binary globally, run:

```bash
make install
```

Alternatively, use a prebuilt binary from [Releases Page](https://github.com/graphprotocol/firehose-cosmos/releases)

### Docker

You can use our official Docker images: https://hub.docker.com/r/graphprotocol/firehose-cosmos/tags

```
docker pull graphprotocol/firehose-cosmos:0.4.0
```

Execute with:

```
docker run --rm -it graphprotocol/firehose-cosmos:0.4.0 /app/firehose help
```

## Usage

To view usage and flags, run: `./build/firecosmos help`.

```
Usage:
firecosmos [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
init Initialize local configuration
reset Reset local data directory
start Starts all services at once
tools Developer tools

Flags:
--common-auth-plugin string Auth plugin URI, see streamingfast/dauth repository (default "null://")
--common-merged-blocks-store-url string Store URL (with prefix) where to read/write (default "file://{fh-data-dir}/storage/merged-blocks")
--common-live-blocks-addr string GRPC endpoint to get real-time blocks (default "0.0.0.0:9010")
--common-first-streamable-block uint First streamable block number
--common-metering-plugin string Metering plugin URI, see streamingfast/dmetering repository (default "null://")
--common-oneblock-store-url string Store URL (with prefix) to read/write one-block files (default "file://{fh-data-dir}/storage/one-blocks")
--common-shutdown-delay duration Add a delay between receiving SIGTERM signal and shutting down apps. Apps will respond negatively to /healthz during this period (default 5ns)
--common-startup-delay duration Delay before launching firehose process
-c, --config string Configuration file for the firehose (default "firehose.yml")
-d, --data-dir string Path to data storage for all components of firehose (default "./fh-data")
-h, --help help for firecosmos
--log-format string Logging format (default "text")
--metrics-listen-addr string If non-empty, the process will listen on this address to server Prometheus metrics (default "0.0.0.0:9102")
--pprof-listen-addr string If non-empty, the process will listen on this address for pprof analysis (see https://golang.org/pkg/net/http/pprof/)
-v, --verbose int Enables verbose output (-vvvv for max verbosity) (default 3)

Use "firecosmos [command] --help" for more information about a command.
```

## Configuration

If you wish to use a configuration file instead of setting all CLI flags, you may create a new `firehose.yml`
file in your current working directory.

Example:

```yml
start:
args:
- reader
- merger
- relayer
- firehose
flags:
# Common flags
common-first-streamable-block: 1

# Reader specific flags
reader-mode: node
reader-node-path: path/to/node/bin
reader-node-args: start --x-crisis-skip-assert-invariants
reader-node-env: "KEY=VALUE,KEY=VALUE"
```

### Logs input mode

It's possible to run the firehose reader from the static logs, mostly for development/testing purposes.

Example config:

```yml
start:
args:
- reader
# ... other services
flags:
# ... other config options

# reader specific flags
reader-mode: logs
reader-logs-dir: /path/to/logs/dir

# Configure the pattern if not using .log extension
# reader-logs-pattern: *.log
```

## Supported networks

We provide scripts for running firehose for these networks:

- [Coreum1](devel/coreum1/)
- [Cosmoshub4](devel/cosmoshub4/)
- [Osmosis1](devel/osmosis1/)

### Service Ports

By default, `firecosmos` will start all available services, each providing a GRPC interface.

- `9000` - Reader
- `9010` - Relayer
- `9020` - Merger
- `9030` - Firehose

## License

Apache License 2.0