Skip to content

Commit

Permalink
Adding HTTP_GET support
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoreliovlabs committed Oct 27, 2024
1 parent ad55c72 commit a5de961
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/03-node-operators/04-setup/03-configuration/03-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,12 @@ for detailed information about the `miner` configuration.

The `stableGasPrice` feature allows miners to set a predictable gas price for transactions, establishing a minimum rate that is less affected by market volatility and better aligned with fiat currency values like USD or EUR. This enhances cost management and improves overall transaction efficiency.

**Example**
The source configuration supports two methods: ETH_CALL and HTTP_GET.

- **ETH_CALL**: This method retrieves the gas price directly from a specified smart contract, allowing for real-time adjustments based on the contract's logic.
- **HTTP_GET**: This method fetches gas price data from an external API, providing flexibility to pull market data from trusted sources.

**Example of ETH_CALL**
```plaintext
stableGasPrice {
enabled = true
Expand All @@ -375,6 +380,25 @@ stableGasPrice {
- **Minimum Gas Price**: Ensures the miner uses a baseline price to avoid setting it too low
- **Refresh Rate**: Updates the gas price

**Example of HTTP_GET**
```plaintext
stableGasPrice {
enabled = true
source {
method = "HTTP_GET"
params {
url = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
jsonPath = "/bitcoin/usd"
timeout = 5 seconds
}
}
minStableGasPrice = 476190000000 # Minimum gas price
refreshRate = 6 hours # How often to check for updates
}
```

## blockchain.config.name

A string that describe the name of the configuration.
Expand Down

0 comments on commit a5de961

Please sign in to comment.