claimer

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultConfigPath = "claimer_conf.toml"

DefaultConfigPath is the default expected path for the claimer's configuration

This is a relative path, and can be prepended as necessary

Variables

This section is empty.

Functions

func Claim

func Claim(config *Config, logger *log.Entry) http.HandlerFunc

Claim returns a HandlerFunc which claims a node reward

func NewClaimService

func NewClaimService(config *Config, logger *log.Entry) *claimService

NewClaimService constructs a new claim service

Types

type Config

type Config struct {
	// URL to the API address of a node
	NodeAPI string `toml:"node_api"`
	// The Nodes map actually maps an address to a list of private keys
	Nodes map[string][]string `toml:"nodes"`
	// If set and true, operate in synchronous mode: wait for the blockchain
	// to return before returning from a request.
	SyncMode *bool `toml:"sync_mode"`
}

Config configures the claimer

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads the configuration data

func LoadConfigData

func LoadConfigData(data io.Reader) (*Config, error)

LoadConfigData loads the configuration data from a streaming reader

This is useful if for example the data is not stored in the local filesystem

func (Config) GetKeys

func (c Config) GetKeys(addr address.Address) (keys []signature.PrivateKey, exists bool, err error)

GetKeys gets the configured keys for a given address, and whether they are configured at all

Jump to

Keyboard shortcuts

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