Skip to content

Commit d4c7e7d

Browse files
committed
Add high availabiliy via raft
1 parent 8436bf4 commit d4c7e7d

69 files changed

Lines changed: 3386 additions & 643 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mockery.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ packages:
3232
dir: ./test/mocks
3333
pkgname: mocks
3434
filename: p2p.go
35+
github.com/evstack/ev-node/pkg/raft:
36+
interfaces:
37+
sourceNode:
38+
config:
39+
dir: ./pkg/raft
40+
pkgname: raft
41+
filename: node_mock.go
3542
github.com/evstack/ev-node/pkg/store:
3643
interfaces:
3744
Store:

apps/evm/single/cmd/run.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
rollcmd "github.com/evstack/ev-node/pkg/cmd"
2222
"github.com/evstack/ev-node/pkg/config"
2323
genesispkg "github.com/evstack/ev-node/pkg/genesis"
24-
"github.com/evstack/ev-node/pkg/p2p"
2524
"github.com/evstack/ev-node/pkg/p2p/key"
2625
"github.com/evstack/ev-node/pkg/store"
2726
)
@@ -97,12 +96,7 @@ var RunCmd = &cobra.Command{
9796
return err
9897
}
9998

100-
p2pClient, err := p2p.NewClient(nodeConfig.P2P, nodeKey.PrivKey, datastore, genesis.ChainID, logger, nil)
101-
if err != nil {
102-
return err
103-
}
104-
105-
return rollcmd.StartNode(logger, cmd, executor, sequencer, &daJrpc.DA, p2pClient, datastore, nodeConfig, genesis, node.NodeOptions{})
99+
return rollcmd.StartNode(logger, cmd, executor, sequencer, &daJrpc.DA, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{})
106100
},
107101
}
108102

apps/evm/single/go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ require (
2323
connectrpc.com/grpcreflect v1.3.0 // indirect
2424
github.com/Microsoft/go-winio v0.6.2 // indirect
2525
github.com/StackExchange/wmi v1.2.1 // indirect
26+
github.com/armon/go-metrics v0.4.1 // indirect
2627
github.com/benbjohnson/clock v1.3.5 // indirect
2728
github.com/beorn7/perks v1.0.1 // indirect
2829
github.com/bits-and-blooms/bitset v1.20.0 // indirect
30+
github.com/boltdb/bolt v1.3.1 // indirect
2931
github.com/celestiaorg/go-libp2p-messenger v0.2.2 // indirect
3032
github.com/celestiaorg/go-square/v3 v3.0.2 // indirect
3133
github.com/cespare/xxhash/v2 v2.3.0 // indirect
@@ -42,6 +44,7 @@ require (
4244
github.com/emicklei/dot v1.6.2 // indirect
4345
github.com/ethereum/c-kzg-4844/v2 v2.1.3 // indirect
4446
github.com/ethereum/go-verkle v0.2.2 // indirect
47+
github.com/fatih/color v1.16.0 // indirect
4548
github.com/ferranbt/fastssz v0.1.4 // indirect
4649
github.com/filecoin-project/go-clock v0.1.0 // indirect
4750
github.com/filecoin-project/go-jsonrpc v0.9.0 // indirect
@@ -63,8 +66,14 @@ require (
6366
github.com/google/gopacket v1.1.19 // indirect
6467
github.com/google/uuid v1.6.0 // indirect
6568
github.com/gorilla/websocket v1.5.3 // indirect
69+
github.com/hashicorp/go-hclog v1.6.2 // indirect
70+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
71+
github.com/hashicorp/go-msgpack v0.5.5 // indirect
72+
github.com/hashicorp/go-msgpack/v2 v2.1.2 // indirect
6673
github.com/hashicorp/golang-lru v1.0.2 // indirect
6774
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
75+
github.com/hashicorp/raft v1.7.1 // indirect
76+
github.com/hashicorp/raft-boltdb v0.0.0-20231211162105-6c830fa4535e // indirect
6877
github.com/holiman/uint256 v1.3.2 // indirect
6978
github.com/huin/goupnp v1.3.0 // indirect
7079
github.com/inconshreveable/mousetrap v1.1.0 // indirect

apps/evm/single/go.sum

Lines changed: 95 additions & 0 deletions
Large diffs are not rendered by default.

apps/grpc/single/cmd/run.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
rollcmd "github.com/evstack/ev-node/pkg/cmd"
1515
"github.com/evstack/ev-node/pkg/config"
1616
rollgenesis "github.com/evstack/ev-node/pkg/genesis"
17-
"github.com/evstack/ev-node/pkg/p2p"
1817
"github.com/evstack/ev-node/pkg/p2p/key"
1918
"github.com/evstack/ev-node/pkg/store"
2019
"github.com/evstack/ev-node/sequencers/single"
@@ -100,14 +99,8 @@ The execution client must implement the Evolve execution gRPC interface.`,
10099
return err
101100
}
102101

103-
// Create P2P client
104-
p2pClient, err := p2p.NewClient(nodeConfig.P2P, nodeKey.PrivKey, datastore, genesis.ChainID, logger, nil)
105-
if err != nil {
106-
return err
107-
}
108-
109102
// Start the node
110-
return rollcmd.StartNode(logger, cmd, executor, sequencer, &daJrpc.DA, p2pClient, datastore, nodeConfig, genesis, node.NodeOptions{})
103+
return rollcmd.StartNode(logger, cmd, executor, sequencer, &daJrpc.DA, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{})
111104
},
112105
}
113106

apps/grpc/single/go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ require (
1616
require (
1717
connectrpc.com/connect v1.19.1 // indirect
1818
connectrpc.com/grpcreflect v1.3.0 // indirect
19+
github.com/armon/go-metrics v0.4.1 // indirect
1920
github.com/benbjohnson/clock v1.3.5 // indirect
2021
github.com/beorn7/perks v1.0.1 // indirect
22+
github.com/boltdb/bolt v1.3.1 // indirect
2123
github.com/celestiaorg/go-header v0.7.3 // indirect
2224
github.com/celestiaorg/go-libp2p-messenger v0.2.2 // indirect
2325
github.com/celestiaorg/go-square/v3 v3.0.2 // indirect
@@ -28,6 +30,7 @@ require (
2830
github.com/dgraph-io/badger/v4 v4.5.1 // indirect
2931
github.com/dgraph-io/ristretto/v2 v2.1.0 // indirect
3032
github.com/dustin/go-humanize v1.0.1 // indirect
33+
github.com/fatih/color v1.13.0 // indirect
3134
github.com/filecoin-project/go-clock v0.1.0 // indirect
3235
github.com/filecoin-project/go-jsonrpc v0.9.0 // indirect
3336
github.com/flynn/noise v1.1.0 // indirect
@@ -44,8 +47,14 @@ require (
4447
github.com/google/gopacket v1.1.19 // indirect
4548
github.com/google/uuid v1.6.0 // indirect
4649
github.com/gorilla/websocket v1.5.3 // indirect
50+
github.com/hashicorp/go-hclog v1.6.2 // indirect
51+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
52+
github.com/hashicorp/go-msgpack v0.5.5 // indirect
53+
github.com/hashicorp/go-msgpack/v2 v2.1.2 // indirect
4754
github.com/hashicorp/golang-lru v1.0.2 // indirect
4855
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
56+
github.com/hashicorp/raft v1.7.1 // indirect
57+
github.com/hashicorp/raft-boltdb v0.0.0-20231211162105-6c830fa4535e // indirect
4958
github.com/huin/goupnp v1.3.0 // indirect
5059
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5160
github.com/ipfs/boxo v0.35.0 // indirect

0 commit comments

Comments
 (0)