Commit graph

8 commits

Author SHA1 Message Date
BlockChainDev
336fc02ad5 [syncmgr]
- Fix bug; accounts for a fresh database startup and we only have the genesis block
2019-03-30 22:42:07 +00:00
BlockChainDev
06e71d9b7e [syncmgr]
- update comment
2019-03-30 21:44:24 +00:00
BlockChainDev
751d2711d4 [syncmgr]
- refactored OnBlockBlockMode to use blockPool
- syncmgr now checks for future blocks, instead of looking for a
FutureBlockErr from the Chain. This makes it so that syncmgr does not
depend on the Chain package.
- removed GetBestBlockHash function from config(unused)
- refactored all tests in the syncmgr package
2019-03-30 21:36:50 +00:00
BlockChainDev
c401247af9 [syncmgr]
- refactor syncmgr for blockpool
- add nextBlockIndex so that we can add blocks to the blockPool by
comparing their index
- add processBlock helper method,wraps around cfg.ProcessBlock and increments the nextBlockIndex
internally
2019-03-30 21:34:27 +00:00
BlockChainDev
5ed61ff389 [syncmgr]
- add blockpool plus test
2019-03-30 21:32:44 +00:00
decentralisedkev
abb4da9cbd
[PeerMgr] Add Caching and Re-processing system (#263)
[peermgr]

- Add request cache with tests
- Add requestCache to peermgr
- refactored peer manager tests
- Added blockInfo struct, to allow sorting on the blockIndex
- added helper methods for cache, pickItem, pickFirstItem, removeHash,
findHash and refactored tests
- renamed requestcache to blockcache
- refactored peer manager to use block cache for block requests *only*
- added blockCallPeer function to handle block requests only
- refactored onDisconnect to add back any pending peer requests that the
disconnected peer did not complete into the peer manager queue

[peermgr/server]

- Modify onBlock handler in server, to send peermgr a BlockInfo struct

[peermgr/syncmgr/server]

- Modified blockIndex in BlockInfo to be uint32 and not uint64
- RequestBlocks in syncmgr now takes an index along with the hash
- modified syncmgr code to pass index along with hash in all methods
2019-03-30 18:10:27 +00:00
decentralisedkev
1a6bdd4099
[Server] Implements Orchestration server (#252)
* [pubsub]

- remove pubsub package

* [chain]

- Add height to chain

* [peer]

- remove unnecesary println

* [server]

- Implement server package

* Add main.go to run node
2019-03-28 22:49:34 +00:00
decentralisedkev
cb21c66316
Syncmgr: Implement synchronisation manager (#249)
* [syncmgr]

- Add blockmode, normal mode, headermode
- Add config file
- Add test files
- removed RequestBlocks and RequestHeaders from peers, as we will use
the peermanager for this
- OnHeaders and OnBlock in syncmgr, now return errors
- refactored all tests to use a convenience method to return a syncmgr
and testHelper
2019-03-28 21:22:17 +00:00