forked from lightninglabs/taproot-assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
151 lines (99 loc) · 3.58 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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"
"golang.org/x/time/rate"
"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
// 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
UniverseArchive *universe.Archive
UniverseSyncer universe.Syncer
UniverseFederation *universe.FederationEnvoy
UniverseStats universe.Telemetry
// UniversePublicAccess is flag which, If true, and the Universe server
// is on a public interface, valid proof from remote parties will be
// accepted, and proofs will be queryable by remote parties.
// This applies to federation syncing as well as RPC insert and query.
UniversePublicAccess bool
// 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
*RPCConfig
*DatabaseConfig
}