Skip to content

Commit 2f61a06

Browse files
Merge pull request 0xPolygon#65 from 0xPolygon/empieichO-docs-review
update and adding gas station doc
2 parents 9343bac + aba912b commit 2f61a06

File tree

3 files changed

+89
-1
lines changed

3 files changed

+89
-1
lines changed

docs/miden/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Polygon Miden is an in-development zero-knowledge (ZK) rollup running the Miden
66
<div class="flex-figure-right">
77
<img src="../img/miden/miden.svg" class="figure figure-right" alt="" />
88
</div>
9-
</div>
9+
</div>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
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.
2+
3+
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.
4+
5+
## Usage
6+
7+
<Tabs
8+
defaultValue="mainnet"
9+
values={[
10+
{ label: 'zkEVM Mainnet Beta', value: 'mainnet', },
11+
{ label: 'zKEVM Testnet', value: 'testnet', },
12+
]
13+
}>
14+
15+
<TabItem value="testnet">
16+
17+
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.
18+
19+
#### cURL
20+
21+
```bash
22+
curl https://gasstation-testnet.polygon.technology/zkevm
23+
```
24+
25+
#### JavaScript
26+
27+
```javascript
28+
fetch('https://gasstation-testnet.polygon.technology/zkevm')
29+
.then(response => response.json())
30+
.then(json => console.log(json))
31+
```
32+
33+
#### Python
34+
35+
```python
36+
import requests
37+
requests.get('https://gasstation-testnet.polygon.technology/zkevm').json()
38+
```
39+
40+
</TabItem>
41+
42+
<TabItem value="mainnet">
43+
44+
Send a GET request to the [zkEVM Gas Station endpoint](https://gasstation.polygon.technology/zkevm) to get a gas price recommendation from this oracle.
45+
46+
#### cURL
47+
48+
```bash
49+
curl https://gasstation.polygon.technology/zkevm
50+
```
51+
52+
#### JavaScript
53+
54+
```javascript
55+
fetch('https://gasstation.polygon.technology/zkevm')
56+
.then(response => response.json())
57+
.then(json => console.log(json))
58+
```
59+
60+
#### Python
61+
62+
```python
63+
import requests
64+
requests.get('https://gasstation.polygon.technology/zkevm').json()
65+
```
66+
67+
</TabItem>
68+
</Tabs>
69+
70+
## Interpretation
71+
72+
An example JSON response will look like this.
73+
74+
```json
75+
{
76+
"safeLow":1,
77+
"standard":1,
78+
"fast":1,
79+
"fastest":1,
80+
"blockTime":2,
81+
"blockNumber":308789
82+
}
83+
```
84+
85+
- {`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.
86+
- `blockTime`, in seconds, gives the average block time of the network.
87+
- `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)