@@ -11,11 +11,11 @@ import Universum
11
11
import Control.Concurrent.STM (newTQueueIO )
12
12
import Ntp.Client (NtpConfiguration , NtpStatus , ntpClientSettings ,
13
13
withNtpClient )
14
+ import Pos.Chain.Genesis as Genesis (Config (.. ))
14
15
import Pos.Chain.Ssc (SscParams )
15
16
import Pos.Chain.Txp (TxpConfiguration )
16
17
import qualified Pos.Client.CLI as CLI
17
18
import Pos.Context (ncUserSecret )
18
- import Pos.Core as Core (Config (.. ))
19
19
import Pos.DB.DB (initNodeDBs )
20
20
import Pos.DB.Txp (txpGlobalSettings )
21
21
import Pos.Infra.Diffusion.Types (Diffusion )
@@ -61,26 +61,26 @@ defaultLoggerName = "node"
61
61
-- | The legacy function responsible for starting a Cardano edge node plus a
62
62
-- number of extra plugins.
63
63
actionWithLegacyWallet :: (HasConfigurations , HasCompileInfo )
64
- => Core . Config
64
+ => Genesis . Config
65
65
-> WalletConfiguration
66
66
-> TxpConfiguration
67
67
-> SscParams
68
68
-> NodeParams
69
69
-> NtpConfiguration
70
70
-> WalletBackendParams
71
71
-> IO ()
72
- actionWithLegacyWallet coreConfig walletConfig txpConfig sscParams nodeParams ntpConfig wArgs@ WalletBackendParams {.. } =
72
+ actionWithLegacyWallet genesisConfig walletConfig txpConfig sscParams nodeParams ntpConfig wArgs@ WalletBackendParams {.. } =
73
73
bracketWalletWebDB (walletDbPath walletDbOptions) (walletRebuildDb walletDbOptions) $ \ db ->
74
74
bracketWalletWS $ \ conn ->
75
75
bracketNodeResources
76
- coreConfig
76
+ genesisConfig
77
77
nodeParams
78
78
sscParams
79
- (txpGlobalSettings coreConfig txpConfig)
80
- (initNodeDBs coreConfig ) $ \ nr@ NodeResources {.. } -> do
79
+ (txpGlobalSettings genesisConfig txpConfig)
80
+ (initNodeDBs genesisConfig ) $ \ nr@ NodeResources {.. } -> do
81
81
syncQueue <- liftIO newTQueueIO
82
82
ntpStatus <- withNtpClient (ntpClientSettings ntpConfig)
83
- runWRealMode coreConfig txpConfig db conn syncQueue nr (mainAction ntpStatus nr)
83
+ runWRealMode genesisConfig txpConfig db conn syncQueue nr (mainAction ntpStatus nr)
84
84
where
85
85
mainAction ntpStatus = runNodeWithInit ntpStatus $ do
86
86
when (walletFlushDb walletDbOptions) $ do
@@ -95,7 +95,7 @@ actionWithLegacyWallet coreConfig walletConfig txpConfig sscParams nodeParams nt
95
95
96
96
runNodeWithInit ntpStatus init' nr diffusion = do
97
97
_ <- init'
98
- runNode coreConfig txpConfig nr (plugins ntpStatus) diffusion
98
+ runNode genesisConfig txpConfig nr (plugins ntpStatus) diffusion
99
99
100
100
syncWallets :: WalletWebMode ()
101
101
syncWallets = do
@@ -106,34 +106,34 @@ actionWithLegacyWallet coreConfig walletConfig txpConfig sscParams nodeParams nt
106
106
plugins :: TVar NtpStatus -> LegacyPlugins. Plugin WalletWebMode
107
107
plugins ntpStatus =
108
108
mconcat [ LegacyPlugins. conversation wArgs
109
- , LegacyPlugins. legacyWalletBackend coreConfig walletConfig txpConfig wArgs ntpStatus
109
+ , LegacyPlugins. legacyWalletBackend genesisConfig walletConfig txpConfig wArgs ntpStatus
110
110
, LegacyPlugins. walletDocumentation wArgs
111
111
, LegacyPlugins. acidCleanupWorker wArgs
112
- , LegacyPlugins. syncWalletWorker coreConfig
113
- , LegacyPlugins. resubmitterPlugin coreConfig txpConfig
112
+ , LegacyPlugins. syncWalletWorker genesisConfig
113
+ , LegacyPlugins. resubmitterPlugin genesisConfig txpConfig
114
114
, LegacyPlugins. notifierPlugin
115
115
]
116
116
117
117
-- | The "workhorse" responsible for starting a Cardano edge node plus a number of extra plugins.
118
118
actionWithWallet :: (HasConfigurations , HasCompileInfo )
119
- => Core . Config
119
+ => Genesis . Config
120
120
-> TxpConfiguration
121
121
-> SscParams
122
122
-> NodeParams
123
123
-> NtpConfiguration
124
124
-> NewWalletBackendParams
125
125
-> IO ()
126
- actionWithWallet coreConfig txpConfig sscParams nodeParams ntpConfig params =
126
+ actionWithWallet genesisConfig txpConfig sscParams nodeParams ntpConfig params =
127
127
bracketNodeResources
128
- coreConfig
128
+ genesisConfig
129
129
nodeParams
130
130
sscParams
131
- (txpGlobalSettings coreConfig txpConfig)
132
- (initNodeDBs coreConfig ) $ \ nr -> do
131
+ (txpGlobalSettings genesisConfig txpConfig)
132
+ (initNodeDBs genesisConfig ) $ \ nr -> do
133
133
ntpStatus <- withNtpClient (ntpClientSettings ntpConfig)
134
134
userSecret <- readTVarIO (ncUserSecret $ nrContext nr)
135
135
let nodeState = NodeStateAdaptor. newNodeStateAdaptor
136
- coreConfig
136
+ genesisConfig
137
137
nr
138
138
ntpStatus
139
139
liftIO $ Keystore. bracketLegacyKeystore userSecret $ \ keystore -> do
@@ -144,13 +144,13 @@ actionWithWallet coreConfig txpConfig sscParams nodeParams ntpConfig params =
144
144
})
145
145
WalletLayer.Kernel. bracketPassiveWallet dbMode logMessage' keystore nodeState $ \ walletLayer passiveWallet -> do
146
146
Kernel. init passiveWallet
147
- Kernel.Mode. runWalletMode coreConfig
147
+ Kernel.Mode. runWalletMode genesisConfig
148
148
txpConfig
149
149
nr
150
150
walletLayer
151
151
(mainAction (walletLayer, passiveWallet) nr dbMode)
152
152
where
153
- pm = configProtocolMagic coreConfig
153
+ pm = configProtocolMagic genesisConfig
154
154
mainAction
155
155
:: (PassiveWalletLayer IO , PassiveWallet )
156
156
-> NodeResources ext
@@ -163,7 +163,7 @@ actionWithWallet coreConfig txpConfig sscParams nodeParams ntpConfig params =
163
163
-> NodeResources ext
164
164
-> Kernel. DatabaseMode
165
165
-> (Diffusion Kernel.Mode. WalletMode -> Kernel.Mode. WalletMode () )
166
- runNodeWithInit w nr dbMode = runNode coreConfig txpConfig nr (plugins w dbMode)
166
+ runNodeWithInit w nr dbMode = runNode genesisConfig txpConfig nr (plugins w dbMode)
167
167
168
168
plugins :: (PassiveWalletLayer IO , PassiveWallet )
169
169
-> Kernel. DatabaseMode
@@ -203,33 +203,33 @@ actionWithWallet coreConfig txpConfig sscParams nodeParams ntpConfig params =
203
203
startEdgeNode :: HasCompileInfo => WalletStartupOptions -> IO ()
204
204
startEdgeNode wso =
205
205
withConfigurations blPath dumpGenesisPath dumpConfiguration conf $
206
- \ coreConfig walletConfig txpConfig ntpConfig -> do
207
- (sscParams, nodeParams) <- getParameters coreConfig
206
+ \ genesisConfig walletConfig txpConfig ntpConfig -> do
207
+ (sscParams, nodeParams) <- getParameters genesisConfig
208
208
209
209
case wsoWalletBackendParams wso of
210
210
WalletLegacy legacyParams -> actionWithLegacyWallet
211
- coreConfig
211
+ genesisConfig
212
212
walletConfig
213
213
txpConfig
214
214
sscParams
215
215
nodeParams
216
216
ntpConfig
217
217
legacyParams
218
218
WalletNew newParams -> actionWithWallet
219
- coreConfig
219
+ genesisConfig
220
220
txpConfig
221
221
sscParams
222
222
nodeParams
223
223
ntpConfig
224
224
newParams
225
225
where
226
- getParameters :: Core . Config -> IO (SscParams , NodeParams )
227
- getParameters coreConfig = do
226
+ getParameters :: Genesis . Config -> IO (SscParams , NodeParams )
227
+ getParameters genesisConfig = do
228
228
229
229
(currentParams, Just gtParams) <- CLI. getNodeParams defaultLoggerName
230
230
(wsoNodeArgs wso)
231
231
nodeArgs
232
- (configGeneratedSecrets coreConfig )
232
+ (configGeneratedSecrets genesisConfig )
233
233
234
234
logInfo " Wallet is enabled!"
235
235
0 commit comments