forked from lightninglabs/taproot-assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
124 lines (78 loc) · 2.6 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
package taprootassets
import (
"net"
"time"
"github.com/btcsuite/btcd/chaincfg"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/taproot-assets/address"
"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
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.BaseMultiverse
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
AcceptRemoteUniverseProofs bool
// 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
ProofArchive proof.Archiver
AssetWallet tapfreighter.Wallet
CoinSelect *tapfreighter.CoinSelect
ChainPorter tapfreighter.Porter
BaseUniverse *universe.MintingArchive
UniverseSyncer universe.Syncer
UniverseFederation *universe.FederationEnvoy
UniverseStats universe.Telemetry
// LogWriter is the root logger that all of the daemon's subloggers are
// hooked up to.
LogWriter *build.RotatingLogWriter
*RPCConfig
*DatabaseConfig
}