Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit 60f5fb0

Browse files
authored
Adds Sequencer OpenAPI spec (#38)
- Updates documentation for sequencer API. - Updates README to reflect new environment variables
1 parent b6612cb commit 60f5fb0

File tree

2 files changed

+168
-4
lines changed

2 files changed

+168
-4
lines changed

README.md

+25-4
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,40 @@ This crate contains an example block builder in the Signet ecosystem.
2121

2222
### Environment
2323

24-
The following environment variables are required to run the Builder locally for development:
24+
The following environment variables are exposed to configure the Builder:
2525

2626
```bash
27+
# Builder Configs
2728
HOST_CHAIN_ID="17000" # Holesky Testnet
2829
RU_CHAIN_ID="17001"
29-
HOST_RPC_URL="http://your.url.here"
30+
HOST_RPC_URL="http://host.url.here"
3031
ZENITH_ADDRESS="ZENITH_ADDRESS_HERE"
31-
QUINCEY_URL="http://your.url.here"
32+
QUINCEY_URL="http://signer.url.here"
3233
BUILDER_PORT="8080"
3334
BUILDER_KEY="YOUR_BUILDER_KEY_HERE"
3435
INCOMING_TRANSACTIONS_BUFFER="10"
3536
BLOCK_CONFIRMATION_BUFFER="10"
3637
BUILDER_REWARDS_ADDRESS="BUILDER_REWARDS_ADDRESS_HERE"
3738
ROLLUP_BLOCK_GAS_LIMIT="30000000"
38-
TX_POOL_URL="http://your.url.here"
39+
# Transaction Pool Configs
40+
TX_POOL_URL="http://pool.url.here/" # trailing slash is required
41+
TX_POOL_POLL_INTERVAL="5" # seconds
42+
TX_POOL_CACHE_DURATION="600" # seconds
43+
```
44+
45+
## API
46+
47+
### SignRequest
48+
49+
Sign request example payload:
50+
51+
```json
52+
{
53+
"hostBlockNumber": "0x0",
54+
"hostChainId": "0x1",
55+
"ruChainId": "0x2",
56+
"gasLimit": "0x5",
57+
"ruRewardAddress": "0x0606060606060606060606060606060606060606",
58+
"contents": "0x0707070707070707070707070707070707070707070707070707070707070707"
59+
}
3960
```

crates/builder/sequencer.openapi.yml

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
openapi: 3.0.3
2+
info:
3+
title: Signet Sequencer API
4+
version: 1.0.0
5+
description: API to obtain a signature for a new Signet block.
6+
servers:
7+
- url: https://sequencer.api.init4.network
8+
paths:
9+
/signBlock:
10+
post:
11+
summary: Obtain a signature for a new Signet block
12+
description: Obtain a signature for a new Signet block.
13+
requestBody:
14+
required: true
15+
content:
16+
application/json:
17+
schema:
18+
type: object
19+
properties:
20+
host_block_number:
21+
type: string
22+
description: The block number of the host formatted as a 0x-prefixed minimal hex string.
23+
host_chain_id:
24+
type: string
25+
description: The chain ID of the host formatted as a 0x-prefixed minimal hex string.
26+
ru_chain_id:
27+
type: string
28+
description: The chain ID of the rollup formatted as a 0x-prefixed minimal hex string.
29+
gas_limit:
30+
type: string
31+
description: The gas limit of the rollup block formatted as a 0x-prefixed minimal hex string.
32+
ru_reward_address:
33+
type: string
34+
description: The reward address on the rollup for the builder formatted as a 0x-prefixed minimal hex string.
35+
contents:
36+
type: string
37+
description: keccak256 hash of rlp-encoded transactions in the block formatted as a 0x-prefixed minimal hex string.
38+
required:
39+
- host_block_number
40+
- host_chain_id
41+
- ru_chain_id
42+
- gas_limit
43+
- ru_reward_address
44+
- contents
45+
responses:
46+
'200':
47+
description: A JSON SignResponse
48+
content:
49+
application/json:
50+
schema:
51+
type: object
52+
properties:
53+
req:
54+
type: object
55+
description: The inputted SignRequest.
56+
properties:
57+
host_block_number:
58+
type: string
59+
description: The block number of the host formatted as a 0x-prefixed minimal hex string.
60+
host_chain_id:
61+
type: string
62+
description: The chain ID of the host formatted as a 0x-prefixed minimal hex string.
63+
ru_chain_id:
64+
type: string
65+
description: The chain ID of the rollup formatted as a 0x-prefixed minimal hex string.
66+
gas_limit:
67+
type: string
68+
description: The gas limit of the rollup block formatted as a 0x-prefixed minimal hex string.
69+
ru_reward_address:
70+
type: string
71+
description: The reward address on the rollup for the builder formatted as a 0x-prefixed minimal hex string.
72+
contents:
73+
type: string
74+
description: keccak256 hash of rlp-encoded transactions in the block formatted as a 0x-prefixed minimal hex string.
75+
sig:
76+
type: object
77+
description: The signature over the SignRequest.
78+
properties:
79+
yParity:
80+
type: boolean
81+
description: The parity of the y value of the signature.
82+
r:
83+
type: string
84+
description: Signature R field.
85+
s:
86+
type: string
87+
description: Signature S field.
88+
components:
89+
schemas:
90+
SignRequest:
91+
type: object
92+
properties:
93+
host_block_number:
94+
type: string
95+
description: The block number of the host.
96+
host_chain_id:
97+
type: string
98+
description: The chain ID of the host.
99+
ru_chain_id:
100+
type: string
101+
description: The chain ID of the rollup.
102+
gas_limit:
103+
type: string
104+
description: The gas limit of the rollup block.
105+
ru_reward_address:
106+
type: string
107+
description: The reward address on the rollup for the builder.
108+
contents:
109+
type: string
110+
description: keccak256 hash of rlp-encoded transactions in the block.
111+
required:
112+
- host_block_number
113+
- host_chain_id
114+
- ru_chain_id
115+
- gas_limit
116+
- ru_reward_address
117+
- contents
118+
Signature:
119+
type: object
120+
properties:
121+
yParity:
122+
type: boolean
123+
description: The parity of the y value of the signature.
124+
r:
125+
type: string
126+
description: Signature R field.
127+
s:
128+
type: string
129+
description: Signature S field.
130+
required:
131+
- yParity
132+
- r
133+
- s
134+
SignResponse:
135+
type: object
136+
properties:
137+
req:
138+
$ref: '#/components/schemas/SignRequest'
139+
sig:
140+
$ref: '#/components/schemas/Signature'
141+
required:
142+
- req
143+
- sig

0 commit comments

Comments
 (0)