Skip to content

Commit 46e89f7

Browse files
committed
feat(e2e): add chain initialization and deployment scripts
Add the core chain deployment pipeline for Kind-based e2e tests: - init-chain.sh: Multi-validator genesis initialization (keys, gentx, SP genesis, config patches) - deploy.sh: Full K8s deployment orchestrator (init job, config extraction, StatefulSet creation) - genesis-init-job.yaml: K8s Job manifest for running chain init in-cluster - validator-services.yaml: Headless + NodePort services for validator networking
1 parent 1c9879c commit 46e89f7

4 files changed

Lines changed: 888 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: genesis-init
5+
namespace: moca-e2e
6+
spec:
7+
backoffLimit: 1
8+
# Job won't auto-complete because the container sleeps.
9+
# deploy.sh deletes the job after extracting configs.
10+
template:
11+
spec:
12+
restartPolicy: Never
13+
containers:
14+
- name: init
15+
image: mocachain/moca:e2e-local
16+
imagePullPolicy: Never
17+
command: ["/bin/bash", "-c"]
18+
args:
19+
- |
20+
/scripts/init-chain.sh && echo "Init done, waiting for config extraction..." && sleep 3600
21+
env:
22+
- name: NUM_VALIDATORS
23+
value: "4"
24+
- name: NUM_STORAGE_PROVIDERS
25+
value: "1"
26+
- name: DATA_DIR
27+
value: "/data"
28+
- name: CHAIN_ID
29+
value: "moca_5151-1"
30+
volumeMounts:
31+
- name: scripts
32+
mountPath: /scripts
33+
- name: data
34+
mountPath: /data
35+
volumes:
36+
- name: scripts
37+
configMap:
38+
name: init-chain-script
39+
defaultMode: 0755
40+
- name: data
41+
emptyDir: {}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: validator-headless
5+
namespace: moca-e2e
6+
spec:
7+
clusterIP: None
8+
publishNotReadyAddresses: true
9+
selector:
10+
app: validator
11+
ports:
12+
- name: rpc
13+
port: 26657
14+
- name: p2p
15+
port: 26656
16+
- name: grpc
17+
port: 9090
18+
- name: api
19+
port: 1317
20+
- name: evm-rpc
21+
port: 8545
22+
- name: evm-ws
23+
port: 8546
24+
---
25+
apiVersion: v1
26+
kind: Service
27+
metadata:
28+
name: validator-nodeport
29+
namespace: moca-e2e
30+
spec:
31+
type: NodePort
32+
selector:
33+
statefulset.kubernetes.io/pod-name: validator-0-0
34+
ports:
35+
- name: rpc
36+
port: 26657
37+
targetPort: 26657
38+
nodePort: 26657
39+
- name: grpc
40+
port: 9090
41+
targetPort: 9090
42+
nodePort: 9090
43+
- name: api
44+
port: 1317
45+
targetPort: 1317
46+
nodePort: 1317
47+
- name: evm-rpc
48+
port: 8545
49+
targetPort: 8545
50+
nodePort: 8545
51+
- name: evm-ws
52+
port: 8546
53+
targetPort: 8546
54+
nodePort: 8546

0 commit comments

Comments
 (0)