algodimporter

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 23 Imported by: 0

README

Algod Import Plugin

This plugin imports block data from an algod node. Fetch blocks data from the algod REST API.

Features

Automatic Fast Catchup

If an admin API token is set, the plugin will attempt to use a fast catchup when it would help reach the target round. A specific catchpoint can be provided, otherwise one will be selected automatically by querying the catchpoint URLs listed in the sample.

Follower Node Orchestration

When configured to work with a follower node, this plugin fully automates the management of the follower node. The sync round will be configured according to the pipeline round, and will be advanced as data is importer.

When using a follower node, ledger state delta objects are provided to the processors and exporter. This data contains detailed state transition information which is necessary for some processors and exporters.

Configuration

name: algod
config:
    # The mode of operation, either "archival" or "follower".
    # * follower mode allows you to use a lightweight non-archival node as the
    #   data source. In addition, it will provide ledger state delta objects to
    #   the processors and exporter.
    # * archival mode allows you to start processing on any round but does not
    #   contain the ledger state delta objects required for the postgres writer.
    mode: "follower"

    # Algod API address.
    netaddr: "http://your-algod-url:port"

    # Algod API token. Found in the algod.token file.
    token: "contents of your algod.token file"

    # Algod catchpoint catchup arguments
    catchup-config:
        # Algod Admin API Token. Used for running fast catchup during startup
        # if the node needs to be initialized. Found in algod.admin.token file.
        admin-token: ""

Documentation

Index

Constants

View Source
const (
	// PluginName to use when configuring.
	PluginName = "algod"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CatchupParams added in v1.1.0

type CatchupParams struct {
	// <code>catchpoint</code> is the catchpoint used to run fast catchup on startup when your node is behind the current pipeline round.
	Catchpoint string `yaml:"catchpoint"`
	// <code>admin-token</code> is the algod admin API token.
	AdminToken string `yaml:"admin-token"`
}

CatchupParams provides information required to sync a follower node to the pipeline round

type Config

type Config struct {
	// <code>mode</code> is the mode of operation of the algod importer.  It must be either <code>archival</code> or <code>follower</code>.
	Mode string `yaml:"mode"`
	// <code>netaddr</code> is the Algod network address. It must be either an <code>http</code> or <code>https</code> URL.
	NetAddr string `yaml:"netaddr"`
	// <code>token</code> is the Algod API endpoint token.
	Token string `yaml:"token"`
	// <code>catchup-config</code> is an optional set of parameters used to catchup an algod node in follower mode with the pipeline round on startup.
	CatchupConfig CatchupParams `yaml:"catchup-config"`
}

Config specific to the algod importer

type SyncError added in v1.3.0

type SyncError struct {
	// contains filtered or unexported fields
}

SyncError is used to indicate algod and conduit are not synchronized.

func NewSyncError added in v1.4.0

func NewSyncError(retrievedRound, expectedRound uint64, err error) *SyncError

NewSyncError creates a new SyncError.

func (*SyncError) Error added in v1.3.0

func (e *SyncError) Error() string

func (*SyncError) Unwrap added in v1.4.0

func (e *SyncError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL