Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
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
exchain
nebula
Commits
f75aae34
Commit
f75aae34
authored
Jan 25, 2023
by
Joshua Gutow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: Fix disable p2p
parent
f3f9960c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
main.go
op-node/cmd/main.go
+1
-1
config.go
op-node/p2p/config.go
+5
-0
prepared.go
op-node/p2p/prepared.go
+4
-0
No files found.
op-node/cmd/main.go
View file @
f75aae34
...
@@ -123,7 +123,7 @@ func RollupNodeMain(ctx *cli.Context) error {
...
@@ -123,7 +123,7 @@ func RollupNodeMain(ctx *cli.Context) error {
if
cfg
.
Heartbeat
.
Enabled
{
if
cfg
.
Heartbeat
.
Enabled
{
var
peerID
string
var
peerID
string
if
cfg
.
P2P
==
nil
{
if
cfg
.
P2P
.
Disabled
()
{
peerID
=
"disabled"
peerID
=
"disabled"
}
else
{
}
else
{
peerID
=
n
.
P2P
()
.
Host
()
.
ID
()
.
String
()
peerID
=
n
.
P2P
()
.
Host
()
.
ID
()
.
String
()
...
...
op-node/p2p/config.go
View file @
f75aae34
...
@@ -33,6 +33,7 @@ var DefaultBootnodes = []*enode.Node{
...
@@ -33,6 +33,7 @@ var DefaultBootnodes = []*enode.Node{
// SetupP2P provides a host and discovery service for usage in the rollup node.
// SetupP2P provides a host and discovery service for usage in the rollup node.
type
SetupP2P
interface
{
type
SetupP2P
interface
{
Check
()
error
Check
()
error
Disabled
()
bool
// Host creates a libp2p host service. Returns nil, nil if p2p is disabled.
// Host creates a libp2p host service. Returns nil, nil if p2p is disabled.
Host
(
log
log
.
Logger
,
reporter
metrics
.
Reporter
)
(
host
.
Host
,
error
)
Host
(
log
log
.
Logger
,
reporter
metrics
.
Reporter
)
(
host
.
Host
,
error
)
// Discovery creates a disc-v5 service. Returns nil, nil, nil if discovery is disabled.
// Discovery creates a disc-v5 service. Returns nil, nil, nil if discovery is disabled.
...
@@ -134,6 +135,10 @@ func (conf *Config) TargetPeers() uint {
...
@@ -134,6 +135,10 @@ func (conf *Config) TargetPeers() uint {
return
conf
.
PeersLo
return
conf
.
PeersLo
}
}
func
(
conf
*
Config
)
Disabled
()
bool
{
return
conf
.
DisableP2P
}
const
maxMeshParam
=
1000
const
maxMeshParam
=
1000
func
(
conf
*
Config
)
Check
()
error
{
func
(
conf
*
Config
)
Check
()
error
{
...
...
op-node/p2p/prepared.go
View file @
f75aae34
...
@@ -63,3 +63,7 @@ func (p *Prepared) Discovery(log log.Logger, rollupCfg *rollup.Config, tcpPort u
...
@@ -63,3 +63,7 @@ func (p *Prepared) Discovery(log log.Logger, rollupCfg *rollup.Config, tcpPort u
func
(
p
*
Prepared
)
ConfigureGossip
(
params
*
pubsub
.
GossipSubParams
)
[]
pubsub
.
Option
{
func
(
p
*
Prepared
)
ConfigureGossip
(
params
*
pubsub
.
GossipSubParams
)
[]
pubsub
.
Option
{
return
nil
return
nil
}
}
func
(
p
*
Prepared
)
Disabled
()
bool
{
return
false
}
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