FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ev-node/node/node.go at main · evstack/ev-node · GitHub
evstack
/
ev-node
Public
Notifications
You must be signed in to change notification settings
Fork
281
Star
361
Code
Issues
4
Pull requests
3
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ev-node
/
node
/
node.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
74 lines (64 loc) · 1.8 KB
Breadcrumbs
ev-node
/
node
/
node.go
Copy path
File metadata and controls
74 lines (64 loc) · 1.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package
node
import
(
"context"
ds
"github.com/ipfs/go-datastore"
"github.com/rs/zerolog"
"github.com/evstack/ev-node/block"
coreexecutor
"github.com/evstack/ev-node/core/execution"
coresequencer
"github.com/evstack/ev-node/core/sequencer"
"github.com/evstack/ev-node/pkg/config"
"github.com/evstack/ev-node/pkg/genesis"
"github.com/evstack/ev-node/pkg/p2p"
"github.com/evstack/ev-node/pkg/service"
"github.com/evstack/ev-node/pkg/signer"
)
// Node is the interface for an application node
type
Node
interface
{
service.
Service
IsRunning
()
bool
}
// LeaderResigner is an optional interface implemented by nodes that participate
// in Raft leader election. Callers should type-assert to this interface and call
// ResignLeader before cancelling the node context on graceful shutdown.
type
LeaderResigner
interface
{
ResignLeader
(
ctx
context.
Context
)
error
}
type
NodeOptions
struct
{
BlockOptions
block.
BlockOptions
}
// NewNode returns a new Full or Light Node based on the config.
// This is the entry point for composing a node, when compiling a node, you need to provide an executor.
// Example executors can be found in apps/
func
NewNode
(
conf
config.
Config
,
exec
coreexecutor.
Executor
,
sequencer
coresequencer.
Sequencer
,
daClient
block.
DAClient
,
signer
signer.
Signer
,
p2pClient
*
p2p.
Client
,
genesis
genesis.
Genesis
,
database
ds.
Batching
,
metricsProvider
MetricsProvider
,
logger
zerolog.
Logger
,
nodeOptions
NodeOptions
,
) (
Node
,
error
) {
if
conf
.
Node
.
Light
{
return
newLightNode
(
conf
,
genesis
,
p2pClient
,
database
,
logger
)
}
if
err
:=
nodeOptions
.
BlockOptions
.
Validate
();
err
!=
nil
{
nodeOptions
.
BlockOptions
=
block
.
DefaultBlockOptions
()
}
return
newFullNode
(
conf
,
p2pClient
,
signer
,
genesis
,
database
,
exec
,
sequencer
,
daClient
,
metricsProvider
,
logger
,
nodeOptions
,
)
}
Back
|
FazBrowse Home
|
New Git URL