-
Notifications
You must be signed in to change notification settings - Fork 632
Home
TODO: complete this
Ok, so what we have now is the following:
-
Pos.Crypto
: various cryptographic stuff necessary for other code. This part is at very low level in terms of dependencies between different parts. -
Pos.Types
. Here we have the most important types and functions which operate on them.Types.Types
contains types definitions and instances of some type classes, other modules contain functions. This part is constantly updated. Note that there is GHC bug which forces us to put contents ofBlock.hs
toTypes.hs
. -
DHT
: it was written by @georgeee for peer discovery. -
Util
,Slotting
,Merkle
,FollowTheSatoshi
,Genesis
,Constants
. These modules are rather self-contained and descriptive. Their names are descriptive as well. I think everything should be clear here.Other modules are more high-level. We split this higher-level functionality into several parts:
-
MPC
: this part is what distinguishes Static State version from paper from Dynamic State. We hope to write some abstraction on top of it later. -
Static State: this part can be split into smaller parts:
-
Tx
: this part processes transactions. -
Block
: this part process blocks.
-
Maybe we will have more parts later.
-
-
Communication
. We usetime-warp
(https://github.com/serokell/time-warp), note that you need to look atsuper-communication
branch there. We useMonadDialog
from there. This library has documentation (which may be outdated somewhere), so please read it first to get high-level understanding of purposes of this library. If you have questions after that, feel free to ask. Here you can see separation into parts in action. For instance,Types
defines types necessary to communication (basically messages) and it's split into three modules related to each part.Server
is also split into three parts, each one defines some related listeners. -
State
: this part deals with persistent state and has most of logic. We useacid-state
. It's also split into aforementioned parts. -
Worker
: this part defines various workers, which simply do some actions sometimes, e. g. when new slot starts (very abstract definition, but anyway). Again, it's split into parts. -
WorkMode
: this is a constraint consisting of several monads (usingConstraintKinds
) which most of code uses. It has monads fromtime-warp
and some our ad-hoc monads (e. g.Slotting
). -
Launcher
: this is the main entry point, it defines functions which may be needed for executables.
10: Executables: pos-node
and pos-demo
. pos-node
is a single node. pos-demo
runs several nodes.