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

Commit c98022d

Browse files
committed
Document wallet module. [skip ci]
1 parent d83095b commit c98022d

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

oddchain/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Tolerant (BFT) consensus protocol, whereas the clients submit random
6464
transactions to their corresponding nodes.
6565

6666
What you should see is a terminal split in `numNodes * 2` panes, where the top
67-
layer show the node output, and the bottom layer shows the client (simple
67+
layer shows the nodes' output, and the bottom layer shows the clients' (simple
6868
wallet) output. At this bottom layer you should see the blocks produced being
6969
reported, and of course, all the clients should agree on the blocks they see
7070
:slightly_smiling_face:.
@@ -74,7 +74,7 @@ reported, and of course, all the clients should agree on the blocks they see
7474
If you wish to run nodes individually, this can be done as follows:
7575

7676
```sh
77-
stack run oddnode -- \
77+
stack exec oddnode -- \
7878
--numberOfCoreNodes 3 \
7979
--nodeId 2 \
8080
--enableTracers Consensus \
@@ -117,23 +117,23 @@ instances, which are defined in `module OddChain`. The major instances one has t
117117
support.
118118
- `BlockSupportsProtocol` class instance. This determines how to obtain the data
119119
required to validate the given header according to the consensus rules
120-
('ValidateView') and how to obtain the data required to select among competing
121-
chains ('SelectView').
120+
(`ValidateView`) and how to obtain the data required to select among competing
121+
chains (`SelectView`).
122122
- `LedgerSupportsProtocol` class instance. This links the ledger to the
123123
protocol, by having the former giving the necessary information to the latter.
124124
The consensus algorithm uses this information to determine if the node should
125125
produce a block (`LedgerView`). For the BFT protocol, the ledger view is just
126126
`()`, since leader election is based on a round-robin schedule. More
127127
sophisticated consensus protocols, such as
128128
[Praos](https://iohk.io/en/research/library/papers/ouroboros-praosan-adaptively-securesemi-synchronous-proof-of-stake-protocol/),
129-
might require other information such as some approximation of the stake
129+
might require other information like some approximation of the stake
130130
distribution.
131131
- `UpdateLedger` class instance. This defines how blocks can be applied to the
132-
ledger state to update it. This, this is where the ledger logic lives.
132+
ledger state to update it. This is where the ledger logic lives.
133133
- `ApplyTx` class instance. Similar to `UpdateLedger`, this instance defines how
134134
to different transactions affect the ledger state. This instance is used by
135-
the mempool. See `Test.OddChain.prop_mempool` to see which relation is
136-
expected to hold between the instances of these type classes. Be aware that
135+
the mempool. Property `Test.OddChain.prop_mempool` defines the relation that
136+
is expected to hold between the instances of these type classes. Be aware that
137137
there might be other properties that aren't currently captured in the tests.
138138
- `RunNode` instance. This defines, among other things, functions to:
139139
- forge blocks when the node is the leader (given, among other things, a
@@ -155,7 +155,10 @@ When defining the ledger state is **important** that that the ledger state can
155155
retrieve the header hash of the last applied block (see the instance of function
156156
`ledgerTipPoint`).
157157

158-
Tests for the implementation are defined in these modules
158+
The `OddWallet` module contains the implementation of a simple wallet that
159+
submits random transactions to the node it is connected to.
160+
161+
Tests for the implementation are defined in the following modules:
159162

160163
- `Test.ThreadNet.OddChain` which contains:
161164
- a test to check that the consensus layer is behaving as expected for the odd
@@ -221,7 +224,7 @@ Applying a **valid** block `blk` on state `st` should result in the same state
221224
as ticking the ledger state by the block slot, and then applying the
222225
transactions inside the block. Note that here **validity** of block is crucial.
223226
If the block is invalid in the given state, then we can't say anything about the
224-
equality. Formally, for all blocks valid :
227+
equality. Formally, for all valid blocks:
225228

226229
```
227230
applyLedgerBlock cfg blk st

0 commit comments

Comments
 (0)