Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to KCP backend. #44

Merged
merged 34 commits into from Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5c8cb3d
Migrating to KCP. Errors everywhere; please do not use.
iwasaki-kenta Jun 26, 2018
29bfcb5
Finished multiplexing streams, accepting and sending RPC/async calls,…
iwasaki-kenta Jun 26, 2018
154e45f
Added in message execution context; IP's appear to duplicate on peer …
iwasaki-kenta Jun 26, 2018
46ca077
Re-introduced broadcasting methods; debugging for issues denoted in P…
iwasaki-kenta Jun 26, 2018
d075b05
Formatting.
iwasaki-kenta Jun 26, 2018
0ecb8b1
Fixed peers from dialing themselves in amidst peer discovery.
iwasaki-kenta Jun 26, 2018
c158c1d
use uint16 for ports
abbychau Jun 26, 2018
4916011
Defer bootstrapping of peers until network is started
itsalexyue Jun 26, 2018
1998a30
Handle error case for bootstrapping
itsalexyue Jun 26, 2018
76868cd
Had all bytes read/written through buffered IO. Mostly solves the iss…
iwasaki-kenta Jun 27, 2018
a4e14bf
Moved message and signature verification to stream I/O and appended m…
iwasaki-kenta Jun 27, 2018
ad000c4
Renamed `outgoing` to `Session` in `network/client.go`.
iwasaki-kenta Jun 27, 2018
e1705a5
Made (blocking until server is ready) a simple go channel that doesn'…
iwasaki-kenta Jun 27, 2018
6659d80
Updated dependencies.
iwasaki-kenta Jun 27, 2018
ffd5718
Tracked disconnection of peers. TODO: KeepAlive interval looks a litt…
iwasaki-kenta Jun 27, 2018
d144a7d
Migrating to KCP. Errors everywhere; please do not use.
iwasaki-kenta Jun 26, 2018
49b4f15
Finished multiplexing streams, accepting and sending RPC/async calls,…
iwasaki-kenta Jun 26, 2018
8d11afc
Added in message execution context; IP's appear to duplicate on peer …
iwasaki-kenta Jun 26, 2018
9aaf797
Re-introduced broadcasting methods; debugging for issues denoted in P…
iwasaki-kenta Jun 26, 2018
1490c6c
Formatting.
iwasaki-kenta Jun 26, 2018
caa4fcf
Fixed peers from dialing themselves in amidst peer discovery.
iwasaki-kenta Jun 26, 2018
0ce11ab
use uint16 for ports
abbychau Jun 26, 2018
15a0995
Defer bootstrapping of peers until network is started
itsalexyue Jun 26, 2018
70d8127
Handle error case for bootstrapping
itsalexyue Jun 26, 2018
1cbbe87
Had all bytes read/written through buffered IO. Mostly solves the iss…
iwasaki-kenta Jun 27, 2018
a4b289b
Moved message and signature verification to stream I/O and appended m…
iwasaki-kenta Jun 27, 2018
4f39116
Renamed `outgoing` to `Session` in `network/client.go`.
iwasaki-kenta Jun 27, 2018
039ebeb
Made (blocking until server is ready) a simple go channel that doesn'…
iwasaki-kenta Jun 27, 2018
4ad921b
Updated dependencies.
iwasaki-kenta Jun 27, 2018
0b9e7bf
Tracked disconnection of peers. TODO: KeepAlive interval looks a litt…
iwasaki-kenta Jun 27, 2018
61105d7
Fix up the tests to compile
doug-perlin Jun 27, 2018
09cc5f5
Merge branch 'kcp' of github.com:perlin-network/noise into kcp
doug-perlin Jun 27, 2018
c2c5753
Fix the panic
doug-perlin Jun 27, 2018
6d03252
kcp: clean up test
doug-perlin Jun 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/clusters/messages/cluster.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 0 additions & 28 deletions grpc_utils/ready.go

This file was deleted.

8 changes: 0 additions & 8 deletions main.go
Expand Up @@ -2,15 +2,12 @@ package main

import (
"flag"
"fmt"
"strings"

"github.com/golang/glog"
"github.com/perlin-network/noise/crypto"
"github.com/perlin-network/noise/grpc_utils"
"github.com/perlin-network/noise/network/builders"
"github.com/perlin-network/noise/network/discovery"
"time"
)

func main() {
Expand Down Expand Up @@ -49,11 +46,6 @@ func main() {
go net.Listen()

if len(peers) > 0 {
blockTimeout := 10 * time.Second
if err := grpc_utils.BlockUntilConnectionReady(host, port, blockTimeout); err != nil {
glog.Warningf(fmt.Sprintf("Error: port was not available, cannot bootstrap peers, err=%+v", err))
}

net.Bootstrap(peers...)
}

Expand Down
6 changes: 3 additions & 3 deletions network/builders/network.go
Expand Up @@ -39,7 +39,7 @@ func (builder *NetworkBuilder) SetPort(port int) {
func (builder *NetworkBuilder) AddProcessor(message proto.Message, processor network.MessageProcessor) {
// Initialize map if not exist.
if builder.processors == nil {
builder.processors = &network.StringMessageProcessorSyncMap {}
builder.processors = &network.StringMessageProcessorSyncMap{}
}

name := reflect.TypeOf(message).String()
Expand Down Expand Up @@ -67,7 +67,7 @@ func (builder *NetworkBuilder) BuildNetwork() (*network.Network, error) {

// Initialize map if not exist.
if builder.processors == nil {
builder.processors = &network.StringMessageProcessorSyncMap {}
builder.processors = &network.StringMessageProcessorSyncMap{}
}

unifiedHost, err := network.ToUnifiedHost(builder.host)
Expand All @@ -87,7 +87,7 @@ func (builder *NetworkBuilder) BuildNetwork() (*network.Network, error) {

Routes: dht.CreateRoutingTable(id),

Peers: &network.StringPeerClientSyncMap {},
Peers: &network.StringPeerClientSyncMap{},
}

return network, nil
Expand Down