yearn / yBuyback

https://buyback.yearn.finance/
GNU General Public License v3.0
4 stars 16 forks source link

feat: bump web-lib for more control over RPC #12

Closed Majorfi closed 2 years ago

Majorfi commented 2 years ago

Upgrade the web-lib to V0.9.x, which enable more RPC settings.

For the supported networks, the logic is now this one:

is a webSocketURL env set ?
    then use it
is a jsonRPCURL env set ?
    then use it
is an Alchemy key set ?
    then use it
if an Infura set ?
    then use it
Otherwise, use the default RPC

Default RPC are https://rpc.flashbots.net for Ethereum Mainnet and https://rpc.ftm.tools for Fantom Network. Exact implementation is available in the web-lib here.

In order to customise the env variable, you can create a .env file with the following informations:

WS_URL_MAINNET=wss://xxxxxxx
WS_URL_FANTOM=wss://xxxxxxx
WS_URL_ARBITRUM=wss://xxxxxxx
RPC_URL_MAINNET=https://xxxxxxx
RPC_URL_FANTOM=https://xxxxxxx
RPC_URL_ARBITRUM=https://xxxxxxx
ALCHEMY_KEY=xxxxxxx
INFURA_KEY=xxxxxxx