Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit 3265836

Browse files
committed
Update README and change block-delay flag name
1 parent 8cdec88 commit 3265836

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ Usage: chainweb-mining-client [--info] [--long-info] [-v|--version] [--license]
6060
[-c|--thread-count ARG]
6161
[--generate-key | --no-generate-key]
6262
[-l|--log-level error|warn|info|debug]
63-
[-w|--worker cpu|external|simulation|stratum]
63+
[-w|--worker cpu|external|simulation|stratum|constant-delay]
6464
[--external-worker-cmd ARG] [--stratum-port ARG]
6565
[--stratum-interface ARG]
6666
[--stratum-difficulty ARG] [-s|--stratum-rate ARG]
67+
[--constant-delay-block-time ARG]
6768
6869
Kadena Chainweb Mining Client
6970
@@ -98,7 +99,7 @@ Available options:
9899
-l,--log-level error|warn|info|debug
99100
Level at which log messages are written to the
100101
console
101-
-w,--worker cpu|external|simulation|stratum
102+
-w,--worker cpu|external|simulation|stratum|constant-delay
102103
The type of mining worker that is used
103104
--external-worker-cmd ARG
104105
command that is used to call an external worker. When
@@ -114,6 +115,8 @@ Available options:
114115
leading zeros).
115116
-s,--stratum-rate ARG Rate (in milliseconds) at which a stratum worker
116117
thread emits jobs.
118+
--constant-delay-block-time ARG
119+
time at which a constant-delay worker emits blocks
117120
118121
Configurations are loaded in order from the following sources:
119122
1. Configuration files from locations provided through --config-file options

main/Main.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ data Config = Config
256256
, _configStratumInterface :: !HostPreference
257257
, _configStratumDifficulty :: !Stratum.StratumDifficulty
258258
, _configStratumRate :: !Natural
259-
, _configBlockTime :: !Natural
259+
, _configConstantDelayBlockTime :: !Natural
260260
}
261261
deriving (Show, Eq, Ord, Generic)
262262

@@ -279,7 +279,7 @@ defaultConfig = Config
279279
, _configStratumInterface = "*"
280280
, _configStratumDifficulty = Stratum.WorkDifficulty
281281
, _configStratumRate = 1000
282-
, _configBlockTime = 30
282+
, _configConstantDelayBlockTime = 30
283283
}
284284

285285
instance ToJSON Config where
@@ -299,7 +299,7 @@ instance ToJSON Config where
299299
, "stratumInterface" .= _configStratumInterface c
300300
, "stratumDifficulty" .= _configStratumDifficulty c
301301
, "stratumRate" .= _configStratumRate c
302-
, "blockTime" .= _configBlockTime c
302+
, "constantDelayBlockTime" .= _configConstantDelayBlockTime c
303303
]
304304

305305
instance FromJSON (Config -> Config) where
@@ -319,7 +319,7 @@ instance FromJSON (Config -> Config) where
319319
<*< configStratumInterface ..: "stratumInterface" % o
320320
<*< configStratumDifficulty ..: "stratumDifficulty" % o
321321
<*< configStratumRate ..: "stratumRate" % o
322-
<*< configBlockTime ..: "blockTime" % o
322+
<*< configConstantDelayBlockTime ..: "constantDelayBlockTime" % o
323323
where
324324
parseLogLevel = withText "LogLevel" $ return . logLevelFromText
325325

@@ -383,8 +383,8 @@ parseConfig = id
383383
% short 's'
384384
<> long "stratum-rate"
385385
<> help "Rate (in milliseconds) at which a stratum worker thread emits jobs."
386-
<*< configBlockTime .:: option auto
387-
% long "block-time"
386+
<*< configConstantDelayBlockTime .:: option auto
387+
% long "constant-delay-block-time"
388388
<> help "time at which a constant-delay worker emits blocks"
389389

390390
-- -------------------------------------------------------------------------- --
@@ -829,7 +829,7 @@ run conf logger = do
829829
rng <- MWC.createSystemRandom
830830
f $ \l -> simulationWorker l rng workerRate
831831
ConstantDelayWorker -> do
832-
f $ \l -> constantDelayWorker l (_configBlockTime conf)
832+
f $ \l -> constantDelayWorker l (_configConstantDelayBlockTime conf)
833833
ExternalWorker -> f $ \l -> externalWorker l (_configExternalWorkerCommand conf)
834834
CpuWorker -> f $ cpuWorker @Blake2s_256
835835
StratumWorker -> Stratum.withStratumServer

0 commit comments

Comments
 (0)