forked from lightninglabs/taproot-assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
130 lines (82 loc) · 2.74 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package taprootassets
import (
"net"
"net/url"
"time"
"github.com/btcsuite/btcd/chaincfg"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/taproot-assets/address"
"github.com/lightninglabs/taproot-assets/monitoring"
"github.com/lightninglabs/taproot-assets/proof"
"github.com/lightninglabs/taproot-assets/tapdb"
"github.com/lightninglabs/taproot-assets/tapfreighter"
"github.com/lightninglabs/taproot-assets/tapgarden"
"github.com/lightninglabs/taproot-assets/universe"
"github.com/lightningnetwork/lnd"
"github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/signal"
"google.golang.org/grpc"
)
// RPCConfig is a sub-config of the main server that packages up everything
// needed to start the RPC server.
type RPCConfig struct {
LisCfg *lnd.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
}
// DatabaseConfig is the config that holds all the persistence related structs
// and interfaces needed for tapd to function.
type DatabaseConfig struct {
RootKeyStore *tapdb.RootKeyStore
MintingStore tapgarden.MintingStore
AssetStore *tapdb.AssetStore
TapAddrBook *tapdb.TapAddressBook
Multiverse *tapdb.MultiverseStore
FederationDB *tapdb.UniverseFederationDB
}
// Config is the main config of the Taproot Assets server.
type Config struct {
DebugLevel 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
// TODO(roasbeef): use the Taproot Asset chain param wrapper here?
ChainParams chaincfg.Params
Lnd *lndclient.LndServices
SignalInterceptor signal.Interceptor
ReOrgWatcher *tapgarden.ReOrgWatcher
AssetMinter tapgarden.Planter
AssetCustodian *tapgarden.Custodian
ChainBridge tapgarden.ChainBridge
AddrBook *address.Book
DefaultProofCourierAddr *url.URL
ProofArchive proof.Archiver
AssetWallet tapfreighter.Wallet
CoinSelect *tapfreighter.CoinSelect
ChainPorter tapfreighter.Porter
BaseUniverse *universe.MintingArchive
UniverseSyncer universe.Syncer
UniverseFederation *universe.FederationEnvoy
UniverseStats universe.Telemetry
Prometheus monitoring.PrometheusConfig
// LogWriter is the root logger that all of the daemon's subloggers are
// hooked up to.
LogWriter *build.RotatingLogWriter
*RPCConfig
*DatabaseConfig
}