Skip to content

Commit

Permalink
Load balance eth gas price request (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrsirdev authored Dec 12, 2023
1 parent f7580db commit 594987f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

## 1.3.5 - 2023-12-12

- (chore) [fse-897] Use loadbalanced post request for eth gas price

## 1.3.4 - 2023-12-12

- (chore) [fse-897] Replace lava RPC with allnodes RPC for eth gas price
Expand Down
8 changes: 6 additions & 2 deletions api/handler/v1/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package v1

import (
"bytes"
"encoding/json"
"fmt"
"strconv"
Expand Down Expand Up @@ -32,8 +33,11 @@ func Epochs(ctx *fasthttp.RequestCtx) {
}

func EthGasPriceInternal() (string, error) {
url := "https://evmos-evm.publicnode.com"
val, _ := requester.MakePostGasPrice(url)
payload := bytes.NewBuffer([]byte(`{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}`))
val, err := requester.MakePostRequest("EVMOS", "web3", "/", payload.Bytes())
if err != nil {
return "", err
}
return val, nil
}

Expand Down

0 comments on commit 594987f

Please sign in to comment.