signer

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 50 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

This section is empty.

Variables

This section is empty.

Functions

func Root

func Root(out, errOut io.Writer) *cobra.Command

func Serve

func Serve(p Params) error

Types

type Headers

type Headers http.Header

Headers is a text scalar for configuration and secret files. It accepts comma-separated Header: value entries, with CSV quoting for values containing commas. Header names are case-insensitive and repeated names retain all values.

func (Headers) MarshalText

func (h Headers) MarshalText() ([]byte, error)

MarshalText sorts names for deterministic secret-file comparisons and auth policy fingerprints, and quotes entries containing commas or quotation marks.

func (*Headers) UnmarshalText

func (h *Headers) UnmarshalText(text []byte) error

type KafkaBroker

type KafkaBroker url.URL

KafkaBroker supplies the default scheme before URL parsing, which would otherwise interpret host:port as scheme:opaque or reject bare IP addresses.

func (KafkaBroker) MarshalText

func (b KafkaBroker) MarshalText() ([]byte, error)

func (KafkaBroker) String

func (b KafkaBroker) String() string

func (*KafkaBroker) UnmarshalText

func (b *KafkaBroker) UnmarshalText(data []byte) error

type KafkaConfig

type KafkaConfig struct {
	Broker         KafkaBroker `name:"broker" required:"true" descr:"One Kafka bootstrap address (TLS by default; kafka:// selects plaintext)"`
	Topic          string      `name:"topic" required:"true" descr:"Kafka topic for signing events"`
	AuthMethod     string      `` /* 162-byte string literal not displayed */
	Username       string      `name:"username" optional:"true" secret:"true"`
	Password       string      `name:"password" optional:"true" secret:"true"`
	UsernameFile   string      `basepath:"source" name:"username-file" secretfor:"Username"`
	PasswordFile   string      `basepath:"source" name:"password-file" secretfor:"Password"`
	OutboxDB       string      `name:"outbox-db" file:"optional" default:"events.sqlite" descr:"Durable signer event SQLite path"`
	OutboxMaxBytes int64       `name:"outbox-max-bytes" default:"268435456" min:"1" descr:"Maximum pending event payload bytes"`
}

KafkaConfig is a named Boa parameter group: [Kafka] in TOML, --kafka-* flags, and LIVEPEER_SIGNER_KAFKA_* environment variables.

func (KafkaConfig) Validate

func (c KafkaConfig) Validate() error

type Params

type Params struct {
	ConfigFile string `` /* 151-byte string literal not displayed */
	nodeconfig.Settings
	Account                     *ethcommon.Address   `descr:"Keystore account address"`
	Kafka                       *KafkaConfig         `optional:"true"`
	AuthWebhookHeadersFile      string               `basepath:"source" name:"auth-webhook-headers-file" secretfor:"AuthWebhookHeaders"`
	AuthWebhook                 *url.URL             `name:"auth-webhook" optional:"true" secret:"true"`
	AuthWebhookFile             string               `basepath:"source" name:"auth-webhook-file" secretfor:"AuthWebhook"`
	AuthWebhookHeaders          Headers              `name:"auth-webhook-headers" optional:"true" secret:"true"`
	MaxTicketEV                 *big.Rat             `name:"max-ticket-ev" default:"3000000000000" descr:"Maximum expected ticket value in wei"`
	MaxBatchEV                  *big.Rat             `name:"max-batch-ev" default:"20000000000000" descr:"Maximum expected batch value in wei"`
	DepositMultiplier           int64                `name:"deposit-multiplier" default:"1" min:"1" descr:"Maximum face value is deposit divided by this value"`
	MaxHourlyPrice              *big.Rat             `name:"max-hourly-price" required:"true" descr:"Maximum live price in USD per hour"`
	MaxFixedPrice               *big.Rat             `name:"max-fixed-price" required:"true" descr:"Maximum fixed request price in USD"`
	WeiPerUSD                   *big.Rat             `name:"wei-per-usd" optional:"true" descr:"Fixed wei per USD conversion, mostly for testing"`
	ETHUSDFeed                  ethcommon.Address    `name:"eth-usd-feed" optional:"true" descr:"ETH/USD oracle address"`
	ETHUSDMaxAge                time.Duration        `name:"eth-usd-max-age" default:"2h" descr:"Maximum age of the ETH/USD oracle observation"`
	Listen                      netip.AddrPort       `name:"listen" default:"127.0.0.1:8937"`
	MetricsListen               netip.AddrPort       `name:"metrics-listen" default:"127.0.0.1:8938"`
	RPCURL                      *url.URL             `name:"rpc-url" secret:"true" required:"true"`
	RPCURLFile                  string               `basepath:"source" name:"rpc-url-file" secretfor:"RPCURL"`
	ChainID                     *uint64              `name:"chain-id" min:"1" descr:"Optional expected RPC chain ID"`
	Controller                  ethcommon.Address    `name:"controller-address" optional:"true" descr:"Livepeer Controller address"`
	KeystoreFile                string               `basepath:"source" optional:"true" descr:"Encrypted geth account JSON file; otherwise discover in keystore/"`
	KeystorePassword            *string              `secret:"true" required:"true" descr:"Keystore decryption password"`
	KeystorePasswordFile        string               `basepath:"source" secretfor:"KeystorePassword" descr:"Owner-only file containing the exact keystore password bytes"`
	Orchestrators               []boa.Text[*url.URL] `name:"orchestrators" optional:"true"`
	DiscoveryRefreshInterval    time.Duration        `default:"5m" descr:"Discovery inventory refresh interval"`
	DiscoveryMaxFailedRefreshes int                  `default:"6" min:"0" descr:"Consecutive failed discovery refreshes before eviction"`
	DiscoveryGrants             []string             `name:"discovery-grants" optional:"true" descr:"Private discovery IP[:port] or CIDR grants"`

	OrchestratorWebhook                *url.URL      `name:"orchestrator-webhook" optional:"true" secret:"true"`
	OrchestratorWebhookFile            string        `basepath:"source" name:"orchestrator-webhook-file" secretfor:"OrchestratorWebhook"`
	OrchestratorWebhookHeaders         Headers       `name:"orchestrator-webhook-headers" optional:"true" secret:"true"`
	OrchestratorWebhookHeadersFile     string        `basepath:"source" name:"orchestrator-webhook-headers-file" secretfor:"OrchestratorWebhookHeaders"`
	OrchestratorWebhookRefreshInterval time.Duration `` /* 134-byte string literal not displayed */
}

func (Params) Validate

func (p Params) Validate() error

type Service

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

func NewService

func NewService(key *eth.Key) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) RunDiscovery added in v1.0.3

func (s *Service) RunDiscovery(ctx context.Context)

RunDiscovery refreshes inventories until cancellation. When using a webhook, also run RunOrchestratorWebhook. Wait for both workers before Close.

func (*Service) RunOrchestratorWebhook added in v1.0.3

func (s *Service) RunOrchestratorWebhook(ctx context.Context)

RunOrchestratorWebhook refreshes immediately and periodically until ctx ends. Run it once after configuration, and wait for it to return before Close.

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Service) SetAuthWebhook

func (s *Service) SetAuthWebhook(endpoint *url.URL, headers Headers) error

func (*Service) SetDiscovery

func (s *Service) SetDiscovery(orchestrators []*url.URL, grants ...string) error

SetDiscovery configures discovery sources. Private destinations, including redirect targets, require a discovery grant. Configure before starting workers or serving requests.

func (*Service) SetDiscoveryPolling added in v1.0.3

func (s *Service) SetDiscoveryPolling(interval time.Duration, maxFailedRefreshes int) error

SetDiscoveryPolling configures polling before serving requests or starting workers.

func (*Service) SetOrchestratorWebhook added in v1.0.3

func (s *Service) SetOrchestratorWebhook(endpoint *url.URL, headers Headers, refreshInterval time.Duration) error

SetOrchestratorWebhook replaces static discovery sources with a cached webhook list. Call SetDiscovery first to configure destination grants, and configure the service before starting RunOrchestratorWebhook or serving requests.

func (*Service) SetPayerPolicy

func (s *Service) SetPayerPolicy(policy pm.PayerPolicy) error

func (*Service) SetPaymentChain

func (s *Service) SetPaymentChain(chain pm.PayerChain)

Jump to

Keyboard shortcuts

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