-
Notifications
You must be signed in to change notification settings - Fork 917
Node provider docs for flashblocks #2263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
408c13a
afb039d
8bfa71a
2d45720
e6abc1e
16b1603
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Flashblocks | ||
slug: /flashblocks | ||
slug: /flashblocks/apps | ||
description: Experience lightning-fast transaction confirmations on Base by using Flashblocks. Preconfirmations happen in just 200 milliseconds—designed for real-time apps, games, and seamless UX. | ||
--- | ||
|
||
|
@@ -14,9 +14,87 @@ Flashblocks enable up to 200 millisecond transaction confirmations on Base by le | |
|
||
Flashblocks is enabled for developers on Base Sepolia with full support for mainnet coming very soon. There are two ways you can integrate with Flashblocks data. You can either use the WebSocket API to stream real-time block updates, or use the RPC API to query the Flashblocks-aware RPC endpoint. | ||
|
||
### RPC API | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think app devs use RPC more so I moved it to the top |
||
|
||
You can utilize our Flashblock aware RPC endpoint at `https://sepolia-preconf.base.org`. | ||
|
||
In addition to these flashblock-specific methods, all standard Ethereum JSON-RPC methods are supported as usual. | ||
|
||
#### eth_getBlockByNumber | ||
|
||
Use the `pending` tag to retrieve the latest Flashblock: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["pending",true],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"number": "0x1234", | ||
"hash": "0x...", | ||
"transactions": [...] | ||
} | ||
} | ||
``` | ||
|
||
#### eth_getTransactionReceipt | ||
|
||
Use the existing receipt RPC to get preconfirmed receipts: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x..."],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"transactionHash": "0x...", | ||
"blockNumber": "0x1234", | ||
"status": "0x1" | ||
} | ||
} | ||
``` | ||
|
||
#### eth_getBalance | ||
|
||
Use the `pending` tag to get the address balance in the latest Flashblock: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x...","pending"],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": "0x0234" | ||
} | ||
``` | ||
|
||
#### eth_getTransactionCount | ||
|
||
Use the `pending` tag to get the address nonce in the latest Flashblock: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x...","pending"],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": "0x1b" // 27 transactions | ||
} | ||
``` | ||
|
||
### WebSocket API | ||
|
||
Use our API to stream realtime block updates over a WebSocket. | ||
You can also use our WebSocket API to stream realtime flashblocks updates. | ||
|
||
You can connect to the websocket endpoint with any WebSocket library of CLI tool. The endpoint is available at wss://sepolia.flashblocks.base.org/ws. | ||
|
||
|
@@ -114,83 +192,7 @@ To minimize the amount of data sent to clients, each Flashblock only includes th | |
} | ||
``` | ||
|
||
### RPC API | ||
|
||
You can also utilize our Flashblock aware RPC endpoint at `https://sepolia-preconf.base.org`. | ||
|
||
In addition to these flashblock-specific methods, all standard Ethereum JSON-RPC methods are supported as usual. | ||
|
||
#### eth_getBlockByNumber | ||
|
||
Use the `pending` tag to retrieve the latest Flashblock: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["pending",true],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"number": "0x1234", | ||
"hash": "0x...", | ||
"transactions": [...] | ||
} | ||
} | ||
``` | ||
|
||
#### eth_getTransactionReceipt | ||
|
||
Use the existing receipt RPC to get preconfirmed receipts: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x..."],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"transactionHash": "0x...", | ||
"blockNumber": "0x1234", | ||
"status": "0x1" | ||
} | ||
} | ||
``` | ||
|
||
#### eth_getBalance | ||
|
||
Use the `pending` tag to get the address balance in the latest Flashblock: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x...","pending"],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": "0x0234" | ||
} | ||
``` | ||
|
||
#### eth_getTransactionCount | ||
|
||
Use the `pending` tag to get the address nonce in the latest Flashblock: | ||
``` | ||
curl https://sepolia-preconf.base.org -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x...","pending"],"id":1}' | ||
``` | ||
|
||
**Example Response** | ||
``` | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": "0x1b" // 27 transactions | ||
} | ||
``` | ||
|
||
## Support | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: Flashblocks | ||
slug: /flashblocks/node-providers | ||
description: Experience lightning-fast transaction confirmations on Base by using Flashblocks. Preconfirmations happen in just 200 milliseconds—designed for real-time apps, games, and seamless UX. | ||
--- | ||
|
||
# How to host Flashblocks-aware RPC nodes | ||
|
||
## Quick Start | ||
|
||
1. **Prerequisites**: | ||
|
||
- Docker and Docker Compose | ||
- Minimum hardware requirements (see [node README](https://github.com/base/node?tab=readme-ov-file#hardware-requirements)) | ||
- Access to a Flashblocks websocket endpoint, we provide public endpoints in the env files in the repo | ||
|
||
2. **Set Up Environment**: | ||
|
||
```bash | ||
# Clone the repository | ||
git clone https://github.com/base/node.git | ||
cd node | ||
``` | ||
|
||
3. **Start the Node with Flashblocks Support**: | ||
```bash | ||
NODE_TYPE=base CLIENT=reth docker-compose up | ||
``` | ||
|
||
## Configuration Options | ||
|
||
- **Node Type**: Use `NODE_TYPE=base` to enable base reth node withFlashblocks functionality | ||
- **Network**: Use `NETWORK_ENV=.env.mainnet` for mainnet or `NETWORK_ENV=.env.sepolia` for testnet | ||
|
||
## Verifying Flashblocks Functionality | ||
|
||
Test that your node is properly supporting Flashblocks by querying a pending block: | ||
|
||
```bash | ||
curl -X POST \ | ||
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["pending", false],"id":1}' \ | ||
http://localhost:8545 | ||
``` | ||
|
||
## Available RPC Methods | ||
|
||
Flashblocks-aware nodes provide all standard Ethereum JSON-RPC methods plus specialized Flashblocks endpoints. For more details, see the [Flashblocks RPC API documentation](https://docs.base.org/chain/flashblocks/apps#rpc-api). | ||
|
||
## Further Resources | ||
|
||
For detailed information about node setup, including hardware requirements and additional configuration options, refer to the [Reth node README](https://github.com/base/op-geth/blob/main/node/reth/README.md). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1058,7 +1058,11 @@ export const sidebar: Sidebar = [ | |
}, | ||
{ | ||
text: 'Flashblocks ↗', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can drop the arrow since it isn't going offsite (so just Sorry, this was an artifact from when I added the page, but we should remove it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
link: '/chain/flashblocks', | ||
collapsed: true, | ||
items: [ | ||
{ text: 'Apps', link: '/chain/flashblocks/apps' }, | ||
{ text: 'Node Providers', link: '/chain/flashblocks/node-providers' }, | ||
], | ||
}, | ||
{ | ||
text: 'Base Contracts', | ||
|
Uh oh!
There was an error while loading. Please reload this page.