Skip to content

Commit

Permalink
Ephemeral rendezvous client generates key using seckp256k1 curve
Browse files Browse the repository at this point in the history
  • Loading branch information
dshulyak committed Sep 24, 2018
1 parent 8aef7c4 commit aab84e5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Gopkg.lock

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

2 changes: 1 addition & 1 deletion discovery/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestProxyToRendezvous(t *testing.T) {
stop = make(chan struct{})
wg sync.WaitGroup
)
client, err := rendezvous.NewTemporary()
client, err := rendezvous.NewEphemeral()
require.NoError(t, err)
reg.Add(topic, id)
wg.Add(1)
Expand Down
2 changes: 1 addition & 1 deletion discovery/rendezvous.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (r *Rendezvous) Running() bool {
func (r *Rendezvous) Start() error {
r.mu.Lock()
defer r.mu.Unlock()
client, err := rendezvous.NewTemporary()
client, err := rendezvous.NewEphemeral()
if err != nil {
return err
}
Expand Down
15 changes: 15 additions & 0 deletions discovery/rendezvous_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,18 @@ func TestRendezvousDiscovery(t *testing.T) {
close(stop)
close(period)
}

func BenchmarkRendezvousStart(b *testing.B) {
identity, err := crypto.GenerateKey()
require.NoError(b, err)
addr, err := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/7777")
require.NoError(b, err)
node := discover.NewNode(discover.PubkeyID(&identity.PublicKey), net.IP{10, 10, 10, 10}, 10, 20)

b.ResetTimer()
for n := 0; n < b.N; n++ {
c, err := NewRendezvous([]ma.Multiaddr{addr}, identity, node)
require.NoError(b, err)
require.NoError(b, c.Start())
}
}
4 changes: 2 additions & 2 deletions vendor/github.com/status-im/rendezvous/client.go

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

0 comments on commit aab84e5

Please sign in to comment.