From a5de9615bb90d0239f3ebb1773984b2de4032ee6 Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Sun, 27 Oct 2024 14:17:08 -0400 Subject: [PATCH] Adding HTTP_GET support --- .../04-setup/03-configuration/03-reference.md | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/03-node-operators/04-setup/03-configuration/03-reference.md b/docs/03-node-operators/04-setup/03-configuration/03-reference.md index 9e3e195b..49c4ce84 100644 --- a/docs/03-node-operators/04-setup/03-configuration/03-reference.md +++ b/docs/03-node-operators/04-setup/03-configuration/03-reference.md @@ -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 @@ -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.