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
1630ad33
Commit
1630ad33
authored
Jan 23, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: config
parent
d92d1c00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
load_config.go
op-node/p2p/cli/load_config.go
+5
-0
config.go
op-node/p2p/config.go
+8
-0
No files found.
op-node/p2p/cli/load_config.go
View file @
1630ad33
...
@@ -74,6 +74,11 @@ func validatePort(p uint) (uint16, error) {
...
@@ -74,6 +74,11 @@ func validatePort(p uint) (uint16, error) {
return
uint16
(
p
),
nil
return
uint16
(
p
),
nil
}
}
func
loadScoringOpts
(
conf
*
p2p
.
Config
,
ctx
*
cli
.
Context
)
error
{
conf
.
ScoringParams
=
p2p
.
DefaultScoringParams
return
nil
}
func
loadListenOpts
(
conf
*
p2p
.
Config
,
ctx
*
cli
.
Context
)
error
{
func
loadListenOpts
(
conf
*
p2p
.
Config
,
ctx
*
cli
.
Context
)
error
{
listenIP
:=
ctx
.
GlobalString
(
flags
.
ListenIP
.
Name
)
listenIP
:=
ctx
.
GlobalString
(
flags
.
ListenIP
.
Name
)
if
listenIP
!=
""
{
// optional
if
listenIP
!=
""
{
// optional
...
...
op-node/p2p/config.go
View file @
1630ad33
...
@@ -49,6 +49,9 @@ type Config struct {
...
@@ -49,6 +49,9 @@ type Config struct {
DisableP2P
bool
DisableP2P
bool
NoDiscovery
bool
NoDiscovery
bool
// P2P Scoring Configurations
ScoringConfig
*
ScoringConfig
ListenIP
net
.
IP
ListenIP
net
.
IP
ListenTCPPort
uint16
ListenTCPPort
uint16
...
@@ -95,6 +98,11 @@ type Config struct {
...
@@ -95,6 +98,11 @@ type Config struct {
ConnMngr
func
(
conf
*
Config
)
(
connmgr
.
ConnManager
,
error
)
ConnMngr
func
(
conf
*
Config
)
(
connmgr
.
ConnManager
,
error
)
}
}
type
ScoringConfig
struct
{
// Scoring Level
EnablePeerScoring
bool
}
type
ConnectionGater
interface
{
type
ConnectionGater
interface
{
connmgr
.
ConnectionGater
connmgr
.
ConnectionGater
...
...
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