Skip to content

Commit e319343

Browse files
authored
Merge branch 'master' into braga/consensus-exec-diff-proc
2 parents 3b1d3b7 + 5ecd80a commit e319343

12 files changed

Lines changed: 126 additions & 13 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ user_fee_token_deployer: 0x2AC5278D230f88B481bBE4A94751d7188ef48Ca2
129129

130130
While not a named account, 0x3f1eae7d46d88f08fc2f8ed27fcb2ab183eb2d0e is funded on all test chains.
131131

132+
## Metrics
133+
134+
To run the metrics stack (Prometheus + Grafana) read the instructions in the [metrics/README.md](metrics/README.md) file.
135+
132136
## Contact
133137

134138
Discord - [Arbitrum](https://discord.com/invite/5KE54JwyTs)

metrics/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Arbitrum Nitro Metrics
2+
3+
You can run this docker compose file it will run
4+
5+
- prometheus
6+
- grafana
7+
- setup the default dashboard
8+
9+
The default username/password is `admin`/`admin`.
10+
11+
## Run the metrics services
12+
13+
Simply start docker compose in this `metrics/` folder:
14+
15+
```sh
16+
docker compose up
17+
```
18+
19+
## Enable metrics on Nitro node
20+
21+
Don't forget to run the Nitro node with metrics exporting on, to do so add the following flags to your Nitro node startup command:
22+
23+
```sh
24+
--metrics --metrics-server.addr=0.0.0.0
25+
```
26+
27+
> ⚠️ Warning: Using 0.0.0.0 is recommended for cross-platform compatibility,
28+
especially when accessing metrics from Docker, Linux, WSL, or remote containers.
29+
30+
## View the Dashboard
31+
32+
View the dashboard at http://localhost:3000
33+
34+
## How to add more grafana dashboards
35+
36+
To add more grafana dashboards you can drop json files into the `grafana/dashboards/` folder.

metrics/compose.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
services:
2+
prometheus:
3+
image: prom/prometheus
4+
container_name: prometheus
5+
command:
6+
- '--config.file=/etc/prometheus/prometheus.yaml'
7+
restart: unless-stopped
8+
volumes:
9+
- ./prometheus:/etc/prometheus
10+
- prometheus_data:/prometheus
11+
ports:
12+
- 9090:9090
13+
extra_hosts:
14+
- "host.docker.internal:host-gateway"
15+
grafana:
16+
image: grafana/grafana
17+
container_name: grafana
18+
restart: unless-stopped
19+
volumes:
20+
- ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
21+
- ./grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml
22+
- ./grafana/dashboards:/var/lib/grafana/dashboards
23+
ports:
24+
- 3000:3000
25+
extra_hosts:
26+
- "host.docker.internal:host-gateway"
27+
28+
volumes:
29+
prometheus_data:
30+
31+
networks: {}

metrics/grafana/dashboard.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: 1
2+
3+
providers:
4+
- name: "Offchain Labs"
5+
orgId: 1
6+
type: file
7+
disableDeletion: false
8+
updateIntervalSeconds: 10
9+
allowUiUpdates: false
10+
options:
11+
path: /var/lib/grafana/dashboards
12+
foldersFromFilesStructure: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"annotations":{"list":[{"builtIn":1,"datasource":{"type":"grafana","uid":"-- Grafana --"},"enable":true,"hide":true,"iconColor":"rgba(0, 211, 255, 1)","name":"Annotations & Alerts","type":"dashboard"}]},"editable":true,"fiscalYearStartMonth":0,"graphTooltip":0,"id":0,"links":[],"panels":[{"datasource":{"type":"prometheus","uid":"PBFA97CFB590B2093"},"fieldConfig":{"defaults":{"color":{"mode":"palette-classic"},"custom":{"axisBorderShow":false,"axisCenteredZero":false,"axisColorMode":"text","axisLabel":"","axisPlacement":"auto","barAlignment":0,"barWidthFactor":0.6,"drawStyle":"line","fillOpacity":0,"gradientMode":"none","hideFrom":{"legend":false,"tooltip":false,"viz":false},"insertNulls":false,"lineInterpolation":"linear","lineWidth":1,"pointSize":5,"scaleDistribution":{"type":"linear"},"showPoints":"auto","showValues":false,"spanNulls":false,"stacking":{"group":"A","mode":"none"},"thresholdsStyle":{"mode":"off"}},"mappings":[],"thresholds":{"mode":"absolute","steps":[{"color":"green","value":0},{"color":"red","value":80}]}},"overrides":[]},"gridPos":{"h":8,"w":12,"x":0,"y":0},"id":1,"options":{"legend":{"calcs":[],"displayMode":"list","placement":"bottom","showLegend":true},"tooltip":{"hideZeros":false,"mode":"single","sort":"none"}},"pluginVersion":"12.2.0","targets":[{"datasource":{"type":"prometheus","uid":"PBFA97CFB590B2093"},"editorMode":"builder","expr":"arb_block_transactions_count","legendFormat":"__auto","range":true,"refId":"A"}],"title":"Arb Block Transactions Count","type":"timeseries"}],"preload":false,"refresh":"5s","schemaVersion":42,"tags":[],"templating":{"list":[]},"time":{"from":"now-30m","to":"now"},"timepicker":{},"timezone":"browser","title":"Example dashboard","uid":"adq7lsl","version":2}

metrics/grafana/datasource.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: 1
2+
3+
datasources:
4+
- name: Prometheus
5+
type: prometheus
6+
url: http://host.docker.internal:9090
7+
isDefault: true
8+
access: proxy
9+
editable: true

metrics/prometheus/prometheus.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
global:
2+
scrape_interval: 4s
3+
scrape_timeout: 4s
4+
evaluation_interval: 10s
5+
6+
scrape_configs:
7+
- job_name: "nitro"
8+
metrics_path: /debug/metrics/prometheus
9+
static_configs:
10+
- targets:
11+
- host.docker.internal:6070
12+
labels:
13+
instance: local_node

rollupcreator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-bookworm-slim
1+
FROM node:20-trixie-slim
22
RUN apt-get update && \
33
apt-get install -y git docker.io python3 make gcc g++ curl jq
44
ARG NITRO_CONTRACTS_BRANCH=main

scripts/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Base build environment
2-
FROM node:20-bookworm-slim AS base
2+
FROM node:20-trixie-slim AS base
33
WORKDIR /workspace
44
COPY ./package.json ./yarn.lock ./
55
RUN yarn

scripts/config.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,17 @@ function getChainInfo(): ChainInfo {
199199
return chainInfo;
200200
}
201201

202+
function createDataAvailabilityConfig(argv: any, anytrust: boolean) {
203+
return {
204+
"enable": anytrust,
205+
"rpc-aggregator": dasBackendsJsonConfig(argv),
206+
"rest-aggregator": {
207+
"enable": true,
208+
"urls": ["http://das-mirror:9877"],
209+
},
210+
}
211+
}
212+
202213
function applyTxFilteringConfig(config: any) {
203214
config.execution.sequencer["transaction-filtering"] = {
204215
"address-filter": {
@@ -257,7 +268,9 @@ function writeConfigs(argv: any) {
257268
"node": {
258269
"bold": {
259270
"rpc-block-number": "latest",
260-
"assertion-posting-interval": "10s"
271+
"assertion-posting-interval": "10s",
272+
"assertion-confirming-interval": "10s",
273+
"parent-chain-block-time": 1,
261274
},
262275
"staker": {
263276
"dangerous": {
@@ -315,14 +328,7 @@ function writeConfigs(argv: any) {
315328
"jwtsecret": valJwtSecret,
316329
}
317330
},
318-
"data-availability": {
319-
"enable": argv.anytrust,
320-
"rpc-aggregator": dasBackendsJsonConfig(argv),
321-
"rest-aggregator": {
322-
"enable": true,
323-
"urls": ["http://das-mirror:9877"],
324-
},
325-
}
331+
"data-availability": createDataAvailabilityConfig(argv, argv.anytrust)
326332
},
327333
"execution": {
328334
"sequencer": {
@@ -427,6 +433,7 @@ function writeConfigs(argv: any) {
427433
// use the same account for l2 and l3 staker
428434
// l3Config.node.staker["parent-chain-wallet"].account = namedAddress("l3owner")
429435
l3Config.node["batch-poster"]["parent-chain-wallet"].account = namedAddress("l3sequencer")
436+
l3Config.node["data-availability"] = createDataAvailabilityConfig(argv, false)
430437
l3Config.chain.id = 333333
431438
const l3ChainInfoFile = path.join(consts.configpath, "l3_chain_info.json")
432439
l3Config.chain["info-files"] = [l3ChainInfoFile]

0 commit comments

Comments
 (0)