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
7b3a853b
Unverified
Commit
7b3a853b
authored
Mar 31, 2020
by
Janoš Guljaš
Committed by
GitHub
Mar 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove libp2p Options type from node Bee Options (#31)
parent
8a8d0198
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
19 deletions
+23
-19
start.go
cmd/bee/cmd/start.go
+8
-12
node.go
pkg/node/node.go
+15
-7
No files found.
cmd/bee/cmd/start.go
View file @
7b3a853b
...
...
@@ -21,7 +21,6 @@ import (
"github.com/ethersphere/bee/pkg/logging"
"github.com/ethersphere/bee/pkg/node"
"github.com/ethersphere/bee/pkg/p2p/libp2p"
)
func
(
c
*
command
)
initStartCmd
()
(
err
error
)
{
...
...
@@ -93,17 +92,14 @@ func (c *command) initStartCmd() (err error) {
}
b
,
err
:=
node
.
NewBee
(
node
.
Options
{
DataDir
:
c
.
config
.
GetString
(
optionNameDataDir
),
Password
:
password
,
APIAddr
:
c
.
config
.
GetString
(
optionNameAPIAddr
),
DebugAPIAddr
:
debugAPIAddr
,
LibP2POptions
:
libp2p
.
Options
{
Addr
:
c
.
config
.
GetString
(
optionNameP2PAddr
),
DisableWS
:
c
.
config
.
GetBool
(
optionNameP2PDisableWS
),
DisableQUIC
:
c
.
config
.
GetBool
(
optionNameP2PDisableQUIC
),
NetworkID
:
c
.
config
.
GetInt32
(
optionNameNetworkID
),
Logger
:
logger
,
},
DataDir
:
c
.
config
.
GetString
(
optionNameDataDir
),
Password
:
password
,
APIAddr
:
c
.
config
.
GetString
(
optionNameAPIAddr
),
DebugAPIAddr
:
debugAPIAddr
,
Addr
:
c
.
config
.
GetString
(
optionNameP2PAddr
),
DisableWS
:
c
.
config
.
GetBool
(
optionNameP2PDisableWS
),
DisableQUIC
:
c
.
config
.
GetBool
(
optionNameP2PDisableQUIC
),
NetworkID
:
c
.
config
.
GetInt32
(
optionNameNetworkID
),
Bootnodes
:
c
.
config
.
GetStringSlice
(
optionNameBootnodes
),
TracingEnabled
:
c
.
config
.
GetBool
(
optionNameTracingEnabled
),
TracingEndpoint
:
c
.
config
.
GetString
(
optionNameTracingEndpoint
),
...
...
pkg/node/node.go
View file @
7b3a853b
...
...
@@ -47,7 +47,10 @@ type Options struct {
Password
string
APIAddr
string
DebugAPIAddr
string
LibP2POptions
libp2p
.
Options
Addr
string
DisableWS
bool
DisableQUIC
bool
NetworkID
int32
Bootnodes
[]
string
Logger
logging
.
Logger
TracingEnabled
bool
...
...
@@ -104,12 +107,17 @@ func NewBee(o Options) (*Bee, error) {
logger
.
Infof
(
"new libp2p key created"
)
}
libP2POptions
:=
o
.
LibP2POptions
libP2POptions
.
Overlay
=
address
libP2POptions
.
PrivateKey
=
libp2pPrivateKey
libP2POptions
.
Addressbook
=
addressbook
libP2POptions
.
Tracer
=
tracer
p2ps
,
err
:=
libp2p
.
New
(
p2pCtx
,
libP2POptions
)
p2ps
,
err
:=
libp2p
.
New
(
p2pCtx
,
libp2p
.
Options
{
PrivateKey
:
libp2pPrivateKey
,
Overlay
:
address
,
Addr
:
o
.
Addr
,
DisableWS
:
o
.
DisableWS
,
DisableQUIC
:
o
.
DisableQUIC
,
NetworkID
:
o
.
NetworkID
,
Addressbook
:
addressbook
,
Logger
:
logger
,
Tracer
:
tracer
,
})
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"p2p service: %w"
,
err
)
}
...
...
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