Categorygithub.com/graphprotocol/extractor-cosmos
modulepackage
0.1.1
Repository: https://github.com/graphprotocol/extractor-cosmos.git
Documentation: pkg.go.dev

# README

extractor-cosmos

Blockchain data extraction utilities for Cosmos

Usage

Initialize globally:

func main() {
  extractor.SetWriterFromConfig(&extractor.Config{
    OutputFile: "/path/to/output.log",
    // Other config options are listed below
  })

  // Customize the logs prefix (DMLOG is a default)
  extractor.SetPrefix("DMLOG")

  // Initialize height frame (this is needed when using bundled output) and write block data
  extractor.SetHeight(12345)
  extractor.WriteLine(extractor.MsgBegin, "%d", 12345)
  extractor.WriteLine(extractor.MsgBlock, "...block data...")
  extractor.WriteLine(extractor.MsgEnd, "%d", 12345)
}

Cosmos Instrumentation

TODO: Add this section

Extractor Configuration

To enable extractor module, add the following to your ~/.gaia/config/config.toml file:

#######################################################
###           Extractor Configuration Options       ###
#######################################################

[extractor]
# Enable the extractor workflow
enabled = true

# Output log file for all extracted data
#
# Could be one of the:
# - "stdout", "STDOUT" will print out logs to standard output
# - "stderr", "STDERR" will print out logs to standard error output
# - "path.log" for relative to ~/.gaia directory
# - "/path/to/log.log" - for absolute path
#
# Supported variables in the filename:
# - $date - replaced by YYYYMMDD of current time in UTC
# - $time - replaced by HHMMSS of current time in UTC
# - $ts - replaced by a YYYYMMDD-HHMMSS of current time in UTC
#
output_file = "extractor.log"
# output_file = "extractor-$date.log"
# output_file = "extractor-$ts.log"

# We can also bundle block data per file
bundle = true
bundle_size = 1000 # each file will include data for 1k blocks/heights
# output file will be "output_file.log.0000000000" and so on

# Height range filtering
# start_height = 100
# end_height = 200

# Functions

DefaultConfig returns a default extractor config.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Config declares extractor service configuration options.

# Interfaces

No description provided by the author