- neighbour nodes need to be contacted reliably
- Only holding NodeIDs requires a cache lookup for getting hostname and
port. This is brittle as the entry could've been purged from cache.
- refactored ASN.1 scheme, types and add/ sort/ remove implementations
closes#46
- serialiseMessage now starts numbering parts from the first number it
gets, to be able to continue responding after having ACKed previous
parts
contributes to #28
- putting the NodeCache behind an IORef had been chose because those
could've been read non-blocking
- the same is true for TVars. The performance characteristics are likely
worse, but at the advantage of composability within STM monads
- for allowing concurrent access to predecessors and successors, the
whole LocalNodeState is passed wrapped into an STM TVar
- this allows keeping the tests for the mostly pure data type, compared
to protecting only the successor and predecessor list
contributes to #28
Motivation: Including the number of parts in each message part requires
the total number of parts to be known in advance, making dynamic
responses based on the received data difficult
- implement sending of initial join request sending, response parsing
and cache population (untested but compiles)
- refactor basic types and their functions into Hash2Pub.FediChordTypes
to prevent import loops, leaving Hash2Pub.FediChord to contain the
high level actions called from Main
This commit brings in an HLint configuration file
and several recommended modifications such as:
* End-of-line extra spaces removal;
* Import lines ordering;
* Redundant $ removal;
* Generalisation of ++ and map to <> and fmap;
* Preferring `pure` over `return`;
* Removing extraenous extensions.
And finally, a `stylish-haskell` helper script
that detects if code files are dirty. Can be useful for CI,
although manually calling it can be nice if you would rather
first implement then beautify.