DXgovernance / davi-monorepo

https://davi-monorepo-davi.vercel.app
8 stars 12 forks source link

Feature/10 custom rpcs #328

Closed rulfo71 closed 1 year ago

rulfo71 commented 1 year ago

Description

Adding the posibility of using Custom RPCs and decentralize mode:

image image

Closes #10

Type of change

How Has This Been Tested?

To test this i had to disable subgraph, which i did with the following:

Besides that, i tested adding as custom RPCs the ones we have on providers.ts:

const POKT_NETWORK_URLS = {
  '1': 'https://eth-mainnet.gateway.pokt.network/v1/lb/dda01e253305bbeac6507a80',
  '5': 'https://eth-goerli.gateway.pokt.network/v1/lb/dda01e253305bbeac6507a80',
  '100': 'https://poa-xdai.gateway.pokt.network/v1/lb/dda01e253305bbeac6507a80',
};

switching them between correct and incorrect chains, removing parts of the string to check the error to show. Also tried inserting a simple text that wasn't a url.

Decentralize Mode

test a subgraph function like permissions tab. This should not be working when decentralize mode is active

Checklist:

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
davi ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 28, 2023 at 3:08AM (UTC)
rossneilson commented 1 year ago

Works great, loaded up my local node and saw it getting called in network tab.

A couple of things:

rulfo71 commented 1 year ago

Could we add the toggle for always using fallback/rpc from store? (just asked @borisblock3007 to add it to the designs also) @rossneilson By this you mean like the 'decentralize mode' we talked about?

rossneilson commented 1 year ago

Could we add the toggle for always using fallback/rpc from store? (just asked @borisblock3007 to add it to the designs also) @rossneilson By this you mean like the 'decentralize mode' we talked about?

Yeah, actually a good name for it, would just be overriding our fallback logic

rulfo71 commented 1 year ago

great! yes i heard that name from diogo, looks like carrot is implementing the same thing of optionally avoid using subgraph.

rulfo71 commented 1 year ago

I added decentralize mode:

image

i don't think this is the place we should add it, i just wanted to add the functionality until we have the designs. Having it here is a bit confusing, first because this is a modal to change to customs RPCs which is not what we do with decentralize mode and also because i think it should be on a place where it is almost all the time visible so that the user can realize that a functionality is not working because of the decentralize mode is on.

@borisblock3007 @rossneilson let me know what you think

rossneilson commented 1 year ago

I added decentralize mode: image

i don't think this is the place we should add it, i just wanted to add the functionality until we have the designs. Having it here is a bit confusing, first because this is a modal to change to customs RPCs which is not what we do with decentralize mode and also because i think it should be on a place where it is almost all the time visible so that the user can realize that a functionality is not working because of the decentralize mode is on.

@borisblock3007 @rossneilson let me know what you think

I don't think its awful in here since it is related to RPCs. So we can either rename the RPC modal to "RPC configuration" or move decentralise mode into the main modal before RPC stuff. I don't have a huge opinion, lets choose one and we can move it later.

We may even need to think about having the decentralise button be more a menu to select for each dao type.

rossneilson commented 1 year ago

Also the decentralize button works super well!!! great work

Small aside but seems the toggle button is sticky, if you move your cursor around it kind of follows (seems like smartphone behaviour but cant seem to make it not sticky again)

rulfo71 commented 1 year ago

oh yes i'm seeing if you click on the black circle inside toggle that happens but if you click on the rest no... doesn't seem to happen on the other toggles, will look into it

rulfo71 commented 1 year ago

I moved DecentralizeMode to the WalletModal. I think this is better because CustomRPC modal onDismiss refreshes the page and for DecentralizeMode we don't need that.

image