Skip to content

Commit

Permalink
Milestone 2 (#45)
Browse files Browse the repository at this point in the history
* feat: local Aztec devnet & sandbox (#24)

* feat: being able to fetch block by height/hash (#25)

* feat: aztec sandbox reachable from outside minikube (#28)

* feat: storing l2 contract data (#17)

* devops: https implementation (#29)

* feat: initial ui block component (#35)

* feat: aztec-listener catch-up from genesis (#34)

* feat: add separate API-route for transactions #36  (#37)

* feat: adding transactions page and transaction details page (#42)

* feat: real data for block component (#41)

* hotfix: removed unused import for DB-controller

* bug: production frontend error fix (#43)

---------

Co-authored-by: Filip Harald <[email protected]>
  • Loading branch information
Mautjee and FilipHarald authored Sep 20, 2024
1 parent a7b0942 commit 2264597
Show file tree
Hide file tree
Showing 107 changed files with 5,493 additions and 7,154 deletions.
6 changes: 6 additions & 0 deletions .chicmoz-example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CHICMOZ_AZTEC_API_KEY=xxx
CHICMOZ_AZTEC_PRIVATE_KEY=xxx
CHICMOZ_AZTEC_ETH_ADDRESS=xxx
CHICMOZ_AZTEC_L1_DEV_COIN=xxx
CHICMOZ_AZTEC_DEV_COIN_PORTAL=xxx
CHICMOZ_AZTEC_L1_FEE_JUICE=xxx
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ build*
node_modules*
.DS_Store

# file used to set env vars to local cluster
set_local_env.sh

decodeKeys.js
*.env
!chicmoz-example.env

ignore/

Expand Down
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Chicmoz

## running locally

terminal 1:
Expand All @@ -9,37 +11,16 @@ minikube start --kubernetes-version=v1.25.3 --cpus max --memory max && skaffold
terminal 2:

```sh
minikube tunnel --bind-address 127.0.0.1
# It will end with keeping the terminal open for the tunnel. (Also it will ask for your password)
./scripts/miscallaneous.sh
```

terminal 3:
_Make sure you have .chicmoz-local.env file in the root_

```sh
cd services/explorer-ui && yarn dev
```

terminal 4 (you need to have [aztec-cli](https://docs.aztec.network/guides/developer_guides/getting_started/quickstart) installed):

```sh
aztec start --sandbox
```

UI: http://localhost:5173
API: https://explorer-api.localhost:443

## Deploying on AWS

TODO: is this needed?

### Configure Load Balancer

Follow these instructions to properly configure the load balancer:

- [configure proxy protocol support](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html)
- [configure correct ports](https://stackoverflow.com/a/56948614/8678661)

To check the port mappings run:

```sh
aws elb describe-load-balancers --load-balancer-name <my-load-balancer>
```
32 changes: 32 additions & 0 deletions k8s/local/anvil-ethereum-node/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: anvil-ethereum-node
name: anvil-ethereum-node
namespace: chicmoz
spec:
replicas: 1
selector:
matchLabels:
app: anvil-ethereum-node
strategy: {}
template:
metadata:
labels:
app: anvil-ethereum-node
spec:
containers:
- image: ghcr.io/foundry-rs/foundry@sha256:29ba6e34379e79c342ec02d437beb7929c9e254261e8032b17e187be71a2609f
name: anvil-ethereum-node
resources:
limits:
memory: 4096Mi
cpu: 250m
args:
- "anvil -p 8545 --host 0.0.0.0 --chain-id 31337"
ports:
- name: anvil-port
containerPort: 8545
protocol: TCP
status: {}
20 changes: 20 additions & 0 deletions k8s/local/anvil-ethereum-node/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-anvil-ethereum-node
namespace: chicmoz
spec:
ingressClassName: nginx
rules:
- host: anvil-ethereum-node.localhost
http:
paths:
- backend:
service:
name: anvil-ethereum-node
port:
name: anvil-port
path: /
pathType: Prefix
status:
loadBalancer: {}
13 changes: 13 additions & 0 deletions k8s/local/anvil-ethereum-node/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: anvil-ethereum-node
namespace: chicmoz
spec:
selector:
app: anvil-ethereum-node
ports:
- name: anvil-port
protocol: TCP
port: 8545
targetPort: 8545
93 changes: 93 additions & 0 deletions k8s/local/aztec-devnet-node/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: aztec-devnet-node
name: aztec-devnet-node
namespace: chicmoz
spec:
replicas: 1
selector:
matchLabels:
app: aztec-devnet-node
strategy: {}
template:
metadata:
labels:
app: aztec-devnet-node
spec:
containers:
- image: aztecprotocol/aztec:devnet
name: aztec-devnet-node
resources:
limits:
memory: 4096Mi
cpu: 250m
args:
- start
- --pxe
- --pxe.network
- devnet
- --pxe.apiKey=$(AZTEC_API_KEY)
env:
- name: AZTEC_API_KEY
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_API_KEY
- name: DEBUG
value: "aztec:*"
- name: ETHEREUM_HOST
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_ETHEREUM_HOST
- name: L1_CHAIN_ID
value: "677692"
- name: ARCHIVER_POLLING_INTERVAL_MS
value: "50"
- name: P2P_BLOCK_CHECK_INTERVAL_MS
value: "50"
- name: SEQ_TX_POLLING_INTERVAL_MS
value: "50"
- name: WS_BLOCK_CHECK_INTERVAL_MS
value: "50"
- name: PXE_BLOCK_POLLING_INTERVAL_MS
value: "50"
- name: ARCHIVER_VIEM_POLLING_INTERVAL_MS
value: "500"
- name: PXE_PORT
value: "8080"
- name: AZTEC_PORT
value: "8080"
- name: FAUCET_ENDPOINT
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_FAUCET_ENDPOINT
- name: PRIVATE_KEY
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_PRIVATE_KEY
- name: ETH_ADDRESS
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_ETH_ADDRESS
- name: L1_DEV_COIN
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_L1_DEV_COIN
- name: DEV_COIN_PORTAL
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_DEV_COIN_PORTAL
- name: L1_FEE_JUICE
valueFrom:
secretKeyRef:
name: global
key: CHICMOZ_AZTEC_L1_FEE_JUICE
status: {}
13 changes: 13 additions & 0 deletions k8s/local/aztec-devnet-node/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: aztec-devnet-node
namespace: chicmoz
spec:
selector:
app: aztec-devnet-node
ports:
- name: pxe-port
protocol: TCP
port: 8080
targetPort: 8080
27 changes: 15 additions & 12 deletions k8s/local/aztec-listener/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,14 @@ spec:
env:
- name: NODE_ENV
value: "development"
- name: BLOCK_INTERVAL_MS
value: "2000"
- name: BATCH_SIZE
value: "50"
- name: BLOCK_POLL_INTERVAL_MS
value: "5000"
- name: CHAIN_NAME
value: "AZTEC"
- name: DISABLE_AZTEC
value: "true"
- name: NETWORK_NAME
value: "SANDBOX"
- name: MAX_BATCH_SIZE_FETCH_MISSED_BLOCKS
value: "50"
- name: DISABLE_AZTEC
value: "false"
- name: LISTEN_FOR_BLOCKS
value: "true"
- name: CATCHUP_ENABLED
value: "false"
- name: POSTGRES_IP
value: "postgresql"
- name: POSTGRES_PORT
Expand All @@ -73,4 +63,17 @@ spec:
value: "secret-local-password"
- name: IGNORE_PROCESSED_HEIGHT
value: "false"
- name: AZTEC_DISABLED
value: "false"
- name: AZTEC_GENESIS_CATCHUP
value: "true"
- name: AZTEC_LISTEN_FOR_BLOCKS
value: "true"
- name: AZTEC_RPC_URL
#value: "http://aztec-devnet-node:8080" # LOCAL DEVNET
#value: "http://aztec-sandbox-node:8081" # SANDBOX
valueFrom: # REMOTE DEVNET
secretKeyRef: # REMOTE DEVNET
name: global # REMOTE DEVNET
key: CHICMOZ_AZTEC_RPC # REMOTE DEVNET
status: {}
13 changes: 0 additions & 13 deletions k8s/local/aztec-listener/service.yaml

This file was deleted.

56 changes: 56 additions & 0 deletions k8s/local/aztec-sandbox-node/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: aztec-sandbox-node
name: aztec-sandbox-node
namespace: chicmoz
spec:
replicas: 1
selector:
matchLabels:
app: aztec-sandbox-node
strategy: {}
template:
metadata:
labels:
app: aztec-sandbox-node
spec:
containers:
- image: aztecprotocol/aztec:0.53.0
name: aztec-sandbox-node
resources:
limits:
memory: 4096Mi
cpu: 250m
args:
- start
- --sandbox
ports:
- name: pxe-port
containerPort: 8081
protocol: TCP
env:
- name: DEBUG
value: "aztec:*"
- name: ETHEREUM_HOST
value: "http://anvil-ethereum-node:8545"
- name: L1_CHAIN_ID
value: "31337"
- name: ARCHIVER_POLLING_INTERVAL_MS
value: "50"
- name: P2P_BLOCK_CHECK_INTERVAL_MS
value: "50"
- name: SEQ_TX_POLLING_INTERVAL_MS
value: "50"
- name: WS_BLOCK_CHECK_INTERVAL_MS
value: "50"
- name: PXE_BLOCK_POLLING_INTERVAL_MS
value: "50"
- name: ARCHIVER_VIEM_POLLING_INTERVAL_MS
value: "500"
- name: PXE_PORT
value: "8081"
- name: AZTEC_PORT
value: "8081"
status: {}
22 changes: 22 additions & 0 deletions k8s/local/aztec-sandbox-node/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-aztec-sandbox-node
namespace: chicmoz
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "0"
spec:
ingressClassName: nginx
rules:
- host: aztec-sandbox-node.localhost
http:
paths:
- backend:
service:
name: aztec-sandbox-node
port:
name: pxe-port
path: /
pathType: Prefix
status:
loadBalancer: {}
13 changes: 13 additions & 0 deletions k8s/local/aztec-sandbox-node/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: aztec-sandbox-node
namespace: chicmoz
spec:
selector:
app: aztec-sandbox-node
ports:
- name: pxe-port
protocol: TCP
port: 8081
targetPort: 8081
Loading

0 comments on commit 2264597

Please sign in to comment.