app

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptanceStorageConfig added in v0.0.18

type AcceptanceStorageConfig struct {
	Dir string
}

AcceptanceStorageConfig contains acceptance-specific storage paths

type AggregateManagerConfig added in v0.2.3

type AggregateManagerConfig struct {
	// PollInterval is how often the aggregation manager flushes its buffer.
	PollInterval time.Duration
	// MaxBatchSize is the maximum number of aggregates per batch submission.
	BatchSize uint
	JobQueue  JobQueueConfig
}

func DefaultAggregateManagerConfig added in v0.2.3

func DefaultAggregateManagerConfig() AggregateManagerConfig

DefaultAggregateManagerConfig returns an AggregateManagerConfig with sensible defaults.

type AggregationConfig added in v0.2.3

type AggregationConfig struct {
	CommP      CommpConfig
	Aggregator AggregatorConfig
	Manager    AggregateManagerConfig
}

AggregationConfig configures the PDP aggregation system.

func DefaultAggregationConfig added in v0.2.3

func DefaultAggregationConfig() AggregationConfig

DefaultAggregationConfig returns an AggregationConfig with sensible defaults.

type AggregatorConfig added in v0.2.3

type AggregatorConfig struct {
	JobQueue JobQueueConfig
}

type AggregatorStorageConfig

type AggregatorStorageConfig struct {
	Dir string
}

AggregatorStorageConfig contains aggregator-specific storage paths

type AllocationStorageConfig

type AllocationStorageConfig struct {
	Dir string
}

AllocationStorageConfig contains allocation-specific storage paths

type AppConfig

type AppConfig struct {
	// Identity configuration
	Identity IdentityConfig

	// Server configuration
	Server ServerConfig

	// Storage paths and directories
	Storage StorageConfig

	// Configuration specific for UCAN operations
	UCANService UCANServiceConfig

	// Configuration specific for PDP operations
	PDPService PDPServiceConfig

	// Telemetry configuration
	Telemetry TelemetryConfig

	//
	// Configs below are not exposed to users, they are hard coded with defaults
	// their purpose is to allow configurable configuration injection in tests
	// They may be exposed to users later
	Replicator ReplicatorConfig
}

AppConfig is the root configuration for the entire application

type BlobStorageConfig

type BlobStorageConfig struct {
	Dir    string
	TmpDir string
}

BlobStorageConfig contains blob-specific storage paths

type ClaimStorageConfig

type ClaimStorageConfig struct {
	Dir string
}

ClaimStorageConfig contains claim-specific storage paths

type CommpConfig added in v0.2.3

type CommpConfig struct {
	JobQueue JobQueueConfig
}

type ConsolidationStorageConfig added in v0.2.3

type ConsolidationStorageConfig struct {
	Dir string
}

ConsolidationStorageConfig contains consolidation-specific storage paths

type ContractAddresses added in v0.1.0

type ContractAddresses struct {
	Verifier         common.Address
	ProviderRegistry common.Address
	Service          common.Address
	ServiceView      common.Address
	Payments         common.Address
	USDFCToken       common.Address
}

type Credentials added in v0.1.1

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
}

Credentials configures access credentials for S3-compatible storage.

type DatabaseConfig added in v0.2.3

type DatabaseConfig struct {
	// Type is the database backend type: "sqlite" (default) or "postgres".
	Type DatabaseType

	Postgres PostgresConfig
}

DatabaseConfig contains database connection configuration.

func (DatabaseConfig) IsPostgres added in v0.2.3

func (c DatabaseConfig) IsPostgres() bool

IsPostgres returns true if using PostgreSQL backend.

func (DatabaseConfig) IsSQLite added in v0.2.3

func (c DatabaseConfig) IsSQLite() bool

IsSQLite returns true if using SQLite backend (or if type is empty/default).

type DatabaseType added in v0.2.3

type DatabaseType string

DatabaseType represents the database backend type.

const (
	// DatabaseTypeSQLite uses SQLite as the database backend (default).
	DatabaseTypeSQLite DatabaseType = "sqlite"
	// DatabaseTypePostgres uses PostgreSQL as the database backend.
	DatabaseTypePostgres DatabaseType = "postgres"
)

type EgressTrackerServiceConfig added in v0.0.15

type EgressTrackerServiceConfig struct {
	Connection           client.Connection
	Proofs               delegation.Proofs
	ReceiptsEndpoint     *url.URL
	MaxBatchSizeBytes    int64
	CleanupCheckInterval time.Duration
}

type EgressTrackerStorageConfig added in v0.0.15

type EgressTrackerStorageConfig struct {
	Dir string
}

EgressTrackerStorageConfig contains egress tracker store-specific storage paths

type ExternalServicesConfig

type ExternalServicesConfig struct {
	PrincipalMapping map[string]string

	Indexer       IndexingServiceConfig
	EgressTracker EgressTrackerServiceConfig
	Upload        UploadServiceConfig
	Publisher     PublisherServiceConfig
}

type GasConfig added in v0.2.3

type GasConfig struct {
	MaxFee    GasMaxFeeConfig
	RetryWait time.Duration
}

GasConfig configures per-message-type gas fee limits. Values are in wei. A value of 0 means no limit (default).

func DefaultGasConfig added in v0.2.3

func DefaultGasConfig() GasConfig

DefaultGasConfig returns a GasConfig with no limits set (all zero).

type GasMaxFeeConfig added in v0.2.3

type GasMaxFeeConfig struct {
	Prove         uint
	ProvingPeriod uint
	ProvingInit   uint
	AddRoots      uint
	Default       uint
}

GasMaxFeeConfig holds per-message-type maximum gas fees in wei.

type IdentityConfig

type IdentityConfig struct {
	// The principal signer for this service
	Signer principal.Signer
}

IdentityConfig contains identity-related configuration

type IndexingServiceConfig

type IndexingServiceConfig struct {
	Connection client.Connection
	Proofs     delegation.Proofs
}

IndexingServiceConfig contains indexing service connection and proof(s) for using the service

type JobQueueConfig added in v0.2.3

type JobQueueConfig struct {
	// The number of jobs the queue can process in parallel.
	Workers uint
	// The number of times a job can be retried before being considered failed.
	Retries uint
	// The duration between successive retries
	RetryDelay time.Duration
}

func DefaultJobQueueConfig added in v0.2.3

func DefaultJobQueueConfig() JobQueueConfig

DefaultJobQueueConfig returns a JobQueueConfig with sensible defaults.

type KeyStoreConfig added in v0.0.13

type KeyStoreConfig struct {
	Dir string
}

type PDPServiceConfig added in v0.0.13

type PDPServiceConfig struct {
	// Users address, which owns a proof set and sends messages to the ContractAddress
	OwnerAddress common.Address
	// The URL endpoint of a lotus node used for interaction with chain state.
	LotusEndpoint *url.URL
	// Signing service configuration used to sign PDP operations
	SigningService SigningServiceConfig
	// Smart contract addresses
	Contracts ContractAddresses
	// Filecoin chain ID (314 for mainnet, 314159 for calibration)
	ChainID *big.Int
	// PayerAddress is the Storacha Owned address that pays SPs
	PayerAddress common.Address
	// Aggregation contains aggregation manager configuration
	Aggregation AggregationConfig
	// Gas contains gas fee limit configuration
	Gas GasConfig
}

type PDPStoreConfig added in v0.0.13

type PDPStoreConfig struct {
	Dir string
}

type PostgresConfig added in v0.2.3

type PostgresConfig struct {
	// URL is the PostgreSQL connection string (only used when Type is "postgres").
	// Format: postgres://user:password@host:port/dbname?sslmode=disable
	URL url.URL
	// MaxOpenConns is the maximum number of open connections to the database.
	// Only used for PostgreSQL. Zero means use default (5).
	MaxOpenConns int
	// MaxIdleConns is the maximum number of idle connections in the pool.
	// Only used for PostgreSQL. Zero means use default (5).
	MaxIdleConns int
	// ConnMaxLifetime is the maximum amount of time a connection may be reused.
	// Only used for PostgreSQL. Zero means use default (30 minutes).
	ConnMaxLifetime time.Duration
}

type PublisherServiceConfig added in v0.0.13

type PublisherServiceConfig struct {
	// The public facing multiaddr of the publisher
	PublicMaddr multiaddr.Multiaddr
	// The address put into announce messages to tell indexers where to fetch advertisements from
	AnnounceMaddr multiaddr.Multiaddr
	// Address to tell indexers where to fetch blobs from
	BlobMaddr multiaddr.Multiaddr
	// Indexer URLs to send direct HTTP announcements to
	AnnounceURLs []url.URL
}

type PublisherStorageConfig

type PublisherStorageConfig struct {
	Dir string
}

PublisherStorageConfig contains publisher-specific storage paths

type ReceiptStorageConfig

type ReceiptStorageConfig struct {
	Dir string
}

ReceiptStorageConfig contains receipt-specific storage paths

type ReplicatorConfig added in v0.0.14

type ReplicatorConfig struct {
	// MaxRetries configures the maximum retries allowed by the replication queue
	MaxRetries uint
	// MaxWorkers configures the maximum workers ran by the replication queue
	MaxWorkers uint
	// MaxTimeout configures timeout for jobs before they can be re-evaluated
	MaxTimeout time.Duration
}

func DefaultReplicatorConfig added in v0.0.14

func DefaultReplicatorConfig() ReplicatorConfig

type ReplicatorStorageConfig

type ReplicatorStorageConfig struct{}

ReplicatorStorageConfig contains replicator-specific storage paths. Currently empty - SQLite paths are derived by providers.

type S3Config added in v0.2.3

type S3Config struct {
	Endpoint     string      // API URL (e.g., "minio.example.com:9000")
	BucketPrefix string      // Prefix for bucket names (e.g., "piri-" creates piri-blobs, piri-allocations, etc.)
	Credentials  Credentials // access credentials
	Insecure     bool        // set to true to disable SSL (for development only)
}

S3Config configures S3-compatible storage (e.g., MinIO, AWS S3). When set on StorageConfig, all supported stores use S3 with separate buckets.

type SchedulerConfig added in v0.0.13

type SchedulerConfig struct{}

SchedulerConfig contains scheduler-specific storage paths. Currently empty - SQLite paths are derived by providers.

type ServerConfig

type ServerConfig struct {
	Host      string
	Port      uint
	PublicURL url.URL
}

ServerConfig contains HTTP server settings

type SigningServiceConfig added in v0.0.17

type SigningServiceConfig struct {
	// Connection to the signing service backend.
	Connection client.Connection
	// Private key for in-process signing (if using local signer)
	// NB: this should only be used for development purposes
	PrivateKey *ecdsa.PrivateKey
}

SigningServiceConfig configures the signing service for PDP operations

type StashStoreConfig added in v0.0.13

type StashStoreConfig struct {
	Dir string
}

type StorageConfig

type StorageConfig struct {
	// Root directories
	DataDir string
	TempDir string

	// Database configuration (sqlite or postgres)
	Database DatabaseConfig

	// Global S3 config - when set, all supported stores use S3 with separate buckets
	// named using BucketPrefix (e.g., "piri-blobs", "piri-allocations")
	S3 *S3Config

	// Service-specific storage subdirectories
	Aggregator       AggregatorStorageConfig
	Blobs            BlobStorageConfig
	Claims           ClaimStorageConfig
	Publisher        PublisherStorageConfig
	Receipts         ReceiptStorageConfig
	EgressTracker    EgressTrackerStorageConfig
	Allocations      AllocationStorageConfig
	Acceptance       AcceptanceStorageConfig
	Replicator       ReplicatorStorageConfig
	KeyStore         KeyStoreConfig
	StashStore       StashStoreConfig
	SchedulerStorage SchedulerConfig
	PDPStore         PDPStoreConfig
	Consolidation    ConsolidationStorageConfig
}

StorageConfig contains all storage paths and directories

type TelemetryCollectorConfig added in v0.2.1

type TelemetryCollectorConfig struct {
	Endpoint        string
	Insecure        bool
	Headers         map[string]string
	PublishInterval time.Duration
}

type TelemetryConfig added in v0.2.1

type TelemetryConfig struct {
	Metrics                  []TelemetryCollectorConfig
	Traces                   []TelemetryCollectorConfig
	DisableStorachaAnalytics bool
}

type UCANServiceConfig added in v0.0.13

type UCANServiceConfig struct {
	Services              ExternalServicesConfig
	ProofSetID            uint64
	InsecureDIDResolution bool
}

type UploadServiceConfig added in v0.0.13

type UploadServiceConfig struct {
	Connection client.Connection
}

Jump to

Keyboard shortcuts

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