phoreproject / graphene

Phore Synapse working repository
MIT License
13 stars 6 forks source link

#49 active peer discovery #55

Closed wqking closed 5 years ago

wqking commented 5 years ago

I didn't test it yet.

codecov-io commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@de37a8e). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #55   +/-   ##
=========================================
  Coverage          ?   35.38%           
=========================================
  Files             ?       20           
  Lines             ?     3408           
  Branches          ?        0           
=========================================
  Hits              ?     1206           
  Misses            ?     2066           
  Partials          ?      136

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update de37a8e...fc79767. Read the comment docs.

meyer9 commented 5 years ago

This doesn't work. I ran:

go run cmd/beacon/synapsebeacon.go -genesistime 1557336342 -connect "/ip4/134.209.58.178/tcp/11781/ipfs/12D3KooWDW6ZvQYxhgu3i6ys6pqbwoP2YAkXJNYdcyis7nsfSSG9" -level debug

then,

go run cmd/beacon/synapsebeacon.go -genesistime 1557336342 -connect "/ip4/127.0.0.1/tcp/11781/ipfs/somethingsomethingsomething" -datadir "~/.phoresynapse1" -listen "/ip4/0.0.0.0/tcp/11881" -rpclisten "127.0.0.1:11882" -level debug -resync

It seems to continuously get empty peers.


Also, seems to be a bug with peer IDs because they always get rejected on the client.

wqking commented 5 years ago

Now it works.

Test, go run cmd/beacon/synapsebeacon.go -genesistime 1557336342 -level debug

go run cmd/beacon/synapsebeacon.go -genesistime 1557336342 -datadir "/temp/phoresynapse1" -listen "/ip4/0.0.0.0/tcp/11881" -rpclisten "127.0.0.1:11882" -level debug -resync

No need to connect the nodes.

The active peer discovery needs to connect to several center servers for the routine, now the code uses the servers from libp2p example code. We may need to have our own servers?

meyer9 commented 5 years ago

I think we can just use theirs. I wonder if there is a max connections implemented yet.

meyer9 commented 5 years ago

Rebased with master