Documentation
¶
Index ¶
- func EnsureDefaultConfig(homeDir string) error
- func MarkReadyHandler() engine.TaskHandler
- type ConfigPatcher
- type EC2ClientFactory
- type EC2DescribeAPI
- type EC2TagsSource
- type GenesisFetcher
- type GenesisS3Config
- type HTTPDoer
- type NodeIDQuerier
- type PeerDiscoverer
- type PeerSource
- type S3ClientFactory
- type S3GetObjectAPI
- type S3Uploader
- type S3UploaderFactory
- type SnapshotConfig
- type SnapshotRestorer
- type SnapshotUploadConfig
- type SnapshotUploader
- type StateSyncConfig
- type StateSyncConfigurer
- type StaticSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDefaultConfig ¶
EnsureDefaultConfig creates the seid home directory structure and writes a minimal default config.toml if one does not already exist. The default is embedded from defaults/config.toml.
func MarkReadyHandler ¶
func MarkReadyHandler() engine.TaskHandler
MarkReadyHandler returns a no-op TaskHandler. When it succeeds, the engine marks itself as ready.
Types ¶
type ConfigPatcher ¶
type ConfigPatcher struct {
// contains filtered or unexported fields
}
ConfigPatcher applies generic TOML merge-patches to seid configuration files.
func NewConfigPatcher ¶
func NewConfigPatcher(homeDir string) *ConfigPatcher
NewConfigPatcher creates a patcher targeting the given home directory.
func (*ConfigPatcher) Handler ¶
func (p *ConfigPatcher) Handler() engine.TaskHandler
Handler returns an engine.TaskHandler that reads a "files" map from params and merge-patches each named file under homeDir/config/.
Expected params format:
{
"files": {
"config.toml": {"p2p": {"persistent-peers": "..."}},
"app.toml": {"pruning": "nothing"}
}
}
func (*ConfigPatcher) PatchFiles ¶ added in v0.0.7
PatchFiles merge-patches each named TOML file under homeDir/config/.
type EC2ClientFactory ¶
type EC2ClientFactory func(ctx context.Context, region string) (EC2DescribeAPI, error)
EC2ClientFactory builds an EC2 client for a given region.
type EC2DescribeAPI ¶
type EC2DescribeAPI interface {
DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
}
EC2DescribeAPI abstracts the EC2 DescribeInstances call for testing.
func DefaultEC2ClientFactory ¶
func DefaultEC2ClientFactory(ctx context.Context, region string) (EC2DescribeAPI, error)
DefaultEC2ClientFactory creates a real EC2 client using Pod Identity credentials.
type EC2TagsSource ¶
type EC2TagsSource struct {
Region string
Tags map[string]string
EC2Factory EC2ClientFactory
QueryNodeID NodeIDQuerier
}
EC2TagsSource discovers peers by querying EC2 for running instances matching the configured tags.
type GenesisFetcher ¶
type GenesisFetcher struct {
// contains filtered or unexported fields
}
GenesisFetcher downloads genesis.json from S3 and writes it to the config directory.
func NewGenesisFetcher ¶
func NewGenesisFetcher(homeDir string, factory S3ClientFactory) *GenesisFetcher
NewGenesisFetcher creates a fetcher targeting the given home directory.
func (*GenesisFetcher) Fetch ¶
func (g *GenesisFetcher) Fetch(ctx context.Context, cfg GenesisS3Config) error
Fetch downloads genesis.json from S3, skipping if the marker file exists.
func (*GenesisFetcher) Handler ¶
func (g *GenesisFetcher) Handler() engine.TaskHandler
Handler returns an engine.TaskHandler that parses params and delegates to Fetch.
type GenesisS3Config ¶
GenesisS3Config holds S3 coordinates for genesis.json download.
type NodeIDQuerier ¶
NodeIDQuerier fetches a Tendermint node ID from an IP address.
type PeerDiscoverer ¶
type PeerDiscoverer struct {
// contains filtered or unexported fields
}
PeerDiscoverer resolves peers from multiple sources and writes them to a file.
func NewPeerDiscoverer ¶
func NewPeerDiscoverer(homeDir string, ec2Factory EC2ClientFactory, nodeIDQuerier NodeIDQuerier) *PeerDiscoverer
NewPeerDiscoverer creates a discoverer targeting the given home directory.
func (*PeerDiscoverer) Handler ¶
func (d *PeerDiscoverer) Handler() engine.TaskHandler
Handler returns an engine.TaskHandler that parses peer source params and dispatches to the appropriate PeerSource implementations.
Expected params format:
{"sources": [{"type": "ec2Tags", "region": "...", "tags": {...}}, ...]}
type PeerSource ¶
PeerSource discovers peers from a specific source type.
type S3ClientFactory ¶
type S3ClientFactory func(ctx context.Context, region string) (S3GetObjectAPI, error)
S3ClientFactory builds an S3 client for a given region.
type S3GetObjectAPI ¶
type S3GetObjectAPI interface {
GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}
S3GetObjectAPI abstracts the S3 GetObject call for testing.
func DefaultS3ClientFactory ¶
func DefaultS3ClientFactory(ctx context.Context, region string) (S3GetObjectAPI, error)
DefaultS3ClientFactory creates a real S3 client using IRSA credentials.
type S3Uploader ¶
type S3Uploader interface {
UploadObject(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error)
}
S3Uploader abstracts the transfermanager upload call for testing.
func DefaultS3UploaderFactory ¶
func DefaultS3UploaderFactory(ctx context.Context, region string) (S3Uploader, error)
DefaultS3UploaderFactory creates a transfermanager.Client backed by a real S3 client.
type S3UploaderFactory ¶
type S3UploaderFactory func(ctx context.Context, region string) (S3Uploader, error)
S3UploaderFactory builds an S3Uploader for a given region.
type SnapshotConfig ¶
SnapshotConfig holds S3 coordinates for snapshot download.
type SnapshotRestorer ¶
type SnapshotRestorer struct {
// contains filtered or unexported fields
}
SnapshotRestorer downloads and extracts a snapshot archive from S3.
func NewSnapshotRestorer ¶
func NewSnapshotRestorer(homeDir string, factory S3ClientFactory) *SnapshotRestorer
NewSnapshotRestorer creates a restorer targeting the given home directory.
func (*SnapshotRestorer) Handler ¶
func (r *SnapshotRestorer) Handler() engine.TaskHandler
Handler returns an engine.TaskHandler that adapts the map[string]any params to a typed SnapshotConfig and delegates to Restore.
func (*SnapshotRestorer) Restore ¶
func (r *SnapshotRestorer) Restore(ctx context.Context, cfg SnapshotConfig) error
Restore downloads and extracts the snapshot, skipping if the marker file exists. It reads latest.txt from the prefix to resolve the current snapshot object key.
type SnapshotUploadConfig ¶
SnapshotUploadConfig holds the parameters for the snapshot upload task.
type SnapshotUploader ¶
type SnapshotUploader struct {
// contains filtered or unexported fields
}
SnapshotUploader scans for locally produced Tendermint state-sync snapshots and uploads new ones to S3.
func NewSnapshotUploader ¶
func NewSnapshotUploader(homeDir string, factory S3UploaderFactory) *SnapshotUploader
NewSnapshotUploader creates an uploader targeting the given home directory.
func (*SnapshotUploader) Handler ¶
func (u *SnapshotUploader) Handler() engine.TaskHandler
Handler returns an engine.TaskHandler for the snapshot-upload task.
func (*SnapshotUploader) Upload ¶
func (u *SnapshotUploader) Upload(ctx context.Context, cfg SnapshotUploadConfig) error
Upload finds the latest complete snapshot, archives it, and streams it to S3. It picks the second-to-latest snapshot height to avoid uploading an in-progress snapshot. If the snapshot has already been uploaded (tracked via a local state file), it no-ops.
The archive is streamed through an io.Pipe so it never needs to be buffered entirely in memory; the transfermanager handles multipart upload automatically.
type StateSyncConfig ¶
StateSyncConfig holds the trust point and RPC servers for Tendermint state sync.
type StateSyncConfigurer ¶
type StateSyncConfigurer struct {
// contains filtered or unexported fields
}
StateSyncConfigurer discovers a trust point from peers and writes the config file.
func NewStateSyncConfigurer ¶
func NewStateSyncConfigurer(homeDir string, client HTTPDoer) *StateSyncConfigurer
NewStateSyncConfigurer creates a configurer targeting the given home directory.
func (*StateSyncConfigurer) Configure ¶
func (s *StateSyncConfigurer) Configure(ctx context.Context) error
Configure reads persistent-peers from config.toml, queries a peer for a trust point, and writes the state sync settings back to config.toml.
func (*StateSyncConfigurer) Handler ¶
func (s *StateSyncConfigurer) Handler() engine.TaskHandler
Handler returns an engine.TaskHandler.
type StaticSource ¶
type StaticSource struct {
Addresses []string
}
StaticSource returns a fixed list of peer addresses.