Skip to content

Commit ff4e797

Browse files
committed
update and adding gas station doc
1 parent 9343bac commit ff4e797

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

docs/miden/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
Polygon Miden is an in-development zero-knowledge (ZK) rollup running the Miden VM, a virtual machine that prioritizes ZK-friendliness over EVM compatibility.
55
</div>
66
<div class="flex-figure-right">
7-
<img src="../img/miden/miden.svg" class="figure figure-right" alt="" />
7+
<img src="../../img/miden/miden.svg" class="figure figure-right" alt="" />
88
</div>
99
</div>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<!--
2+
import Tabs from '@theme/Tabs';
3+
import TabItem from '@theme/TabItem'; -->
4+
5+
The goal of Polygon zkEVM Gas Station is to provide dApp developers with gas pricing suggestions so they can use them before sending transactions to the Polygon zkEVM network. The prediction method is modeled after the [Polygon Gas Station](https://wiki.polygon.technology/docs/tools/faucets/polygon-gas-station) but is unique in its own way.
6+
7+
Polygon zkEVM Gas Station is currently deployed on the zkEVM Mainnet Beta and Blueberry Testnet, where it analyzes recent 1500 transactions and recommends gas prices.
8+
9+
## Usage
10+
11+
<Tabs
12+
defaultValue="mainnet"
13+
values={[
14+
{ label: 'zkEVM Mainnet Beta', value: 'mainnet', },
15+
{ label: 'zKEVM Testnet', value: 'testnet', },
16+
]
17+
}>
18+
19+
<TabItem value="testnet">
20+
21+
Send a GET request to the [zkEVM Gas Station endpoint](https://gasstation-testnet.polygon.technology/zkevm) to get a gas price recommendation from this oracle.
22+
23+
#### cURL
24+
25+
```bash
26+
curl https://gasstation-testnet.polygon.technology/zkevm
27+
```
28+
29+
#### JavaScript
30+
31+
```javascript
32+
fetch('https://gasstation-testnet.polygon.technology/zkevm')
33+
.then(response => response.json())
34+
.then(json => console.log(json))
35+
```
36+
37+
#### Python
38+
39+
```python
40+
import requests
41+
requests.get('https://gasstation-testnet.polygon.technology/zkevm').json()
42+
```
43+
44+
</TabItem>
45+
46+
<TabItem value="mainnet">
47+
48+
Send a GET request to the [zkEVM Gas Station endpoint](https://gasstation.polygon.technology/zkevm) to get a gas price recommendation from this oracle.
49+
50+
#### cURL
51+
52+
```bash
53+
curl https://gasstation.polygon.technology/zkevm
54+
```
55+
56+
#### JavaScript
57+
58+
```javascript
59+
fetch('https://gasstation.polygon.technology/zkevm')
60+
.then(response => response.json())
61+
.then(json => console.log(json))
62+
```
63+
64+
#### Python
65+
66+
```python
67+
import requests
68+
requests.get('https://gasstation.polygon.technology/zkevm').json()
69+
```
70+
71+
</TabItem>
72+
</Tabs>
73+
74+
## Interpretation
75+
76+
An example JSON response will look like this.
77+
78+
```json
79+
{
80+
"safeLow":1,
81+
"standard":1,
82+
"fast":1,
83+
"fastest":1,
84+
"blockTime":2,
85+
"blockNumber":308789
86+
}
87+
```
88+
89+
- {`safelow`, `standard`, `fast`, `fastest`} are gas prices in Gwei, you can use these prices before sending the transaction off to Polygon zkEVM, depending upon your needs
90+
- `blockTime`, in seconds, gives the average block time of the network
91+
- `blockNumber` provides the information of the latest block mined when the recommendation was made

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ nav:
8080
- Connecting to zkEVM: zkEVM/get-started/quick-start/connect-wallet.md
8181
- Using Polygon faucet: zkEVM/get-started/quick-start/zkevm-faucet.md
8282
- Bridging assets to zkEVM: zkEVM/get-started/quick-start/bridge-to-zkevm.md
83+
- Gas station: zkEVM/get-started/zkevm-gas-station.md
8384
- Setup nodes:
8485
- Setup local zkNode: zkEVM/get-started/setup-nodes/local-node.md
8586
- Setup production zkNode: zkEVM/get-started/setup-nodes/production-node.md

0 commit comments

Comments
 (0)