Commit graph

8530 commits

Author SHA1 Message Date
zelig
b77b855f2c p2p/protocols: do handshake async w timeout 2017-05-15 18:31:40 -07:00
Viktor Trón
63e84d4910 Merge pull request #91 from ethersphere/network-testing-framework-snapshot
p2p/simulations: Switch network snapshot to a GET request
2017-05-15 11:31:21 -07:00
Lewis Marshall
135a858373 p2p/simulations: Switch network snapshot to a GET request
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-15 11:30:04 -07:00
Viktor Trón
c527171559 Merge pull request #90 from holisticode/scenarios
Scenarios
2017-05-15 11:23:18 -07:00
Fabio Barone
145ec4ea73 p2p/simulations: scenarios support; HTTP OPTIONS support 2017-05-12 17:28:14 -05:00
Viktor Trón
99c0b99cf9 Merge pull request #89 from ethersphere/network-testing-framework-snapshot
p2p/simulations: Snapshot support
2017-05-12 13:00:27 -07:00
Lewis Marshall
d7eb6b5a70 p2p/simulations: Snapshot support
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-12 08:57:07 -07:00
Viktor Trón
e39a33e4a8 Merge pull request #87 from ethersphere/network-testing-framework-p2psim
p2p/simulations: Refactor events + add p2psim
2017-05-11 12:32:24 -07:00
Lewis Marshall
cf462b7781 p2p/simulations: Add p2psim command-line API client
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-10 01:39:02 -07:00
Lewis Marshall
584f8b8cf4 p2p/simulations: Refactor events
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-10 01:39:02 -07:00
Viktor Trón
aa624cdb99 Merge pull request #86 from ethersphere/network-testing-framework-rpc-subscribe
p2p/simulations: Move PeerEvents to admin RPC namespace
2017-05-09 11:55:52 +02:00
Lewis Marshall
cdab665475 p2p/simulations: Move PeerEvents to admin RPC namespace
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-08 10:51:55 +01:00
Lewis Marshall
e4ac128657 rpc: Subscribe to methods in custom namespaces
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 15:37:37 +01:00
Lewis Marshall
6de09120d3 p2p/simulations: Disconnect peers on SimNode.Stop
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:01 +01:00
Lewis Marshall
1aa80c5012 p2p/simulations: Refactor simulation HTTP API
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:01 +01:00
zelig
d9af74e3fb swarm/network, p2p/protocols: fix kademlia crashes and msg asyncrony 2017-05-06 14:25:01 +01:00
Lewis Marshall
ff24b603d0 p2p/simulations: Don't allow connections to stopped SimNodes
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:01 +01:00
Lewis Marshall
d3543fb458 p2p/simulations: Track message events
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:01 +01:00
Lewis Marshall
12eb088e5b p2p/simulations: Refactor
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:00 +01:00
nolash
246eb00def p2p, p2p/adapters, p2p/testing: message reporting for simulation layer
Adds a MsgReporter struct that wraps MsgReadWriter that posts message read and write to an subscribable event.Feed
2017-05-06 14:25:00 +01:00
nolash
d5daa9a323 swarm/network: event feed/websockets pss msg notification
Adds pub/sub of incoming Pss messages using event.Feed,
and a websockets interface for pss send and notifications
through persistent connection using rpc.notifier.

Websocket RPC are started automatically on the swarm executable
if the --pss flag is present. If more instances are to be run,
alternate ws ports can be specified with the --pssport flag.

Current implementation also includes a shallow builtin ping/pong handler
with topic "pss" and version 1, to simplify POCs and testing against pss.
This will eventually be removed, so no code should be made dependent on it.
2017-05-06 14:25:00 +01:00
Lewis Marshall
b865560130 swarm/network: Trigger simulations checks on peer events
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:00 +01:00
Lewis Marshall
247e40a36a p2p/simulations: Get peer events via RPC
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:00 +01:00
Fabio Barone
a4b52df32c p2p/simulations: LiveEvents DidConnect and DidDisconnect use GetOrCreateConn 2017-05-06 14:25:00 +01:00
Fabio Barone
c86d0f4d25 p2p/simuations: first attempt at event types 2017-05-06 14:25:00 +01:00
nolash
b8bf32bce3 swarm/network: pss 0.1
General:
    - Message encapsulation is temporary until integration with whisper

    Incoming message handling:
    - Implements a dispatcher for registering handler functions to pss topics
    - Handlers can be any sort of function, and can send/receive on p2p.MsgReadWriter
    - Actual p2p.Protocol handling now as pluggable convenience function

Sending and routing:
    - Added temporary cache solution based on message hash digest
    - Send and forward split up as separate methods
    - Send is now payload agnostic (p2p.Protocol replies massaged in p2p.MsgWriter)

Tests:
    - TestPssRandom...
	Sends PSS between randomly selected nodes in different population magnitudes
    - TestPssFullLinearEcho
        A->B->C->B->A ping/pong over pss, where A and C are running pss
    - TestPssFullRandom50Pct
        10 nodes where 5 are running pss, 5 sends to/from random nodes
        (messages currently get stuck in kad. routing, discarded by cache block)
    - Protocoltester tests status unknown
2017-05-06 14:25:00 +01:00
Lewis Marshall
24dcc8d6e1 swarm/network: Pass p2p.Server to Hive.Start
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:00 +01:00
Lewis Marshall
c3dc00336e p2p/adapters: Use RPC with SimNodes
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:25:00 +01:00
Fabio Barone
60a767790d p2p/simulations: removed GetResourceIdFromController 2017-05-06 14:23:39 +01:00
Fabio Barone
aa91242dee p2p/simulations: renamed all occurrence of cytoscape 2017-05-06 14:23:39 +01:00
Fabio Barone
f02b408dd2 p2p/simulations: GetResourceIdForController for ResourceController; GET /<networkId>/nodes/<nodeId> 2017-05-06 14:23:39 +01:00
Fabio Barone
9fc8097768 p2p/simulations: support GET requests with query string in URL 2017-05-06 14:23:39 +01:00
Lewis Marshall
20e91384bf p2p/simulations: event streams 2017-05-06 14:23:39 +01:00
Lewis Marshall
5b4702304a p2p/adapters: Add "docker" node adapter
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:23:39 +01:00
Lewis Marshall
4807103338 p2p/adapters: Add "exec" node adapter
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:23:39 +01:00
Lewis Marshall
4c6648ef49 all: Fix logging
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:23:39 +01:00
Lewis Marshall
bcf2622f29 swarm/network: Don't require NodeAdapter to initialise bzz protocol
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:23:38 +01:00
Lewis Marshall
5dcae2e26e p2p/adapters: Remove Messenger abstraction
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:23:38 +01:00
Lewis Marshall
9407ac7566 p2p/simulations: Add simulation test framework
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-05-06 14:23:38 +01:00
zelig
b7860c7fc6 kademlia fixes 2017-05-06 14:23:38 +01:00
nolash
e0468e0442 swarm/network: pssmsg relay through pivotnode 2017-05-06 14:23:38 +01:00
nolash
5401bf02f1 swarm/network: peersexchange massaging
added send peers to newly connected peer from already connected peer
removed peermsg expect
2017-05-06 14:23:38 +01:00
nolash
9cad74910f swarm/network, p2p/testing: WIP first test of pss poc
Fails as hive insists on starting discovery even though we don't want it
2017-05-06 14:23:38 +01:00
nolash
d4a08fdf7e p2p/testing, p2p/protocols: refactored test session setup and driver 2017-05-06 14:23:38 +01:00
nolash
11aeaec420 swarm/network: WIP kademlia network sim tests 2017-05-06 14:23:38 +01:00
zelig
e26d672438 kademlia discovery working 2017-05-06 14:23:38 +01:00
zelig
1eedb4a2c8 swarm/network: WIP testing for protocol 2017-05-06 14:23:38 +01:00
nolash
140c7f7f23 swarm/network: WIP protocol testfixes 2017-05-06 14:23:38 +01:00
nolash
29d3936af7 swarm/network: protocol test simplifications 2017-05-06 14:23:38 +01:00
zelig
a6a006c5e3 add peerpool 2017-05-06 14:23:38 +01:00