-
Notifications
You must be signed in to change notification settings - Fork 631
Conversation
NOTE (@disassembler): I haven't tested anything yet so don't try to run it ^^" ... It's more about grooming the general idea. |
know: | ||
|
||
- ENV variables define "base" arguments for a node. | ||
When it makes sense (.e.g `DB_PATH`, `LOG_CONFIG`), these "base" arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will you also support a prefix where logs are put?
--logs-prefix FILEPATH Prefix to logger output path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it reuses the CLI parsers, everything that is supported by the CLI will be seemingly supported by this. 👍
Just realised there's no need to run most of those actions in plain IO. The ENV can be read once and put in a Will do. |
cca17c9
to
337b08f
Compare
genesisConfig | ||
txpConfig | ||
nodeRes | ||
(runNode genesisConfig txpConfig nodeRes plugins) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from node/Main.hs
to be re-used elsewhere.
337b08f
to
f30a720
Compare
4d71034
to
963ec1e
Compare
73333d0
to
be213ad
Compare
cluster/README.md
Outdated
......system start: 1539179292 | ||
......address: 127.0.0.1:3100 | ||
...wallet OK! | ||
......system start: 1539179292 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@disassembler tells me the inconsistent start times have been fixed. Let's update the example text here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a minor doc nitpick, but otherwise LGTM.
This code makes use of the 'Cardano.Wallet.Demo' module and show how it can be used to spawn a demo cluster of nodes. More details in the README.md
e6b18c3
to
8b76d29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
yield (RunningRelayNode nodeId nodeEnv) | ||
|
||
NodeEdge -> do | ||
genesisKeys <- init topology >> init logger >> init genesis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how this makes it clear what options are being included 👍
-> (Maybe SyncPercentage -> IO ()) | ||
-> IO () | ||
waitForNode wc (MaxWaitingTime s) reportProgress = do | ||
res <- race (threadDelay $ s * oneSecond) retry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
:: NodeType -- ^ Target node type (core, relay, edge ...) | ||
-> [(NodeName, NodeType, NetworkAddress)] -- ^ All fully qualified nodes | ||
-> Topology | ||
demoTopology nodeType = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just skimmed over this one as I am lacking more indepth knowledge about the internals of topology
-- terminating "normally" which can't happen. | ||
mvar <- newEmptyMVar | ||
handle <- async (action (putMVar mvar)) | ||
result <- race (wait handle) (takeMVar mvar) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, clever
sToK = map (Char.toLower . replaceIf '_' '-') | ||
|
||
|
||
-- | Split a string on the given character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if you could have reused split or splitOn from Text: http://hackage.haskell.org/package/text-1.2.3.1/docs/Data-Text.html#v:splitOn , http://hackage.haskell.org/package/text-1.2.3.1/docs/Data-Text.html#v:split
prop_runAsync n = ioProperty $ do | ||
((handle, res), t) <- time (runAsync io) | ||
cancel handle | ||
return $ classify (t < 100) "< 100μs" $ res === n .&&. t < (10 * oneSecond) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder will this sometimes fail (with low probability) if thread scheduler paused async action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not. I took a veeeeery large time for the property to fail (10 seconds). That's also what the classify
is for. I've actually seen some runs where 99.9% only are under 100us and some got above. The property still passes fine as it's not about measuring any time execution, but just measuring that yields
correctly returns a result prematurely, before the end of the thread.
Description
@disassembler, you'll recognize some parts of an old PR. I've resurrected it and adjusted a few things:
This is still WIP but I'd appreciate your inputs before I move forward ❤️
Linked issue
[CO-390]
Type of change
Developer checklist
Testing checklist
QA Steps
Screenshots (if available)