-
Notifications
You must be signed in to change notification settings - Fork 475
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
Use GitHub raw.githubusercontent.com to avoid rate limiting #446
Conversation
downloadCurrentVersion.js
Outdated
@@ -13,7 +15,7 @@ function getVersionList (cb) { | |||
console.log('Retrieving available version list...'); | |||
|
|||
var mem = new MemoryStream(null, { readable: false }); | |||
https.get('https://ethereum.github.io/solc-bin/bin/list.json', function (response) { | |||
https.get(SOLC_REPO + 'list.json', function (response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https.get(SOLC_REPO + 'list.json', function (response) { | |
https.get(SOLC_REPO + '/list.json', function (response) { |
Just in case people forget a trailing slash in the env variable?
Can you document this feature in the readme? @edisinovcic does this conflict with your work? |
No, it's definitely a welcomed PR. |
downloadCurrentVersion.js
Outdated
@@ -3,6 +3,8 @@ | |||
// This is used to download the correct binary version | |||
// as part of the prepublish step. | |||
|
|||
const SOLC_REPO = process.env.SOLC_REPO || 'https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use case for changing the official URL here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GitHub pages URL becomes rate limited once you exceed certain bandwidth allowance, which made our CI builds fail when downloading solc. Using the raw URL bypasses the pages rate limits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that, but not the reason for env.SOLC_REPO
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented underneath.
Changing it here, while keeping the old URL in |
Definitely @axic but I can update it for the whole project for it to be configurable if that's okay with you? |
I am not yet seeing the use case for that. Also note that |
Mostly for pointing to internal repositories/elsewhere. Even though there's checksums, some teams could want to lock versions in their own repository, or remove the dependency on GitHub all together. I'll update the URL in wrapper.js, but in terms of adding an override since it's a lib, I feel I wouldn't be best making that change. |
I'd prefer we merge this without the override (to include it in 0.6.3) and then we can discuss the override separately and land it in 0.6.4. Does that sounds like a good middle gorund? |
da53fab
to
9309f5a
Compare
@jleeh can you create a new PR for the override? |
Sure. I'll base it on this branch to avoid future conflicts. |
Fixes #445.
Ability to override the repository all together with an environment variableSOLC_REPO
. Allowing people to use alternative repos, including internal.