config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJSONConfig added in v0.4.0

func ParseJSONConfig(options *ContractsOptions) error

func ValidatePruneOptions added in v0.4.0

func ValidatePruneOptions(options PruneOptions) error

func ValidateServerOptions added in v0.1.3

func ValidateServerOptions(options *ServerOptions) error

Types

type AddRatesOptions added in v0.3.0

type AddRatesOptions struct {
	AdminOptions  RateRegistryAdminOptions `group:"Admin Options" namespace:"admin"`
	MessageFee    currency.PicoDollar      `                                        long:"message-fee"    description:"Message fee"            required:"true"`
	StorageFee    currency.PicoDollar      `                                        long:"storage-fee"    description:"Storage fee"            required:"true"`
	CongestionFee currency.PicoDollar      `                                        long:"congestion-fee" description:"Congestion fee"         required:"true"`
	TargetRate    uint64                   `                                        long:"target-rate"    description:"Target rate per minute" required:"true"`
}

type ApiOptions

type ApiOptions struct {
	Port     int `short:"p" long:"port"      description:"Port to listen on"      env:"XMTPD_API_PORT"      default:"5050"`
	HTTPPort int `          long:"http-port" description:"HTTP Port to listen on" env:"XMTPD_HTTP_API_PORT" default:"5055"`
}

type AppChainOptions added in v0.4.0

type AppChainOptions struct {
	RPCURL                           string        `` /* 131-byte string literal not displayed */
	WssURL                           string        `` /* 131-byte string literal not displayed */
	ChainID                          int           `` /* 189-byte string literal not displayed */
	MaxChainDisconnectTime           time.Duration `` /* 187-byte string literal not displayed */
	BackfillBlockPageSize            uint64        `` /* 187-byte string literal not displayed */
	GroupMessageBroadcasterAddress   string        `` /* 155-byte string literal not displayed */
	IdentityUpdateBroadcasterAddress string        `` /* 157-byte string literal not displayed */
	DeploymentBlock                  uint64        `` /* 185-byte string literal not displayed */
}

type ChainConfig added in v0.4.0

type ChainConfig struct {
	AppChainDeploymentBlock          int    `json:"appChainDeploymentBlock"`
	AppChainID                       int    `json:"appChainId"`
	DistributionManager              string `json:"distributionManager"`
	GroupMessageBroadcaster          string `json:"groupMessageBroadcaster"`
	IdentityUpdateBroadcaster        string `json:"identityUpdateBroadcaster"`
	NodeRegistry                     string `json:"nodeRegistry"`
	PayerRegistry                    string `json:"payerRegistry"`
	PayerReportManager               string `json:"payerReportManager"`
	RateRegistry                     string `json:"rateRegistry"`
	SettlementChainDeploymentBlock   int    `json:"settlementChainDeploymentBlock"`
	SettlementChainID                int    `json:"settlementChainId"`
	SettlementChainParameterRegistry string `json:"settlementChainParameterRegistry"`
}

type ContractsOptions

type ContractsOptions struct {
	AppChain        AppChainOptions        `group:"Application Chain Options" namespace:"app-chain"`
	SettlementChain SettlementChainOptions `group:"Settlement Chain Options"  namespace:"settlement-chain"`

	ConfigFilePath string `long:"config-file-path" env:"XMTPD_CONTRACTS_CONFIG_FILE_PATH" description:"Path to the JSON contracts config file"`
	ConfigJson     string `long:"config-json"      env:"XMTPD_CONTRACTS_CONFIG_JSON"      description:"JSON contracts config"`
}

func ContractOptionsFromEnv added in v0.5.0

func ContractOptionsFromEnv(filePath string) (ContractsOptions, error)

type DbOptions

type DbOptions struct {
	ReaderConnectionString string        `long:"reader-connection-string" env:"XMTPD_DB_READER_CONNECTION_STRING" description:"Reader connection string"`
	WriterConnectionString string        `long:"writer-connection-string" env:"XMTPD_DB_WRITER_CONNECTION_STRING" description:"Writer connection string"`
	ReadTimeout            time.Duration `` /* 146-byte string literal not displayed */
	WriteTimeout           time.Duration `` /* 146-byte string literal not displayed */
	MaxOpenConns           int           `` /* 145-byte string literal not displayed */
	WaitForDB              time.Duration `` /* 146-byte string literal not displayed */
	NameOverride           string        `` /* 160-byte string literal not displayed */
}

type DebugOptions added in v0.5.0

type DebugOptions struct {
	Enable bool `long:"enable" env:"XMTPD_DEBUG_ENABLE" description:"Enable the pprof debug server"`
	Port   int  `long:"port"   env:"XMTPD_DEBUG_PORT"   description:"Port to listen on"             default:"6060"`
}

type GatewayConfig added in v0.5.0

type GatewayConfig struct {
	API       ApiOptions       `group:"API Options"            namespace:"api"`
	Contracts ContractsOptions `group:"Contracts Options"      namespace:"contracts"`
	Log       LogOptions       `group:"Log Options"            namespace:"log"`
	Metrics   MetricsOptions   `group:"Metrics Options"        namespace:"metrics"`
	Payer     PayerOptions     `group:"Payer Options"          namespace:"payer"`
	Redis     RedisOptions     `group:"Redis Options"          namespace:"redis"`
	Tracing   TracingOptions   `group:"DD APM Tracing Options" namespace:"tracing"`
}

type GenerateKeyOptions

type GenerateKeyOptions struct{}

type GetAllNodesOptions

type GetAllNodesOptions struct {
	OutFile string `long:"out-file" description:"File to write the nodes to"`
}

type GetMaxCanonicalOptions added in v0.4.0

type GetMaxCanonicalOptions struct{}

type GetNodeOptions added in v0.3.0

type GetNodeOptions struct {
	NodeId uint32 `long:"node-id" description:"NodeId of the node to get" required:"true"`
}

type GetPubKeyOptions

type GetPubKeyOptions struct {
	PrivateKey string `long:"private-key" description:"Private key you want the public key for" required:"true"`
}

type GetRatesOptions added in v0.4.0

type GetRatesOptions struct{}

type GlobalOptions added in v0.1.3

type GlobalOptions struct {
	Contracts ContractsOptions `group:"Contracts Options" namespace:"contracts"`
	Log       LogOptions       `group:"Log Options"       namespace:"log"`
}

type IdentityUpdatesStressOptions added in v0.4.0

type IdentityUpdatesStressOptions struct {
	PrivateKey string `long:"private-key" description:"Private key of the admin to administer the node" required:"true"`
	Contract   string `long:"contract"    description:"Contract address"`
	Rpc        string `long:"rpc"         description:"RPC URL"`
	Count      int    `long:"count"       description:"Number of transactions to send"`
	Async      bool   `long:"async"       description:"Send transactions asynchronously"`
}

type IndexerOptions added in v0.1.1

type IndexerOptions struct {
	Enable bool `long:"enable" env:"XMTPD_INDEXER_ENABLE" description:"Enable the indexer"`
}

type LogOptions

type LogOptions struct {
	LogLevel    string `` /* 208-byte string literal not displayed */
	LogEncoding string `` /* 211-byte string literal not displayed */
}

type MetricsOptions

type MetricsOptions struct {
	Enable  bool   `long:"enable"          env:"XMTPD_METRICS_ENABLE"          description:"Enable the metrics server"`
	Address string `` /* 134-byte string literal not displayed */
	Port    int    `` /* 129-byte string literal not displayed */
}

MetricsOptions are settings used to start a prometheus server

type MigrateNodesOptions added in v0.3.0

type MigrateNodesOptions struct {
	AdminOptions NodeRegistryAdminOptions `group:"Admin Options" namespace:"admin"`
	InFile       string                   `                                        long:"in-file" description:"File to read the nodes from"`
}

type MigrationClientOptions added in v0.5.0

type MigrationClientOptions struct {
	Enable     bool   `long:"enable"       env:"XMTPD_MIGRATION_CLIENT_ENABLE"       description:"Enable the migration client"`
	FromNodeID uint32 `long:"from-node-id" env:"XMTPD_MIGRATION_CLIENT_FROM_NODE_ID" description:"Node ID to start migration from" default:"100"`
}

type MigrationServerOptions added in v0.5.0

type MigrationServerOptions struct {
	Enable bool `long:"enable" env:"XMTPD_MIGRATION_SERVER_ENABLE" description:"Enable the migration server"`

	PayerPrivateKey string `long:"payer-private-key" env:"XMTPD_MIGRATION_PAYER_PRIVATE_KEY" description:"Private key used to sign payer envelopes"`
	NodeSigningKey  string `long:"node-signing-key"  env:"XMTPD_MIGRATION_NODE_SIGNING_KEY"  description:"Private key used to sign originator envelopes"`

	ReaderConnectionString string        `long:"reader-connection-string" env:"XMTPD_MIGRATION_DB_READER_CONNECTION_STRING" description:"Reader connection string"`
	ReaderTimeout          time.Duration `` /* 156-byte string literal not displayed */
	WaitForDB              time.Duration `` /* 156-byte string literal not displayed */
	BatchSize              int32         `` /* 157-byte string literal not displayed */
	PollInterval           time.Duration `` /* 156-byte string literal not displayed */
	Namespace              string        `` /* 153-byte string literal not displayed */

	Contracts ContractsOptions `group:"Contracts Options" namespace:"contracts"`
}

type MlsValidationOptions

type MlsValidationOptions struct {
	GrpcAddress string `long:"grpc-address" env:"XMTPD_MLS_VALIDATION_GRPC_ADDRESS" description:"Address of the MLS validation service"`
}

type NetworkAdminOptions added in v0.3.0

type NetworkAdminOptions struct {
	AdminOptions NodeRegistryAdminOptions `group:"Admin Options" namespace:"admin"`
	NodeId       uint32                   `                                        long:"node-id" description:"NodeId to add to the network"`
}

type NodeRegistryAdminOptions added in v0.3.0

type NodeRegistryAdminOptions struct {
	AdminPrivateKey string `long:"private-key" description:"Private key of the admin to administer the node" required:"true"`
}

NodeRegistryAdminOptions is the options for the node registry admin. It is intended to be used as a namespace inside a command option struct.

type NodeRegistryManagerOptions added in v0.3.0

type NodeRegistryManagerOptions struct {
	NodePrivateKey string `long:"manager-private-key" description:"Private key of the node manager"`
	NodeId         int64  `long:"node-id"             description:"NodeId of the node to administer"`
}

NodeRegistryManagerOptions is the options for the node registry manager. It is intended to be used as a namespace inside a command option struct.

type PayerOptions

type PayerOptions struct {
	PrivateKey string `long:"private-key" env:"XMTPD_PAYER_PRIVATE_KEY" description:"Private key used to sign blockchain transactions"`
	Enable     bool   `long:"enable"      env:"XMTPD_PAYER_ENABLE"      description:"Enable the payer API"`
}

type PruneConfig added in v0.4.0

type PruneConfig struct {
	MaxCycles int   `long:"max-prune-cycles" env:"XMTPD_PRUNE_MAX_CYCLES" description:"Maximum pruning cycles" default:"10"`
	BatchSize int32 `long:"batch-size"       env:"XMTPD_PRUNE_BATCH_SIZE" description:"Batch size"             default:"10000"`
	DryRun    bool  `long:"dry-run"          env:"XMTPD_PRUNE_DRY_RUN"    description:"Dry run mode"`
}

type PruneOptions added in v0.4.0

type PruneOptions struct {
	DB          DbOptions        `group:"Database Options"  namespace:"db"`
	Log         LogOptions       `group:"Log Options"       namespace:"log"`
	Signer      SignerOptions    `group:"Signer Options"    namespace:"signer"`
	Contracts   ContractsOptions `group:"Contracts Options" namespace:"contracts"`
	PruneConfig PruneConfig      `group:"Prune Options"     namespace:"prune"`
}

type RateRegistryAdminOptions added in v0.4.0

type RateRegistryAdminOptions struct {
	AdminPrivateKey string `long:"private-key" description:"Private key of the admin to administer the rates" required:"true"`
}

RateRegistryAdminOptions is the options for the rate registry admin. It is intended to be used as a namespace inside a command option struct.

type RedisOptions added in v0.5.0

type RedisOptions struct {
	RedisUrl  string `long:"redis-url"  env:"XMTPD_REDIS_URL"        description:"Redis URL"`
	KeyPrefix string `long:"key-prefix" env:"XMTPD_REDIS_KEY_PREFIX" description:"Redis key prefix" default:"xmtpd:"`
}

type ReflectionOptions

type ReflectionOptions struct {
	Enable bool `long:"enable" env:"XMTPD_REFLECTION_ENABLE" description:"Enable GRPC reflection"`
}

ReflectionOptions are settings controlling collection of GRPC reflection settings.

type RegisterNodeOptions

type RegisterNodeOptions struct {
	AdminOptions  NodeRegistryAdminOptions `group:"Admin Options" namespace:"admin"`
	HttpAddress   string                   `` /* 162-byte string literal not displayed */
	OwnerAddress  string                   `` /* 162-byte string literal not displayed */
	SigningKeyPub string                   `` /* 162-byte string literal not displayed */
	Force         bool                     `` /* 163-byte string literal not displayed */
}

type ReplicationOptions added in v0.1.1

type ReplicationOptions struct {
	Enable                bool          `long:"enable"                   env:"XMTPD_REPLICATION_ENABLE"           description:"Enable the replication API"`
	SendKeepAliveInterval time.Duration `` /* 156-byte string literal not displayed */
}

type ServerOptions

type ServerOptions struct {
	API             ApiOptions             `group:"API Options"              namespace:"api"`
	Contracts       ContractsOptions       `group:"Contracts Options"        namespace:"contracts"`
	DB              DbOptions              `group:"Database Options"         namespace:"db"`
	Log             LogOptions             `group:"Log Options"              namespace:"log"`
	Indexer         IndexerOptions         `group:"Indexer Options"          namespace:"indexer"`
	Metrics         MetricsOptions         `group:"Metrics Options"          namespace:"metrics"`
	MlsValidation   MlsValidationOptions   `group:"MLS Validation Options"   namespace:"mls-validation"`
	Reflection      ReflectionOptions      `group:"Reflection Options"       namespace:"reflection"`
	Replication     ReplicationOptions     `group:"Replication Options"      namespace:"replication"`
	Signer          SignerOptions          `group:"Signer Options"           namespace:"signer"`
	Sync            SyncOptions            `group:"Sync Options"             namespace:"sync"`
	Tracing         TracingOptions         `group:"DD APM Tracing Options"   namespace:"tracing"`
	MigrationServer MigrationServerOptions `group:"Migration Server Options" namespace:"migration-server"`
	MigrationClient MigrationClientOptions `group:"Migration Client Options" namespace:"migration-client"`
	Debug           DebugOptions           `group:"Debug Options"            namespace:"debug"`
	Version         bool                   `` /* 131-byte string literal not displayed */
}

type SetHttpAddressOptions added in v0.3.0

type SetHttpAddressOptions struct {
	NodeManagerOptions NodeRegistryManagerOptions `group:"Node Manager Options" namespace:"node-manager"`
	Address            string                     `                                                      long:"address" description:"New HTTP address"`
	NodeId             uint32                     `                                                      long:"node-id" description:"NodeId to add to the network"`
}

type SetMaxCanonicalOptions added in v0.4.0

type SetMaxCanonicalOptions struct {
	AdminOptions NodeRegistryAdminOptions `group:"Admin Options" namespace:"admin"`
	Limit        uint8                    `                                        long:"limit" description:"Limit of max canonical nodes" required:"true"`
}

type SettlementChainOptions added in v0.4.0

type SettlementChainOptions struct {
	RPCURL                      string        `` /* 130-byte string literal not displayed */
	WssURL                      string        `` /* 130-byte string literal not displayed */
	ChainID                     int           `` /* 188-byte string literal not displayed */
	MaxChainDisconnectTime      time.Duration `` /* 187-byte string literal not displayed */
	BackfillBlockPageSize       uint64        `` /* 186-byte string literal not displayed */
	NodeRegistryAddress         string        `` /* 142-byte string literal not displayed */
	NodeRegistryRefreshInterval time.Duration `` /* 186-byte string literal not displayed */
	RateRegistryAddress         string        `` /* 142-byte string literal not displayed */
	RateRegistryRefreshInterval time.Duration `` /* 187-byte string literal not displayed */
	ParameterRegistryAddress    string        `` /* 147-byte string literal not displayed */
	PayerRegistryAddress        string        `` /* 143-byte string literal not displayed */
	PayerReportManagerAddress   string        `` /* 149-byte string literal not displayed */
	DeploymentBlock             uint64        `` /* 184-byte string literal not displayed */
}

type SignerOptions

type SignerOptions struct {
	PrivateKey string `long:"private-key" env:"XMTPD_SIGNER_PRIVATE_KEY" description:"Private key used to sign messages"`
}

type SyncOptions added in v0.1.1

type SyncOptions struct {
	Enable bool `long:"enable" env:"XMTPD_SYNC_ENABLE" description:"Enable the sync server"`
}

type TracingOptions

type TracingOptions struct {
	Enable bool `long:"enable" env:"XMTPD_TRACING_ENABLE" description:"Enable DD APM trace collection"`
}

TracingOptions are settings controlling collection of DD APM traces and error tracking.

type WatcherOptions added in v0.4.0

type WatcherOptions struct {
	Contract string `long:"contract" description:"Contract address" required:"true"`
	Wss      string `long:"wss"      description:"WSS URL"          required:"true"`
}

Jump to

Keyboard shortcuts

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