Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
207c03bc
Unverified
Commit
207c03bc
authored
Jan 14, 2021
by
acud
Committed by
GitHub
Jan 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update libp2p version (#1095)
parent
533e83f3
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
208 additions
and
83 deletions
+208
-83
terminal.go
cmd/bee/cmd/terminal.go
+2
-2
go.mod
go.mod
+29
-25
go.sum
go.sum
+135
-48
libp2p.go
pkg/p2p/libp2p/libp2p.go
+9
-6
stream.go
pkg/p2p/libp2p/stream.go
+33
-2
No files found.
cmd/bee/cmd/terminal.go
View file @
207c03bc
...
...
@@ -9,7 +9,7 @@ import (
"os"
"github.com/spf13/cobra"
"golang.org/x/
crypto/ssh/terminal
"
"golang.org/x/
term
"
)
type
passwordReader
interface
{
...
...
@@ -19,7 +19,7 @@ type passwordReader interface {
type
stdInPasswordReader
struct
{}
func
(
stdInPasswordReader
)
ReadPassword
()
(
password
string
,
err
error
)
{
v
,
err
:=
term
inal
.
ReadPassword
(
int
(
os
.
Stdin
.
Fd
()))
v
,
err
:=
term
.
ReadPassword
(
int
(
os
.
Stdin
.
Fd
()))
if
err
!=
nil
{
return
""
,
err
}
...
...
go.mod
View file @
207c03bc
...
...
@@ -3,7 +3,8 @@ module github.com/ethersphere/bee
go 1.14
require (
github.com/btcsuite/btcd v0.20.1-beta
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/btcsuite/btcd v0.21.0-beta
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect
github.com/coreos/go-semver v0.3.0
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
...
...
@@ -12,35 +13,37 @@ require (
github.com/ethersphere/langos v1.0.0
github.com/ethersphere/manifest v0.3.6
github.com/ethersphere/sw3-bindings/v2 v2.1.0
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gogo/protobuf v1.3.1
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.1.4 // indirect
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.7.4
github.com/gorilla/websocket v1.4.2
github.com/ipfs/go-log/v2 v2.1.1 // indirect
github.com/kardianos/service v1.2.0
github.com/koron/go-ssdp v0.0.2 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-libp2p v0.10.0
github.com/libp2p/go-libp2p-autonat v0.3.0 // indirect
github.com/libp2p/go-libp2p-autonat-svc v0.1.0
github.com/libp2p/go-libp2p-circuit v0.3.0 // indirect
github.com/libp2p/go-libp2p-core v0.6.0
github.com/libp2p/go-libp2p-discovery v0.5.0 // indirect
github.com/libp2p/go-libp2p v0.13.0
github.com/libp2p/go-libp2p-autonat v0.4.0
github.com/libp2p/go-libp2p-core v0.8.0
github.com/libp2p/go-libp2p-noise v0.1.2 // indirect
github.com/libp2p/go-libp2p-peerstore v0.2.6
github.com/libp2p/go-libp2p-quic-transport v0.8.0
github.com/libp2p/go-libp2p-transport-upgrader v0.3.0
github.com/libp2p/go-openssl v0.0.6 // indirect
github.com/libp2p/go-tcp-transport v0.2.0
github.com/libp2p/go-ws-transport v0.3.1
github.com/libp2p/go-yamux v1.3.8 // indirect
github.com/libp2p/go-libp2p-quic-transport v0.10.0
github.com/libp2p/go-libp2p-transport-upgrader v0.4.0
github.com/libp2p/go-netroute v0.1.4 // indirect
github.com/libp2p/go-sockaddr v0.1.0 // indirect
github.com/libp2p/go-tcp-transport v0.2.1
github.com/libp2p/go-ws-transport v0.4.0
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/mitchellh/mapstructure v1.3.2 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-multiaddr v0.2.2
github.com/multiformats/go-multiaddr v0.3.1
github.com/multiformats/go-multiaddr-dns v0.2.0
github.com/multiformats/go-multistream v0.
1.1
github.com/multiformats/go-multistream v0.
2.0
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/opentracing/opentracing-go v1.
1
.0
github.com/opentracing/opentracing-go v1.
2
.0
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/prometheus/client_golang v1.7.1
github.com/sirupsen/logrus v1.6.0
...
...
@@ -56,15 +59,16 @@ require (
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
github.com/wealdtech/go-ens/v3 v3.4.3
gitlab.com/nolash/go-mockbytes v0.0.7
go.opencensus.io v0.22.
4
// indirect
go.uber.org/
zap v1.15
.0 // indirect
go
lang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
golang.org/x/
lint v0.0.0-20200302205851-738671d3881b // indirect
go.opencensus.io v0.22.
5
// indirect
go.uber.org/
multierr v1.6
.0 // indirect
go
.uber.org/zap v1.16.0 // indirect
golang.org/x/
crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/mod v0.3.0 // indirect
golang.org/x/net v0.0.0-2020
0707034311-ab3426394381
golang.org/x/net v0.0.0-2020
1224014010-6772e930b67b
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211
golang.org/x/text v0.3.3 // indirect
golang.org/x/sys v0.0.0-20210108172913-0df2131ae363
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf
golang.org/x/text v0.3.4 // indirect
golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
...
...
go.sum
View file @
207c03bc
This diff is collapsed.
Click to expand it.
pkg/p2p/libp2p/libp2p.go
View file @
207c03bc
...
...
@@ -25,7 +25,7 @@ import (
"github.com/ethersphere/bee/pkg/swarm"
"github.com/ethersphere/bee/pkg/tracing"
"github.com/libp2p/go-libp2p"
autonat
"github.com/libp2p/go-libp2p-autonat
-svc
"
autonat
"github.com/libp2p/go-libp2p-autonat"
crypto
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
...
...
@@ -173,14 +173,17 @@ func New(ctx context.Context, signer beecrypto.Signer, networkID uint64, overlay
return
nil
,
err
}
// Support same non default security and transport options as
// original host.
dialer
,
err
:=
libp2p
.
New
(
ctx
,
append
(
transports
,
security
)
...
)
if
err
!=
nil
{
return
nil
,
err
}
// If you want to help other peers to figure out if they are behind
// NATs, you can launch the server-side of AutoNAT too (AutoRelay
// already runs the client)
if
_
,
err
=
autonat
.
NewAutoNATService
(
ctx
,
h
,
// Support same non default security and transport options as
// original host.
append
(
transports
,
security
)
...
,
);
err
!=
nil
{
if
_
,
err
=
autonat
.
New
(
ctx
,
h
,
autonat
.
EnableService
(
dialer
.
Network
()));
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"autonat: %w"
,
err
)
}
...
...
pkg/p2p/libp2p/stream.go
View file @
207c03bc
...
...
@@ -5,11 +5,18 @@
package
libp2p
import
(
"errors"
"io"
"time"
"github.com/ethersphere/bee/pkg/p2p"
"github.com/libp2p/go-libp2p-core/helpers"
"github.com/libp2p/go-libp2p-core/network"
)
var
(
closeDeadline
=
30
*
time
.
Second
errExpectedEof
=
errors
.
New
(
"read: expected eof"
)
)
var
_
p2p
.
Stream
=
(
*
stream
)(
nil
)
type
stream
struct
{
...
...
@@ -29,5 +36,29 @@ func (s *stream) Headers() p2p.Headers {
}
func
(
s
*
stream
)
FullClose
()
error
{
return
helpers
.
FullClose
(
s
)
if
err
:=
s
.
CloseWrite
();
err
!=
nil
{
_
=
s
.
Reset
()
return
err
}
// So we don't wait forever
_
=
s
.
SetDeadline
(
time
.
Now
()
.
Add
(
closeDeadline
))
// We *have* to observe the EOF. Otherwise, we leak the stream.
// Now, technically, we should do this *before*
// returning from SendMessage as the message
// hasn't really been sent yet until we see the
// EOF but we don't actually *know* what
// protocol the other side is speaking.
n
,
err
:=
s
.
Read
([]
byte
{
0
})
if
n
>
0
||
err
==
nil
{
_
=
s
.
Reset
()
return
errExpectedEof
}
if
err
!=
io
.
EOF
{
_
=
s
.
Reset
()
return
err
}
return
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment