tapconfig

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TapdMacaroonLocation is the value we use for the tapd macaroons'
	// "Location" field when baking them.
	TapdMacaroonLocation = "tapd"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DebugLevel string

	// Version is the tapd version string included in RPC responses.
	Version string

	// RuntimeID is a pseudo-random ID that is generated when the server
	// starts. It is used to identify the server to itself, to avoid
	// connecting to itself as a federation member.
	RuntimeID int64

	// EnableChannelFeatures indicates that tapd is running inside the
	// Lightning Terminal daemon (litd) and can provide Taproot Asset
	// channel functionality.
	EnableChannelFeatures bool

	ChainParams address.ChainParams

	Lnd *lndclient.LndServices

	// MacaroonBaker validates bake requests and mints new macaroons.
	MacaroonBaker rpcperms.MacaroonBaker

	SignalInterceptor signal.Interceptor

	MboxServerConfig authmailbox.ServerConfig

	ReOrgWatcher *tapgarden.ReOrgWatcher

	AssetMinter tapgarden.Planter

	AssetCustodian *tapgarden.Custodian

	ChainBridge tapgarden.ChainBridge

	AddrBook *address.Book

	// AddrBookDisableSyncer is a flag which, if true, will prevent the
	// daemon from trying to sync issuance proofs for unknown assets when
	// creating an address.
	AddrBookDisableSyncer bool

	DefaultProofCourierAddr *url.URL

	ProofArchive proof.Archiver

	AssetWallet tapfreighter.Wallet

	CoinSelect *tapfreighter.CoinSelect

	ChainPorter tapfreighter.Porter

	// DisableSweepOrphanUtxos disables sweeping orphaned UTXOs into
	// anchor transactions for sends and burns.
	DisableSweepOrphanUtxos bool

	// FsmDaemonAdapters is a set of adapters that allow a state machine to
	// interact with external daemons.
	FsmDaemonAdapters *lndservices.LndFsmDaemonAdapters

	// SupplyCommitManager is a service that is used to manage supply
	// commitments for assets. Supply commitments are issuer published
	// attestations of the total supply of an asset.
	SupplyCommitManager *supplycommit.Manager

	IgnoreChecker *tapdb.CachingIgnoreChecker

	// SupplyVerifyManager is a service that is used to verify supply
	// commitments for assets. Supply commitments are issuer published
	// attestations of the total supply of an asset.
	SupplyVerifyManager *supplyverifier.Manager

	UniverseArchive *universe.Archive

	UniverseSyncer universe.Syncer

	UniverseFederation *universe.FederationEnvoy

	// UniFedSyncAllAssets is a flag that indicates whether the
	// universe federation syncer should default to syncing all assets.
	UniFedSyncAllAssets bool

	RfqManager *rfq.Manager

	PriceOracle rfq.PriceOracle

	PriceOracleSendPeerID bool

	UniverseStats universe.Telemetry

	AuxLeafSigner *tapchannel.AuxLeafSigner

	AuxFundingController *tapchannel.FundingController

	AuxTrafficShaper *tapchannel.AuxTrafficShaper

	AuxChanNegotiator *tapfeatures.AuxChannelNegotiator

	AuxInvoiceManager *tapchannel.AuxInvoiceManager

	AuxChanCloser *tapchannel.AuxChanCloser

	AuxSweeper *tapchannel.AuxSweeper

	// UniversePublicAccess is a field that indicates the status of public
	// access (i.e. read/write) to the universe server.
	//
	// NOTE: This field does not influence universe federation syncing
	// behaviour.
	UniversePublicAccess UniversePublicAccessStatus

	// UniverseQueriesPerSecond is the maximum number of queries per
	// second across the set of active universe queries that is permitted.
	// Anything above this starts to get rate limited.
	UniverseQueriesPerSecond rate.Limit

	// UniverseQueriesBurst is the burst budget for the universe query rate
	// limiting.
	UniverseQueriesBurst int

	Prometheus monitoring.PrometheusConfig

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

	// LogMgr is the sublogger manager that is used to create subloggers for
	// the daemon.
	LogMgr *build.SubLoggerManager

	// TLSHealthCheck contains the configuration for the TLS certificate
	// health check. If nil or Attempts is 0, the check is disabled.
	TLSHealthCheck *healthcheck.TLSCheckConfig

	*RPCConfig

	*DatabaseConfig
}

Config is the main config of the Taproot Assets server.

type DatabaseConfig

type DatabaseConfig struct {
	RootKeyStore *tapdb.RootKeyStore

	MintingStore tapgarden.MintingStore

	AssetStore *tapdb.AssetStore

	TapAddrBook *tapdb.TapAddressBook

	Multiverse *tapdb.MultiverseStore

	FederationDB *tapdb.UniverseFederationDB
}

DatabaseConfig is the config that holds all the persistence related structs and interfaces needed for tapd to function.

type ListenerCfg

type ListenerCfg struct {
	// RPCListeners can be set to the listeners to use for the RPC server.
	// If empty a regular network listener will be created.
	RPCListeners []*ListenerWithSignal
}

ListenerCfg is a wrapper around custom listeners that can be passed to tapd when starting its RPC server.

type ListenerWithSignal

type ListenerWithSignal struct {
	net.Listener

	// Ready will be closed by the server listening on Listener.
	Ready chan struct{}

	// MacChan is an optional way to pass the admin macaroon to the program
	// that started the daemon. The channel should be buffered to avoid the
	// daemon being blocked on sending to the channel.
	MacChan chan []byte
}

ListenerWithSignal is a net.Listener that has an additional Ready channel that will be closed when a server starts listening.

type RPCConfig

type RPCConfig struct {
	LisCfg *ListenerCfg

	RPCListeners []net.Addr

	RESTListeners []net.Addr

	GrpcServerOpts []grpc.ServerOption

	RestDialOpts []grpc.DialOption

	RestListenFunc func(net.Addr) (net.Listener, error)

	WSPingInterval time.Duration

	WSPongWait time.Duration

	RestCORS []string

	NoMacaroons bool

	MacaroonPath string

	AllowPublicUniProofCourier bool

	AllowPublicStats bool

	LetsEncryptDir string

	LetsEncryptListen string

	LetsEncryptDomain string

	LetsEncryptEmail string
}

RPCConfig is a sub-config of the main server that packages up everything needed to start the RPC server.

type UniversePublicAccessStatus

type UniversePublicAccessStatus string

UniversePublicAccessStatus is a type that indicates the status of public access to the universe server.

const (
	// UniversePublicAccessStatusNone indicates that no public access is
	// granted.
	UniversePublicAccessStatusNone UniversePublicAccessStatus = ""

	// UniversePublicAccessStatusRead indicates that read access is granted.
	UniversePublicAccessStatusRead UniversePublicAccessStatus = "r"

	// UniversePublicAccessStatusWrite indicates that write access is
	// granted.
	UniversePublicAccessStatusWrite UniversePublicAccessStatus = "w"

	// UniversePublicAccessStatusReadWrite indicates that read and write
	// access is granted.
	UniversePublicAccessStatusReadWrite UniversePublicAccessStatus = "rw"
)

func ParseUniversePublicAccessStatus

func ParseUniversePublicAccessStatus(
	s string) (UniversePublicAccessStatus, error)

ParseUniversePublicAccessStatus parses a string into a universe public access status.

func (UniversePublicAccessStatus) IsReadAccessGranted

func (s UniversePublicAccessStatus) IsReadAccessGranted() bool

IsReadAccessGranted returns true if the status indicates that read access is granted.

func (UniversePublicAccessStatus) IsWriteAccessGranted

func (s UniversePublicAccessStatus) IsWriteAccessGranted() bool

IsWriteAccessGranted returns true if the status indicates that write access is granted.

Jump to

Keyboard shortcuts

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