Skip to content

onomyprotocol/firehose-cosmos

 
 

Repository files navigation

firehose-cosmos

Firehose integration for Cosmos chains

Getting Started

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

git clone https://github.com/figment-networks/firehose-cosmos.git
go mod download

Once done, let's build the development binary:

make build

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

To install the binary globally, run:

make install

Alternatively, use a prebuilt binary from Releases Page

Docker

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

docker pull figmentnetworks/firehose-cosmos:0.4.0

Execute with:

docker run --rm -it figmentnetworks/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:

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:

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:

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

About

Cosmos Firehose integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 90.4%
  • Shell 8.0%
  • Other 1.6%