Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add env BROVIDER_URL #1089

Closed
wants to merge 1 commit into from
Closed

Conversation

EthanOK
Copy link

@EthanOK EthanOK commented Nov 29, 2024

Fixes # .

Changes proposed in this pull request:

  • Add env BROVIDER_URL

@@ -1,3 +1,4 @@
import 'dotenv/config';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we want to use this on front end, it works?

@@ -10,7 +11,7 @@ export type ProviderOptions = {
broviderUrl?: string;
};

const DEFAULT_BROVIDER_URL = 'https://rpc.snapshot.org';
const DEFAULT_BROVIDER_URL = process.env.BROVIDER_URL || 'https://rpc.snapshot.org';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which project is asking for this?

Copy link
Author

@EthanOK EthanOK Nov 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/snapshot-labs/snapshot-strategies/blob/master/src/utils/vp.ts#L22
I'm using getVp, but I want to use my own provider rpc.
So change getProvider in snapshot.js.

Another solution: ADD setBroviderUrl #1090

let DEFAULT_BROVIDER_URL = 'https://rpc.snapshot.org';
export function setBroviderUrl(broviderUrl: string) {
  DEFAULT_BROVIDER_URL = broviderUrl;
}

Link: EthanOK@485948a

I am more in favor of add setBroviderUrl. You can close add env.

@EthanOK EthanOK closed this Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants