tapcfg

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 47 Imported by: 2

Documentation

Overview

nolint:lll

Index

Constants

View Source
const (

	// DatabaseBackendSqlite is the name of the SQLite database backend.
	DatabaseBackendSqlite = "sqlite"

	// DatabaseBackendPostgres is the name of the Postgres database backend.
	DatabaseBackendPostgres = "postgres"
)

Variables

View Source
var (
	// DefaultTapdDir is the default directory where tapd tries to find its
	// configuration file and store its data. This is a directory in the
	// user's application data, for example:
	//   C:\Users\<username>\AppData\Local\Tapd on Windows
	//   ~/.tapd on Linux
	//   ~/Library/Application Support/Tapd on MacOS
	DefaultTapdDir = btcutil.AppDataDir("tapd", false)

	// DefaultConfigFile is the default full path of tapd's configuration
	// file.
	DefaultConfigFile = filepath.Join(DefaultTapdDir, defaultConfigFileName)
)

Functions

func CleanAndExpandPath

func CleanAndExpandPath(path string) string

CleanAndExpandPath expands environment variables and leading ~ in the passed path, cleans the result, and returns it. This function is taken from https://github.com/btcsuite/btcd

func ConfigureSubServer added in v0.4.0

func ConfigureSubServer(srv *tap.Server, cfg *Config, cfgLogger btclog.Logger,
	lndServices *lndclient.LndServices, litdIntegrated bool,
	mainErrChan chan<- error) error

ConfigureSubServer updates a Taproot Asset server with the given CLI config.

func CreateServerFromConfig

func CreateServerFromConfig(cfg *Config, cfgLogger btclog.Logger,
	shutdownInterceptor signal.Interceptor, enableChannelFeatures bool,
	mainErrChan chan<- error) (*tap.Server, error)

CreateServerFromConfig creates a new Taproot Asset server from the given CLI config.

Types

type AddrBookConfig added in v0.3.1

type AddrBookConfig struct {
	DisableSyncer bool `` /* 131-byte string literal not displayed */
}

AddrBookConfig is the config that houses any address Book related config values.

type ChainConfig

type ChainConfig struct {
	Network string `` /* 129-byte string literal not displayed */

	SigNetChallenge string `` /* 188-byte string literal not displayed */
}

ChainConfig houses the configuration options that govern which chain/network we operate on.

type Config

type Config struct {
	ShowVersion bool `long:"version" description:"Display version information and exit"`

	DebugLevel string `` /* 280-byte string literal not displayed */

	TapdDir    string `long:"tapddir" description:"The base directory that contains tapd's data, logs, configuration file, etc."`
	ConfigFile string `long:"configfile" description:"Path to configuration file"`

	DataDir        string `long:"datadir" description:"The directory to store tapd's data within"`
	LogDir         string `long:"logdir" description:"Directory to log output."`
	MaxLogFiles    int    `long:"maxlogfiles" description:"Maximum logfiles to keep (0 for no rotation)"`
	MaxLogFileSize int    `long:"maxlogfilesize" description:"Maximum logfile size in MB"`

	CPUProfile string `long:"cpuprofile" description:"Write CPU profile to the specified file"`
	Profile    string `long:"profile" description:"Enable HTTP profiling on either a port or host:port"`

	ReOrgSafeDepth int32 `` /* 139-byte string literal not displayed */

	// The following options are used to configure the proof courier.
	DefaultProofCourierAddr string                       `long:"proofcourieraddr" description:"Default proof courier service address."`
	HashMailCourier         *proof.HashMailCourierCfg    `group:"hashmailcourier" namespace:"hashmailcourier"`
	UniverseRpcCourier      *proof.UniverseRpcCourierCfg `group:"universerpccourier" namespace:"universerpccourier"`

	CustodianProofRetrievalDelay time.Duration `` /* 215-byte string literal not displayed */

	ChainConf *ChainConfig
	RpcConf   *RpcConfig

	Lnd *LndConfig `group:"lnd" namespace:"lnd"`

	DatabaseBackend string                `` /* 134-byte string literal not displayed */
	Sqlite          *tapdb.SqliteConfig   `group:"sqlite" namespace:"sqlite"`
	Postgres        *tapdb.PostgresConfig `group:"postgres" namespace:"postgres"`

	Universe *UniverseConfig `group:"universe" namespace:"universe"`

	AddrBook *AddrBookConfig `group:"address" namespace:"address"`

	Prometheus monitoring.PrometheusConfig `group:"prometheus" namespace:"prometheus"`

	Experimental *ExperimentalConfig `group:"experimental" namespace:"experimental"`

	// LogWriter is the root logger that all of the daemon's subloggers are
	// hooked up to.
	LogWriter *build.RotatingLogWriter

	// ActiveNetParams contains parameters of the target chain.
	ActiveNetParams chaincfg.Params
	// contains filtered or unexported fields
}

Config is the main config for the tapd cli command.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns all default values for the Config struct.

func LoadConfig

func LoadConfig(interceptor signal.Interceptor) (*Config, btclog.Logger, error)

LoadConfig initializes and parses the config using a config file and command line options.

The configuration proceeds as follows:

  1. Start with a default config with sane settings
  2. Pre-parse the command line to check for an alternative config file
  3. Load configuration file overwriting defaults with any specified options
  4. Parse CLI options and overwrite/add any specified options

func ValidateConfig

func ValidateConfig(cfg Config, cfgLogger btclog.Logger) (*Config, error)

ValidateConfig check the given configuration to be sane. This makes sure no illegal values or combination of values are set. All file system paths are normalized. The cleaned up config is returned on success.

type ExperimentalConfig added in v0.4.0

type ExperimentalConfig struct {
	Rfq rfq.CliConfig `group:"rfq" namespace:"rfq"`
}

ExperimentalConfig houses experimental tapd cli configuration options.

func (*ExperimentalConfig) Validate added in v0.4.0

func (c *ExperimentalConfig) Validate() error

Validate returns an error if the configuration is invalid.

type LndConfig

type LndConfig struct {
	Host string `long:"host" description:"lnd instance rpc address"`

	// MacaroonDir is the directory that contains all the macaroon files
	// required for the remote connection.
	MacaroonDir string `long:"macaroondir" description:"DEPRECATED: Use macaroonpath."`

	// MacaroonPath is the path to the single macaroon that should be used
	// instead of needing to specify the macaroon directory that contains
	// all of lnd's macaroons. The specified macaroon MUST have all
	// permissions that all the subservers use, otherwise permission errors
	// will occur.
	MacaroonPath string `` /* 304-byte string literal not displayed */

	TLSPath string `long:"tlspath" description:"Path to lnd tls certificate"`

	// RPCTimeout is the timeout we'll use for RPC requests to lnd.
	RPCTimeout time.Duration `` /* 190-byte string literal not displayed */
}

LndConfig is the main config we'll use to connect to the lnd node that backs up tapd.

type RpcConfig

type RpcConfig struct {
	RawRPCListeners  []string `long:"rpclisten" description:"Add an interface/port/socket to listen for RPC connections"`
	RawRESTListeners []string `long:"restlisten" description:"Add an interface/port/socket to listen for REST connections"`

	TLSCertPath        string        `long:"tlscertpath" description:"Path to write the TLS certificate for tapd's RPC and REST services"`
	TLSKeyPath         string        `long:"tlskeypath" description:"Path to write the TLS private key for tapd's RPC and REST services"`
	TLSExtraIPs        []string      `long:"tlsextraip" description:"Adds an extra ip to the generated certificate"`
	TLSExtraDomains    []string      `long:"tlsextradomain" description:"Adds an extra domain to the generated certificate"`
	TLSAutoRefresh     bool          `long:"tlsautorefresh" description:"Re-generate TLS certificate and key if the IPs or domains are changed"`
	TLSDisableAutofill bool          `` /* 173-byte string literal not displayed */
	TLSCertDuration    time.Duration `` /* 145-byte string literal not displayed */

	DisableRest    bool          `long:"norest" description:"Disable REST API"`
	DisableRestTLS bool          `long:"no-rest-tls" description:"Disable TLS for REST connections"`
	WSPingInterval time.Duration `` /* 189-byte string literal not displayed */
	WSPongWait     time.Duration `` /* 191-byte string literal not displayed */

	MacaroonPath string `long:"macaroonpath" description:"Path to write the admin macaroon for tapd's RPC and REST services if it doesn't exist"`
	NoMacaroons  bool   `` /* 133-byte string literal not displayed */

	AllowPublicUniProofCourier bool `long:"allow-public-uni-proof-courier" description:"Disable macaroon authentication for universe proof courier RPC endpoints."`
	AllowPublicStats           bool `long:"allow-public-stats" description:"Disable macaroon authentication for stats RPC endpoints."`

	RestCORS []string `long:"restcors" description:"Add an ip:port/hostname to allow cross origin access from. To allow all origins, set as \"*\"."`

	LetsEncryptDir    string `long:"letsencryptdir" description:"The directory to store Let's Encrypt certificates within"`
	LetsEncryptListen string `` /* 471-byte string literal not displayed */
	LetsEncryptDomain string `` /* 186-byte string literal not displayed */
	LetsEncryptEmail  string `long:"letsencryptemail" description:"The email address to use for Let's Encrypt account registration."`
}

RpcConfig houses the set of config options that affect how clients connect to the main RPC server.

type UniverseConfig

type UniverseConfig struct {
	SyncInterval time.Duration `long:"syncinterval" description:"Amount of time to wait between universe syncs. Valid time units are {s, m, h}."`

	FederationServers []string `` /* 186-byte string literal not displayed */

	NoDefaultFederation bool `` /* 176-byte string literal not displayed */

	SyncAllAssets bool `long:"sync-all-assets" description:"If set, the federation syncer will default to syncing all assets."`

	PublicAccess string `` /* 457-byte string literal not displayed */

	StatsCacheDuration time.Duration `` /* 135-byte string literal not displayed */

	UniverseQueriesPerSecond rate.Limit `` /* 178-byte string literal not displayed */

	UniverseQueriesBurst int `long:"req-burst-budget" description:"The burst budget for the universe query rate limiting."`

	MultiverseCaches *tapdb.MultiverseCacheConfig `group:"multiverse-caches" namespace:"multiverse-caches"`
}

UniverseConfig is the config that houses any Universe related config values.

Jump to

Keyboard shortcuts

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