-
Notifications
You must be signed in to change notification settings - Fork 375
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 support for genesis download
#2841
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2841 +/- ##
==========================================
- Coverage 60.97% 60.96% -0.01%
==========================================
Files 564 565 +1
Lines 75273 75342 +69
==========================================
+ Hits 45897 45935 +38
- Misses 26008 26028 +20
- Partials 3368 3379 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
const test4ID = "test4" | ||
|
||
const deploymentPathFormat = "https://raw.githubusercontent.com/gnolang/gno/refs/heads/master/misc/deployments/%s.gno.land/genesis.json" | ||
|
||
var genesisSHAMap = map[string]string{ | ||
test4ID: "beb781dffc09b96e3114fb7439fa85c4fe8ea796f64ec0cd3801a6b518ab023c", | ||
} |
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.
This should be automated; or at least we should test the verification (ie. each source should map the sha sum, this should be an explicit test)
Also the link to genesis.json shouldn't be master, but a permalink like a commit. I think we can avoid making this dynamic with the %s
, but instead have a struct with Source string; Checksum string
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 adopted the metadata structure you were suggesting:
Our unit tests already cover actually fetching the genesis from the source and verifying it
|
||
defer resp.Body.Close() | ||
|
||
f, err := os.Create( |
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.
os.CreateTemp?
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.
Why would we use it instead of os.Create
?
I don't understand why you're downloading the Genesis file from github, the genesis file is downloadable from any RPCs, Btw if you check a cosmoshub rpc they have an extra endpoint |
Please wait for comments on this issue: #2824 I believe we should clean up gnoland by removing the genesis subcommand and moving the commands to a contribs binary. |
A live RPC is not really the most reliable backup and restore mechanism, as 100% of our deployments are proof of that |
We can always move this feature along with the command suite, I don't think it adds additional bloat we should worry about. The primary use case I see is people who want to easily spin up their RPC / whatever cluster, with the existing cc @sw360cab @r3v4s @mazzy89 what do you think about this sugar command? |
|
Actually looking better at our deployment flow, we pull the genesis at bootstrap time in an init container using curl. A simply |
for the sake of completeness. how it looks our init container
|
Agreed, this pr isn't really spaghetti
I really don't have specific opinion for this, as @mazzy89 said we can achieve same result with However maybe we can use this command as internally for bootstrap script from our side. Or it can be used inside some docker image that doesn't support |
IMO it can be useful if the goal is concentrating all the useful setup commands within the On the other hand, probably this subsubcommand is satisfying only a very small subset of use cases, the price of maintaining it can become higher that its real usefulness. |
Closing this PR after comments from the ops crew 🙏 It's not a feature that should suck out maintain-time in the future :) |
Description
This PR introduces a
genesis download
subcommand, for downloading officialgenesis.json
artifacts using thegnoland
binary.Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description