Skip to content

Commit 6e2d7ff

Browse files
authored
Merge pull request #263 from genlayerlabs/docs/node/v0.3.7
docs: Sync documentation from genlayer-node v0.3.7
2 parents 3bd9b9f + 73cd00a commit 6e2d7ff

12 files changed

Lines changed: 383 additions & 68 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## v0.3.7
2+
3+
### New features
4+
5+
- Add transaction count metrics for consensus roles
6+
- Implement consensus sync status metrics
7+
- Add node uptime collector
8+
- Add disk storage usage metrics for monitoring
9+
- Add comprehensive metrics collection for ops visibility

‎content/validators/config.yaml‎

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1+
# rollup configuration
12
rollup:
23
zksyncurl: "TODO: Set your GenLayer Chain ZKSync HTTP RPC URL here" # ZKSync RPC URL
34
zksyncwebsocketurl: "TODO: Set your GenLayer Chain ZKSync WebSocket RPC URL here" # ZKSync WebSocket URL
5+
# consensus contracts configuration
46
consensus:
7+
# Asimov - Phase 3
58
contractmanageraddress: "0x0761ff3847294eb3234f37Bf63fd7F1CA1E840bB" # ConsensusManager Smart Contract Address
69
contractmainaddress: "0xe30293d600fF9B2C865d91307826F28006A458f4" # ConsensusMain Smart Contract Address
710
contractdataaddress: "0x2a50afD9d3E0ACC824aC4850d7B4c5561aB5D27a" # ConsensusData Smart Contract Address
811
contractidlenessaddress: "0xD1D09c2743DD26d718367Ba249Ee1629BE88CF33" # Idleness Smart Contract Address
12+
contractstakingaddress: "0x143d20974FA35f72B8103f54D8A47F2991940d99" # Staking Smart Contract Address
913
genesis: 817855 # (Optional) Genesis block number for this consensus deployment. If not provided, it will be auto-detected by searching for the first log from the ConsensusMain contract.
10-
datadir: "./data/node" # Cache directory
14+
15+
# data directory
16+
datadir: "./data/node"
17+
18+
# logging configuration
1119
logging:
1220
level: "INFO"
1321
# json: `true` for json output to console, false for human readable log formatting
@@ -19,40 +27,29 @@ logging:
1927
level: "DEBUG"
2028
# folder: path to the folder where to store logs. Relative paths go under `datadir`.
2129
folder: logs
22-
# maxsize: maximum size in megabytes of the log file before it gets rotated. It defaults to 100 megabytes.
23-
maxsize: 500
30+
# maxsize: maximum size in megabytes of the log file before it gets rotated.
31+
maxsize: 10
2432
# maxage: maximum number of days to retain old log files based on the timestamp encoded in their filename.
2533
maxage: 7
2634
# maxbackups: maximum number of old log files to retain. Set to 0 for no limit
27-
maxbackups: 10
35+
maxbackups: 100
2836
# localtime: determines if the time used for formatting the timestamps in backup files is the computer's local time. Set to `false` to use UTC time.
2937
localtime: false
3038
# compress: determines if the rotated log files should be compressed using gzip
3139
compress: true
32-
node:
33-
mode: "validator" # "validator" or "archive"
34-
rpc:
35-
port: 9151 # JSON RPC port
36-
endpoints:
37-
groups:
38-
ethereum: true # Enable Ethereum RPC endpoints
39-
debug: false # Enable debug endpoints
40-
methods: # Enabled `eth_` methods
41-
eth_blockNumber: true
42-
eth_getBlockByNumber: true
43-
eth_getBlockByHash: true
44-
eth_sendRawTransaction: false
45-
ops:
46-
port: 9153 # Metrics port
47-
endpoints:
48-
metrics: true # Enable metrics endpoint
49-
health: true # Enable health endpoint
50-
dev: # Configuration for development purposes
51-
disableSubscription: false # Disable subscription
5240

41+
# node configuration
42+
node:
43+
# Uncomment if the ID of the node is different from the consensus validator address.
44+
# It is used to identify the node in the network.
45+
# id: "node"
46+
# Mode can be "validator" or "archive".
47+
# Default value is "validator".
48+
mode: "validator"
49+
# genvm configuration
5350
genvm:
5451
bin_dir: ./third_party/genvm/bin
55-
manage_modules: true
52+
manage_modules: true # if true node will start genvm modules itself
5653

5754
# Advanced configuration
5855
merkleforest:
@@ -61,4 +58,31 @@ merkleforest:
6158
indexdbpath: "./data/node/merkle/index.db"
6259
merkletree:
6360
maxdepth: 16
64-
dbpath: "./data/node/merkle/tree/"
61+
dbpath: "./data/node/merkle/tree/"
62+
63+
# Telemetry configuration
64+
# telemetry:
65+
# Uncomment to enable telemetry logs
66+
# logs:
67+
# endpoint: "https://logs-receiver-xxxxx.run.app"
68+
# timeout: "300s"
69+
# max_retries: 5
70+
# retry_delay: "1s"
71+
# max_file_size: "100MB"
72+
73+
# metrics configuration
74+
metrics:
75+
interval: "15s" # Default interval for all collectors (can be overridden per collector)
76+
# collectors:
77+
# node:
78+
# enabled: true
79+
# # interval: "30s" # Optional: Override default interval for this collector
80+
# genvm:
81+
# enabled: true
82+
# # interval: "20s" # Optional: Override default interval for this collector
83+
# # enable_simulated_traffic: false # Optional: Enable simulated network traffic metrics for GenVM processes (default: false)
84+
# # simulated_rx_bytes_per_process: 1024 # Optional: Simulated received bytes per process per interval (default: 1024)
85+
# # simulated_tx_bytes_per_process: 512 # Optional: Simulated transmitted bytes per process per interval (default: 512)
86+
# webdriver:
87+
# enabled: true
88+
# # interval: "60s" # Optional: Override default interval for this collector

‎pages/api-references/genlayer-node.mdx‎

Lines changed: 128 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ Executes a new message call immediately without creating a transaction on the bl
1717
- `to` (string, required): The contract address to call
1818
- `Data` (string, required): The encoded function call data
1919
- `Type` (string, required): The type of call (`"read"`, `"write"`, or `"deploy"`)
20-
- `transaction_hash_variant` (string, required): `"latest-nonfinal"`
20+
- `blockNumber` (string, optional): The block number to query at (hex-encoded). If not provided, uses latest block
21+
- `status` (string, optional): The transaction status filter (`"finalized"` or `"accepted"`). If not provided, uses accepted state
2122
- `value` (string, optional): The value to send with the call (hex-encoded)
22-
**Returns:** Hex-encoded result data
2323

24-
**Example - Read Call:**
24+
**Returns:** Hex-encoded result data
25+
26+
**Example - Read Call (Latest Accepted State):**
2527

2628
```json
2729
{
@@ -33,7 +35,6 @@ Executes a new message call immediately without creating a transaction on the bl
3335
"Data": "0xd8960e066d6574686f646c6765745f686176655f636f696e00",
3436
"from": "0xf6A60752C24Cd3BFcAf8d387a5EB62d3746F44EE",
3537
"to": "0xCe5712E63fd5475288aB1B7c0a368B9417357b81",
36-
"transaction_hash_variant": "latest-nonfinal",
3738
"gas": "0x5208",
3839
"value": "0x0"
3940
}
@@ -42,6 +43,26 @@ Executes a new message call immediately without creating a transaction on the bl
4243
}
4344
```
4445

46+
**Example - Read Call with Specific Block and Status:**
47+
48+
```json
49+
{
50+
"jsonrpc": "2.0",
51+
"method": "gen_call",
52+
"params": [
53+
{
54+
"Type": "read",
55+
"Data": "0xd8960e066d6574686f646c6765745f686176655f636f696e00",
56+
"from": "0xf6A60752C24Cd3BFcAf8d387a5EB62d3746F44EE",
57+
"to": "0xCe5712E63fd5475288aB1B7c0a368B9417357b81",
58+
"blockNumber": "0x151ec5",
59+
"status": "accepted"
60+
}
61+
],
62+
"id": 1
63+
}
64+
```
65+
4566
**Example - Write Call:**
4667

4768
```json
@@ -54,7 +75,6 @@ Executes a new message call immediately without creating a transaction on the bl
5475
"to": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8b6",
5576
"data": "0xa9059cbb000000000000000000000000742d35cc6634c0532925a3b8d4c9db96c4b4d8b6",
5677
"type": "write",
57-
"transaction_hash_variant": "latest-nonfinal",
5878
"gas": "0x5208",
5979
"value":"0x0"
6080
}
@@ -63,6 +83,14 @@ Executes a new message call immediately without creating a transaction on the bl
6383
}
6484
```
6585

86+
**Notes:**
87+
88+
- The `blockNumber` parameter can be either hex-encoded with a `0x` prefix (e.g., `"0x151ec5"`) or decimal (e.g., `"1384133"`)
89+
- Valid `status` values are `"accepted"` (default) and `"finalized"`
90+
- When both parameters are omitted, the call executes against the latest accepted state
91+
- For `read` and `write` type calls, if the contract doesn't exist at the specified block/status combination, an error will be returned
92+
- For `deploy` type calls, the `status` and `blockNumber` parameters are not used for contract state validation since no contract exists yet
93+
6694
### gen_getContractSchema
6795

6896
Retrieve the schema/interface of a GenLayer contract to understand its available methods and properties.
@@ -294,6 +322,101 @@ A `Transaction` object which contains the details of the transaction. The struct
294322
}
295323
```
296324

325+
### gen_getContractState
326+
327+
Retrieves the current state of a GenLayer intelligent contract at a specific block height and transaction status.
328+
329+
**Method:** `gen_getContractState`
330+
331+
**Parameters:**
332+
333+
- `request` (object, required): The contract state request parameters
334+
- `address` (string, required): The contract address to query
335+
- `blockNumber` (string, optional): The block number to query at (hex-encoded). If not provided, uses latest block
336+
- `status` (string, optional): The transaction status filter (`"finalized"` or `"accepted"`). If not provided, uses accepted state
337+
338+
**Returns:** Hex-encoded contract state data
339+
340+
**Example Request - Latest Accepted State:**
341+
342+
```json
343+
{
344+
"jsonrpc": "2.0",
345+
"method": "gen_getContractState",
346+
"params": [
347+
{
348+
"address": "0x73ca5a2b51edf506ceaf110a41780ec51294d89f"
349+
}
350+
],
351+
"id": 1
352+
}
353+
```
354+
355+
**Example Request - Specific Block and Status:**
356+
357+
```json
358+
{
359+
"jsonrpc": "2.0",
360+
"method": "gen_getContractState",
361+
"params": [
362+
{
363+
"address": "0x73ca5a2b51edf506ceaf110a41780ec51294d89f",
364+
"blockNumber": "0x151ec5",
365+
"status": "accepted"
366+
}
367+
],
368+
"id": 1
369+
}
370+
```
371+
372+
**Example Response:**
373+
374+
```json
375+
{
376+
"jsonrpc": "2.0",
377+
"result": "0xd9960e0773746f726167656c6e757064617465642074657374207374",
378+
"id": 1
379+
}
380+
```
381+
382+
**Notes:**
383+
384+
- The `blockNumber` parameter should be hex-encoded with a `0x` prefix
385+
- Valid `status` values are `"accepted"` (default) and `"finalized"`
386+
- The returned state is hex-encoded binary data with a `0x` prefix
387+
- Empty contract state returns `"0x"`
388+
- If the contract doesn't exist at the specified block/status, an error will be returned
389+
390+
**cURL Example:**
391+
392+
```bash
393+
# Get latest accepted state
394+
curl -X POST http://localhost:9151 \
395+
-H "Content-Type: application/json" \
396+
-d '{
397+
"jsonrpc": "2.0",
398+
"method": "gen_getContractState",
399+
"params": [{
400+
"address": "0x73ca5a2b51edf506ceaf110a41780ec51294d89f"
401+
}],
402+
"id": 1
403+
}'
404+
405+
# Get state at specific block with accepted status
406+
curl -X POST http://localhost:9151 \
407+
-H "Content-Type: application/json" \
408+
-d '{
409+
"jsonrpc": "2.0",
410+
"method": "gen_getContractState",
411+
"params": [{
412+
"address": "0x73ca5a2b51edf506ceaf110a41780ec51294d89f",
413+
"blockNumber": "0x151ec5",
414+
"status": "accepted"
415+
}],
416+
"id": 1
417+
}'
418+
```
419+
297420
## Debug Methods
298421

299422
These methods are available for debugging and testing purposes during development.

‎pages/api-references/genlayer-node/debug/gen_dbg_ping.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ Simple connectivity test method that returns a "pong" response.
2727
"result": "pong",
2828
"id": 1
2929
}
30-
```
30+
```

‎pages/api-references/genlayer-node/debug/gen_dbg_trie.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ Get trie information for debugging node internal DB state.
3535
"jsonrpc": "2.0",
3636
"result": "graph TD\nnode0@{label: \"br seq=1\"}\nnode1@{label: \"ext seq=1 0x00000000000000000000000000000000000000000000000000000000000000000000000\"}\nnode1 --\u003e data2@{label: \"seq=1\n[21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]\"}\nnode0 --\u003e|0| node1\nnode3@{label: \"ext seq=1 0x72d46c3ada9f897c74d349bbfe0e450c798167c9f580f8daf85def57e96c3ea00000000\"}\nnode3 --\u003e data4@{label: \"seq=1\n[105 110 105 116 105 97 108 32 115 116 111 114 97 103 101 32 118 97 108 117 101 0 0 0 0 0 0 0 0 0 0 0]\"}\nnode0 --\u003e|3| node3\n",
3737
"id": 1
38-
}
38+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"gen_call": "gen_call",
33
"gen_getContractSchema": "gen_getContractSchema",
4-
"gen_getTransactionReceipt": "gen_getTransactionReceipt"
4+
"gen_getTransactionReceipt": "gen_getTransactionReceipt",
5+
"gen_getContractState": "gen_getContractState"
56
}

‎pages/api-references/genlayer-node/gen/gen_call.mdx‎

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ Executes a new message call immediately without creating a transaction on the bl
1111
- `to` (string, required): The contract address to call
1212
- `Data` (string, required): The encoded function call data
1313
- `Type` (string, required): The type of call (`"read"`, `"write"`, or `"deploy"`)
14-
- `transaction_hash_variant` (string, required): `"latest-nonfinal"`
14+
- `blockNumber` (string, optional): The block number to query at (hex-encoded). If not provided, uses latest block
15+
- `status` (string, optional): The transaction status filter (`"finalized"` or `"accepted"`). If not provided, uses accepted state
1516
- `value` (string, optional): The value to send with the call (hex-encoded)
16-
**Returns:** Hex-encoded result data
1717

18-
**Example - Read Call:**
18+
**Returns:** Hex-encoded result data
19+
20+
**Example - Read Call (Latest Accepted State):**
1921

2022
```json
2123
{
@@ -27,7 +29,6 @@ Executes a new message call immediately without creating a transaction on the bl
2729
"Data": "0xd8960e066d6574686f646c6765745f686176655f636f696e00",
2830
"from": "0xf6A60752C24Cd3BFcAf8d387a5EB62d3746F44EE",
2931
"to": "0xCe5712E63fd5475288aB1B7c0a368B9417357b81",
30-
"transaction_hash_variant": "latest-nonfinal",
3132
"gas": "0x5208",
3233
"value": "0x0"
3334
}
@@ -36,6 +37,26 @@ Executes a new message call immediately without creating a transaction on the bl
3637
}
3738
```
3839

40+
**Example - Read Call with Specific Block and Status:**
41+
42+
```json
43+
{
44+
"jsonrpc": "2.0",
45+
"method": "gen_call",
46+
"params": [
47+
{
48+
"Type": "read",
49+
"Data": "0xd8960e066d6574686f646c6765745f686176655f636f696e00",
50+
"from": "0xf6A60752C24Cd3BFcAf8d387a5EB62d3746F44EE",
51+
"to": "0xCe5712E63fd5475288aB1B7c0a368B9417357b81",
52+
"blockNumber": "0x151ec5",
53+
"status": "accepted"
54+
}
55+
],
56+
"id": 1
57+
}
58+
```
59+
3960
**Example - Write Call:**
4061

4162
```json
@@ -48,11 +69,18 @@ Executes a new message call immediately without creating a transaction on the bl
4869
"to": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8b6",
4970
"data": "0xa9059cbb000000000000000000000000742d35cc6634c0532925a3b8d4c9db96c4b4d8b6",
5071
"type": "write",
51-
"transaction_hash_variant": "latest-nonfinal",
5272
"gas": "0x5208",
5373
"value":"0x0"
5474
}
5575
],
5676
"id": 1
5777
}
58-
```
78+
```
79+
80+
**Notes:**
81+
82+
- The `blockNumber` parameter can be either hex-encoded with a `0x` prefix (e.g., `"0x151ec5"`) or decimal (e.g., `"1384133"`)
83+
- Valid `status` values are `"accepted"` (default) and `"finalized"`
84+
- When both parameters are omitted, the call executes against the latest accepted state
85+
- For `read` and `write` type calls, if the contract doesn't exist at the specified block/status combination, an error will be returned
86+
- For `deploy` type calls, the `status` and `blockNumber` parameters are not used for contract state validation since no contract exists yet

0 commit comments

Comments
 (0)