Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/juno on sedge #333

Open
wants to merge 54 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
cc0373a
providing juno support on sedge
Tomi-3-0 Oct 21, 2023
12fb8b8
added starknet to list of supported clients to show in cli
Tomi-3-0 Oct 24, 2023
7c947a6
supporting docs for juno#2
Tomi-3-0 Oct 25, 2023
cb298e3
removed a comment
Tomi-3-0 Oct 25, 2023
c7466a6
support for generating consensus and execution clients together with …
Tomi-3-0 Nov 7, 2023
3427601
Add: check for EC_API_URL for 'sedge generate starknet' command
Nov 19, 2023
237f6bd
Add: added to list of ports for juno.tmpl
Nov 20, 2023
9b6459f
Add: Juno uri validator for Eth1 endpoint
Nov 20, 2023
11f64e6
Add:support for Eth-1-endpoint
Nov 20, 2023
f98cbea
fix: enabled http
Nov 21, 2023
b46454f
fix: add starknet template to env_base in goerli
Nov 21, 2023
f8fd0d9
fix:changed host endpoint
Nov 21, 2023
c06c0bc
fix: expose ports
Nov 22, 2023
93498dd
fix: corrected L2WSPort to L2WsPort
Nov 22, 2023
0539407
removed flags for ports
Nov 23, 2023
0152aa2
Add: modify EC_API_URL endpoint to use for Juno node
Nov 23, 2023
649d743
fix:added value for pending poll interval
Nov 23, 2023
7211573
added: nginx service for proxying requests
Nov 23, 2023
55971b9
fix:added appropriate directory for nginx config file
Nov 23, 2023
2350c2a
fix:added appropriate directory for nginx config file
Nov 23, 2023
dedb67f
fix:added appropriate volumes mapping for nginx
Nov 23, 2023
81c37e6
attempted fix: configuration for websocket
Nov 26, 2023
c8eaa64
fix: with fullstarknetflag mode
Nov 26, 2023
ff6f7be
fix: with full flag func, removed reverse proxy logic
Nov 27, 2023
b096abb
docs: updated readme with starknet client
Nov 27, 2023
57f480c
test: tests for scripts generation for starknet client using sedge cl…
Nov 28, 2023
b3eb852
test: added tests for starknet client
Nov 28, 2023
30a3c87
docs: added a running starknet node guide file
Nov 30, 2023
196a83d
fix: docs:updated flags for starknet in generate.mdx
Nov 30, 2023
4d07486
fix: support for specifying exact node name for starknet command
Dec 4, 2023
b75111c
test: added tests generate_tests for starknet
Dec 4, 2023
739beb3
tests: more tests for starknet
Dec 4, 2023
0d4ac91
fix:revert
Tomi-3-0 Dec 7, 2023
0a9878e
Merge branch 'main' into feat/juno-on-sedge
Tomi-3-0 Dec 7, 2023
bdfc4d0
resolve merge conflicts
Tomi-3-0 Dec 7, 2023
b0371cb
test: added test for full starknet node with execution and consensus
Tomi-3-0 Dec 8, 2023
183a2d0
Juno support for Sepolia and deprecated Goerli
Tomi-3-0 Dec 8, 2023
724102c
fix: resolve merge conflicts
Tomi-3-0 Dec 8, 2023
d19bb62
updated juno node version
Tomi-3-0 Dec 8, 2023
cf714c6
add: added flags for juno v0.8.0 and supporting test
Tomi-3-0 Dec 9, 2023
5ef4129
fix: execution api url output
Tomi-3-0 Dec 9, 2023
d44b103
fix: envs test for sepolia starknet
Tomi-3-0 Dec 9, 2023
480b963
style
Tomi-3-0 Dec 9, 2023
275e7a9
style: after running gofumpt -l -w . command
Tomi-3-0 Dec 9, 2023
b33324e
removed --remote-db flag for juno
Tomi-3-0 Dec 10, 2023
f938a31
style
Tomi-3-0 Dec 10, 2023
15f4128
test: TestGenerateComoposeServices test for starknet
Tomi-3-0 Dec 12, 2023
95c930d
Merge branch 'develop' into feat/juno-on-sedge
stdevMac Dec 14, 2023
1253443
removed empty templates for unsupported clients, and added starknet …
Tomi-3-0 Dec 15, 2023
df8b8c9
Merge branch 'feat/juno-on-sedge' of https://github.com/Tomi-3-0/sedg…
Tomi-3-0 Dec 15, 2023
0107080
fix: print sedge clients even for empty with non-existent starknet te…
Tomi-3-0 Dec 15, 2023
5be74eb
remove ldog info statemeent
Tomi-3-0 Dec 18, 2023
96d5a31
revert previous commit
Tomi-3-0 Dec 18, 2023
527f3b0
Add: removed executionApiUrl flag for Starknet and replaced with ethN…
Tomi-3-0 Dec 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ Users acknowledge that no warranty is being made of a successful installation. S

### Mainnet

| Execution | Consensus | Validator |
| ---------- | ---------- | ---------- |
| Geth | Lighthouse | Lighthouse |
| Nethermind | Lodestar | Lodestar |
| Erigon | Prysm | Prysm |
| Besu | Teku | Teku |
| Execution | Consensus | Validator | Starknet |
| ---------- | ---------- | ---------- |---------- |
| Geth | Lighthouse | Lighthouse | Juno |
| Nethermind | Lodestar | Lodestar | |
| Erigon | Prysm | Prysm | |
| Besu | Teku | Teku | |

### Sepolia

Expand All @@ -150,12 +150,12 @@ Users acknowledge that no warranty is being made of a successful installation. S

### Goerli

| Execution | Consensus | Validator |
| ---------- | ---------- | ---------- |
| Geth | Lighthouse | Lighthouse |
| Nethermind | Lodestar | Lodestar |
| Erigon | Prysm | Prysm |
| Besu | Teku | Teku |
| Execution | Consensus | Validator | Starknet |
| ---------- | ---------- | ---------- | ---------- |
| Geth | Lighthouse | Lighthouse | Juno |
| Nethermind | Lodestar | Lodestar | |
| Erigon | Prysm | Prysm | |
| Besu | Teku | Teku | |

### Holesky

Expand Down
3 changes: 3 additions & 0 deletions cli/actions/getContainers.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ func (actions *sedgeActions) GetContainersData(options GetContainersDataOptions)
if composeData.Services.Validator != nil && composeData.Services.Validator.ContainerName != "" {
containersNames = append(containersNames, composeData.Services.Validator.ContainerName)
}
if composeData.Services.Starknet != nil && composeData.Services.Starknet.ContainerName != "" {
containersNames = append(containersNames, composeData.Services.Starknet.ContainerName)
}

outputData := ContainersData{}
outputData.Containers = make([]ContainerData, 0, len(containersNames))
Expand Down
59 changes: 59 additions & 0 deletions cli/actions/getContainers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const (
consensusNotFoundContainerName = "sedge-execution-client-nf"
validatorContainerName = "sedge-validator-client"
validatorNotFoundContainerName = "sedge-validator-client-nf"
starknetContainerName = "sedge-starknet-client"
starknetNotFoundContainerName = "sedge-starknet-client-nf"
mevBoostContainerName = "sedge-mev-boost"

executionContainerIp = "192.168.1.1"
Expand All @@ -51,10 +53,13 @@ const (
validatorContainerImage = "consensys/teku"
mevBoostContainerIp = "192.168.1.4"
mevBoostContainerImage = "flashbots/mev-boost"
starknetContainerIp = "192.168.1.5"
starknetContainerImage = "nethermind/juno"
Tomi-3-0 marked this conversation as resolved.
Show resolved Hide resolved

executionNotFoundErrorMsg = "execution container not found"
consensusNotFoundErrorMsg = "consensus container not found"
validatorNotFoundErrorMsg = "validator container not found"
starknetNotFoundErrorMsg = "starknet container not found"

unexpectedContainerErrorMsg = "unexpected container name"
)
Expand Down Expand Up @@ -164,6 +169,7 @@ func getMockActions(
dockerClient.EXPECT().ContainerInspect(gomock.Any(), executionNotFoundContainerName).Return(types.ContainerJSON{}, errors.New(executionNotFoundErrorMsg)).AnyTimes()
dockerClient.EXPECT().ContainerInspect(gomock.Any(), consensusNotFoundContainerName).Return(types.ContainerJSON{}, errors.New(consensusNotFoundErrorMsg)).AnyTimes()
dockerClient.EXPECT().ContainerInspect(gomock.Any(), validatorNotFoundContainerName).Return(types.ContainerJSON{}, errors.New(validatorNotFoundErrorMsg)).AnyTimes()
dockerClient.EXPECT().ContainerInspect(gomock.Any(), starknetNotFoundContainerName).Return(types.ContainerJSON{}, errors.New(starknetNotFoundErrorMsg)).AnyTimes()
dockerClient.EXPECT().ContainerInspect(gomock.All(), gomock.All()).Return(types.ContainerJSON{}, errors.New(unexpectedContainerErrorMsg)).AnyTimes()

return actions.NewSedgeActions(
Expand Down Expand Up @@ -241,6 +247,33 @@ func TestGetContainersData(t *testing.T) {
},
},
),
buildGetContainersDataTestCase(
t,
"Starknet Full Node",
"",
"case_fullNodeStarknet",
false,
"",
actions.ContainersData{
Containers: []actions.ContainerData{
{
Name: executionContainerName,
Image: executionContainerImage,
Ip: executionContainerIp,
},
{
Name: consensusContainerName,
Image: consensusContainerImage,
Ip: consensusContainerIp,
},
{
Name: starknetContainerName,
Image: starknetContainerImage,
Ip: starknetContainerIp,
},
},
},
),
buildGetContainersDataTestCase(
t,
"Execution Only",
Expand Down Expand Up @@ -292,6 +325,23 @@ func TestGetContainersData(t *testing.T) {
},
},
),
buildGetContainersDataTestCase(
t,
"Starknet Only",
"",
"case_starknetOnly",
false,
"",
actions.ContainersData{
Containers: []actions.ContainerData{
{
Name: starknetContainerName,
Image: starknetContainerImage,
Ip: starknetContainerIp,
},
},
},
),
buildGetContainersDataTestCase(
t,
"No Execution",
Expand Down Expand Up @@ -427,6 +477,15 @@ func TestGetContainersData(t *testing.T) {
validatorNotFoundErrorMsg,
actions.ContainersData{Containers: []actions.ContainerData{}},
),
buildGetContainersDataTestCase(
t,
"Starknet Not Found",
"",
"case_starknetNF",
true,
starknetNotFoundErrorMsg,
actions.ContainersData{Containers: []actions.ContainerData{}},
),
}

for _, tc := range tcs {
Expand Down
14 changes: 7 additions & 7 deletions cli/actions/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ func TestSetupContainers(t *testing.T) {
name: "with services",
options: actions.SetupContainersOptions{
GenerationPath: filepath.Join("a", "b", "c", "d"),
Services: []string{"validator", "consensus", "execution"},
Services: []string{"validator", "consensus", "execution", "starknet"},
},
expectedBuildCmd: fmt.Sprintf("docker compose -f %s build validator consensus execution", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedPullCmd: fmt.Sprintf("docker compose -f %s pull validator consensus execution", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedCreateCmd: fmt.Sprintf("docker compose -f %s create validator consensus execution", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedBuildCmd: fmt.Sprintf("docker compose -f %s build validator consensus execution starknet", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedPullCmd: fmt.Sprintf("docker compose -f %s pull validator consensus execution starknet", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedCreateCmd: fmt.Sprintf("docker compose -f %s create validator consensus execution starknet", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
},
{
name: "without services",
Expand All @@ -58,12 +58,12 @@ func TestSetupContainers(t *testing.T) {
name: "skip-pull",
options: actions.SetupContainersOptions{
GenerationPath: filepath.Join("a", "b", "c", "d"),
Services: []string{"execution", "consensus"},
Services: []string{"execution", "consensus", "starknet"},
SkipPull: true,
},
expectedBuildCmd: fmt.Sprintf("docker compose -f %s build execution consensus", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedBuildCmd: fmt.Sprintf("docker compose -f %s build execution consensus starknet", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedPullCmd: "",
expectedCreateCmd: fmt.Sprintf("docker compose -f %s create execution consensus", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
expectedCreateCmd: fmt.Sprintf("docker compose -f %s create execution consensus starknet", filepath.Join("a", "b", "c", "d", "docker-compose.yml")),
},
}
for _, tc := range tests {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
version: "3.9"
services:
execution:
stop_grace_period: 30m
container_name: sedge-execution-client
restart: unless-stopped
image: ${EC_IMAGE_VERSION}
networks:
- sedge
volumes:
- ${EC_DATA_DIR}:/var/lib/besu/data
- ${EC_JWT_SECRET_PATH}:/var/lib/besu/jwtsecret
user: root
ports:
- 30303:30303/tcp
- 30303:30303/udp
- 8008:8008/tcp
expose:
- 8545
- 8551
command:
- --sync-mode=X_SNAP
- --data-storage-format=BONSAI
- --network=${NETWORK}
- --data-path=/var/lib/besu/data
- --metrics-enabled=true
- --metrics-host=0.0.0.0
- --metrics-port=8008
- --engine-rpc-enabled=true
- --engine-jwt-secret=/var/lib/besu/jwtsecret
- --engine-rpc-port=8551
- --engine-host-allowlist=*
- --rpc-http-enabled=true
- --rpc-http-host=0.0.0.0
- --rpc-http-port=8545
- --rpc-http-api=${EC_ENABLED_MODULES}
- --rpc-http-cors-origins=*
- --host-whitelist=*
logging:
driver: json-file
options:
max-size: 10m
max-file: "10"
consensus:
stop_grace_period: 30s
container_name: sedge-consensus-client
restart: unless-stopped
image: ${CC_IMAGE_VERSION}
networks:
- sedge
volumes:
- ${CC_DATA_DIR}:/var/lib/lodestar/consensus
- ${CC_JWT_SECRET_PATH}:/tmp/jwt/jwtsecret
ports:
- 9000:9000/tcp
- 9000:9000/udp
- 5054:5054/tcp
expose:
- 4000
environment:
NODE_OPTIONS: --max_old_space_size=6144
command:
- beacon
- --preset=${CC_LODESTAR_PRESET}
- --dataDir=/var/lib/lodestar/consensus
- --network=${NETWORK}
- --eth1=true
- --eth1.providerUrls=${EC_API_URL}
- --execution.urls=${EC_AUTH_URL}
- --logFile=/var/lib/lodestart/consensus/logs/beacon.log
- --logFileLevel=${CC_LOG_LEVEL}
- --port=9000
- --rest=true
- --rest.address=0.0.0.0
- --rest.port=4000
- --rest.cors=*
- --discv5=true
- --targetPeers=${CC_PEER_COUNT}
- --metrics=true
- --metrics.port=5054
- --jwt-secret=/tmp/jwt/jwtsecret
- --checkpointSyncUrl=${CHECKPOINT_SYNC_URL}
logging:
driver: json-file
options:
max-size: 10m
max-file: "10"
starknet-blocker:
container_name: sedge-starknet-blocker
image: busybox
networks:
- sedge
command: |-
sh -c "
echo 'Waiting 420 seconds of grace period before starting the starknet client';
sleep 420;
echo 'Done';
while true; do
response=$$(wget -S ${SC_API_URL}/eth/v1/node/health -O /dev/null 2>&1 | grep -m 1 "HTTP/" | awk '{print $$2}')
if [ $$response -eq 200 ]; then
echo 'Endpoint is up!'
break
else
echo 'Endpoint is down, waiting 30 seconds before checking again...'
sleep 30
fi
done
"
starknet:
tty: true
environment:
- TERM=xterm-256color
- COLORTERM=truecolor
stop_grace_period: 30s
container_name: sedge-starknet-client
restart: unless-stopped
image: ${L2_IMAGE_VERSION}
networks:
- sedge
volumes:
- ${L2_DATA_DIR}:/juno/data
ports:
- 6060:6060
- 6061:6061
expose:
- 6060
- 6061
command:
- --colour=true
- --db-path=/juno/data
- --eth-node=${ETH_NODE_URL}
- --http=true
- --http-host=0.0.0.0
- --http-port=6060
- --ws=true
- --ws-host=0.0.0.0
- --ws-port=6061
- --metrics=false
- --metrics-host=0.0.0.0
- --metrics-port=9090
- --grpc=false
- --grpc-host=0.0.0.0
- --grpc-port=6064
- --network=${NETWORK}
- --db-cache-size=8
- --max-vms=48
- --max-vm-queue=96
- --rpc-max-block-scan=18446744073709551615
- --pending-poll-interval=10s
networks:
sedge:
name: sedge-network
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: "3.9"
services:
starknet:
tty: true
environment:
- TERM=xterm-256color
- COLORTERM=truecolor
stop_grace_period: 30s
container_name: sedge-starknet-client-nf
restart: unless-stopped
image: ${L2_IMAGE_VERSION}
networks:
- sedge
volumes:
- ${L2_DATA_DIR}:/juno/data
ports:
- 6060:6060
- 6061:6061
expose:
- 6060
- 6061
command:
- --colour=true
- --db-path=/juno/data
- --eth-node=${ETH_NODE}
- --http=true
- --http-host=0.0.0.0
- --http-port=6060
- --ws=true
- --ws-host=0.0.0.0
- --ws-port=6061
- --metrics=false
- --metrics-host=0.0.0.0
- --metrics-port=9090
- --grpc=false
- --grpc-host=0.0.0.0
- --grpc-port=6064
- --network=${NETWORK}
- --db-cache-size=8
- --max-vms=48
- --max-vm-queue=96
- --rpc-max-block-scan=18446744073709551615
- --pending-poll-interval=10s
networks:
sedge:
name: sedge-network
Loading
Loading