Commit Graph

26 Commits

Author SHA1 Message Date
Dmitriy Ryajov 293a219dbe
Cleanup (#55)
* fix: don't allow replacing pubkey

* fix: several small improvements

* removing pubkey setter

* improove error handling

* remove the use of Option[T] if not needed

* don't use optional

* fix-ci: temporarily pin p2pd to a working tag

* fix example to comply with latest changes

* bumping p2pd again to a higher version
2019-12-10 14:50:35 -06:00
Zahary Karadjov 454f658ba8
Fixes and tweaks related to the beacon node integration
* Bugfix: Dialing an already connected peer may lead to crash

* Introduced a standard_setup module allowing to instantiate
  the `Switch` object in an easier manner.

* Added `Switch.disconnect(peer)`

* Trailing space removed (sorry about polluting the diff)
2019-12-08 23:58:43 +02:00
Dmitriy Ryajov e623e70e7b
PubSub (Gossip & Flood) Implementation (#36)
This adds gossipsub and floodsub, as well as basic interop testing with the go libp2p daemon. 

* add close event

* wip: gossipsub

* splitting rpc message

* making message handling more consistent

* initial gossipsub implementation

* feat: nim 1.0 cleanup

* wip: gossipsub protobuf

* adding encoding/decoding of gossipsub messages

* add disconnect handler

* add proper gossipsub msg handling

* misc: cleanup for nim 1.0

* splitting floodsub and gossipsub tests

* feat: add mesh rebalansing

* test pubsub

* add mesh rebalansing tests

* testing mesh maintenance

* finishing mcache implementatin

* wip: commenting out broken tests

* wip: don't run heartbeat for now

* switchout debug for trace logging

* testing gossip peer selection algorithm

* test stream piping

* more work around message amplification

* get the peerid from message

* use timed cache as backing store

* allow setting timeout in constructor

* several changes to improve performance

* more through testing of msg amplification

* prevent gc issues

* allow piping to self and prevent deadlocks

* improove floodsub

* allow running hook on cache eviction

* prevent race conditions

* prevent race conditions and improove tests

* use hashes as cache keys

* removing useless file

* don't create a new seq

* re-enable pubsub tests

* fix imports

* reduce number of runs to speed up tests

* break out control message processing

* normalize sleeps between steps

* implement proper transport filtering

* initial interop testing

* clean up floodsub publish logic

* allow dialing without a protocol

* adding multiple reads/writes

* use protobuf varint in mplex

* don't loose conn's peerInfo

* initial interop pubsub tests

* don't duplicate connections/peers

* bring back interop tests

* wip: interop

* re-enable interop and daemon tests

* add multiple read write tests from handlers

* don't cleanup channel prematurely

* use correct channel to send/receive msgs

* adjust tests with latest changes

* include interop tests

* remove temp logging output

* fix ci

* use correct public key serialization

* additional tests for pubsub interop
2019-12-05 20:16:18 -06:00
Dmitriy Ryajov 018da65708 compare peer string ids, rather than keys 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 759355b364 use discard for unused results 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 06b759e049 review cleanup 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 3c2009c85e rename chat example to direct chat 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 9d93301a3a handle /connect command properly 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov a1ee339680 feat: native chat clean up 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 2c53dd27f8 cleanup and error handling 2019-10-11 08:15:24 +09:00
Dmitriy Ryajov 72c4115c95 wip: native libp2p chat sample 2019-10-11 08:15:24 +09:00
cheatfate 8c4c2159ed Fix #25. 2019-08-14 08:31:06 +03:00
cheatfate d7a7f8102d
Change PeerID type from distinct type.
Fix MultiAddress compilation error.
Fix chat example.
2019-03-05 22:28:46 +02:00
cheatfate a96718cf9e
Add PeerID support to multiaddress.
Change some PeerID api.
Some fixes to chat.
2019-03-05 14:09:26 +02:00
cheatfate d7d9d7bd40
Fix daemonapi and examples. 2019-03-05 01:57:18 +02:00
cheatfate 77f34af737
Fix testdaemon.nim. 2019-03-04 20:51:10 +02:00
cheatfate 53467d028f
Fix examples for new PeerID. 2019-03-04 20:28:59 +02:00
cheatfate 1e6c8b2171
Fix examples.
Add peer.nim.
Switch daemonapi to use PeerID from peer.nim.
2019-03-04 20:22:38 +02:00
cheatfate e9785bb509 Make unix socket name generation more reliable (depending on process id).
Add examples of bootstrap node and gossipsub node.
2018-12-18 16:31:58 +02:00
cheatfate 9d55f41909 Update example chat /consearch now shows if peers are supporting p2p-circuit.
Add utility procedures for multiaddress.
2018-11-27 22:58:16 +02:00
cheatfate ff965830d8 Fix chat example to show peers in base58. 2018-11-27 14:42:49 +02:00
cheatfate b4e9a7b8a6 Fix daemonapi connect/streamOpen to support timeouts.
Add more commands to chat example.
2018-11-27 14:33:41 +02:00
cheatfate 98aa3ed281 Add VBuffer implementation.
Add MultiAddress implementation and tests.
Adapt chat to use /p2p-circuit
2018-11-27 14:16:04 +02:00
cheatfate 9edc823b6c Some fixes to chat, and one more test for bad cid provide. 2018-11-22 17:35:44 +02:00
cheatfate 10548f9b1b Enable bootstrap. 2018-11-22 16:16:34 +02:00
cheatfate 66973aed3f Simple chat. 2018-11-22 16:12:46 +02:00