dappnode / DAppNodePackage-pokt

GNU General Public License v3.0
2 stars 2 forks source link

Add global ENVs for Göerli EL Clients #14

Open alexpeterson91 opened 1 year ago

alexpeterson91 commented 1 year ago

Since we have 4 Göerli Execution Clients and the config currently defaults Ethereum and all Ethereum testnets (goerli, ropsten, rinkeby, I think sepolia is on the relay list of Pokt and can be added with one line in the chains file) to Geth. For all testnets aside from Goerli we have only Geth published. So with the stakersUI as it stands today you must use goerli geth as your goerli relay chain.

Describe the solution you'd like

So I propose we implement global ENV for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_PRATER and change the config of the goerli relay endpoint to be determined and set by the stakersUI via the Global ENV above.

This obviously will apply to mainnet down the road and other EVM chains.

But what I want to accomplish here is when using pokt and relaying goerli chain when you change the EL client in the prater stakersUI pokt should also use the _DAPPNODE_GLOBAL_EXECUTION_CLIENT_PRATER ENV variable as the chosen domain for goerli relay. So if I'm running on goerli geth and want or need to change to nethermind goerli or goerli besu whatever pokt sees the change and changes its relay end point to match the active goerli EL endpoint to relay.

Describe alternatives you've considered

Considered adding more manual features to the UI but it would make the UX much worse.

Additional context

mgarciate commented 1 year ago

Since we have 4 Göerli Execution Clients and the config currently defaults Ethereum and all Ethereum testnets (goerli, ropsten, rinkeby, I think sepolia is on the relay list of Pokt and can be added with one line in the chains file) to Geth. For all testnets aside from Goerli we have only Geth published. So with the stakersUI as it stands today you must use goerli geth as your goerli relay chain.

Describe the solution you'd like

So I propose we implement global ENV for _DAPPNODE_GLOBAL_EXECUTION_CLIENT_PRATER and change the config of the goerli relay endpoint to be determined and set by the stakersUI via the Global ENV above.

This obviously will apply to mainnet down the road and other EVM chains.

But what I want to accomplish here is when using pokt and relaying goerli chain when you change the EL client in the prater stakersUI pokt should also use the _DAPPNODE_GLOBAL_EXECUTION_CLIENT_PRATER ENV variable as the chosen domain for goerli relay. So if I'm running on goerli geth and want or need to change to nethermind goerli or goerli besu whatever pokt sees the change and changes its relay end point to match the active goerli EL endpoint to relay.

Describe alternatives you've considered

Considered adding more manual features to the UI but it would make the UX much worse.

Additional context

Good catch @alexpeterson91. I'll think about increasing the configuration since we have multiple clients for a given network Id as you described. Your solution is not bad at all but I'll try to do the effort in order to change the chains availability in a more flexible way. What I like the most of your solution is the use of _DAPPNODE_GLOBAL_EXECUTION_CLIENT_PRATER. Unfortunately, we'd need to reload chains in the Pokt package when we change that global ENV from the Stakers UI.