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(download-genesis): support new chain-ids #2792

Closed
rootulp opened this issue Oct 31, 2023 · 2 comments · Fixed by #2812
Closed

feat(download-genesis): support new chain-ids #2792

rootulp opened this issue Oct 31, 2023 · 2 comments · Fixed by #2812
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rootulp
Copy link
Collaborator

rootulp commented Oct 31, 2023

Context

We're adding a download-genesis [chain-id] command in #2791 that only supports hard-coded chain-ids: celestia, mocha-4, arabica-10.

Problem

When new testnets get spun up, we'll need a code change in celestia-app to support them. The code change needs to add the chain-id to the list of known chain-ids, and add a sha-256 hash of the genesis file for that testnet.

Proposal

Investigate a solution that doesn't need hard-coded sha-256 hashes + chain-ids.

@rootulp rootulp added enhancement New feature or request good first issue Good for newcomers and removed needs:triage labels Oct 31, 2023
@evan-forbes
Copy link
Member

just my two cents, but I think its fine to only support this feature for long lived networks by manually adding the hashes since other networks can use the normal mechanism of just manually downloading the genesis.

I feel like the diff of curling something vs modifying a config or flag to curl something in a command is really small. We should however document that people can submit PRs to include any long lived networks in the binary.

@rootulp
Copy link
Collaborator Author

rootulp commented Nov 5, 2023

Agreed. Based on that it seems like we can close this issue via documenting how to add a new chain-id to the download genesis command.

@rootulp rootulp self-assigned this Nov 5, 2023
rootulp added a commit that referenced this issue Nov 6, 2023
Closes #2792

## Testing

Manually verified the command still works as expected

```go
$ ./build/celestia-appd download-genesis
Downloading genesis file for celestia to /Users/rootulp/.celestia-app/config/genesis.json
Downloaded genesis file for celestia to /Users/rootulp/.celestia-app/config/genesis.json
SHA-256 hash verified for celestia

$ cat ~/.celestia-app/config/genesis.json | jq ."chain_id"
"celestia"

$ ./build/celestia-appd download-genesis mocha-4
Downloading genesis file for mocha-4 to /Users/rootulp/.celestia-app/config/genesis.json
Downloaded genesis file for mocha-4 to /Users/rootulp/.celestia-app/config/genesis.json
SHA-256 hash verified for mocha-4

$ cat ~/.celestia-app/config/genesis.json | jq ."chain_id"
"mocha-4"
```
0xchainlover pushed a commit to celestia-org/celestia-app that referenced this issue Aug 1, 2024
Closes celestiaorg/celestia-app#2792

## Testing

Manually verified the command still works as expected

```go
$ ./build/celestia-appd download-genesis
Downloading genesis file for celestia to /Users/rootulp/.celestia-app/config/genesis.json
Downloaded genesis file for celestia to /Users/rootulp/.celestia-app/config/genesis.json
SHA-256 hash verified for celestia

$ cat ~/.celestia-app/config/genesis.json | jq ."chain_id"
"celestia"

$ ./build/celestia-appd download-genesis mocha-4
Downloading genesis file for mocha-4 to /Users/rootulp/.celestia-app/config/genesis.json
Downloaded genesis file for mocha-4 to /Users/rootulp/.celestia-app/config/genesis.json
SHA-256 hash verified for mocha-4

$ cat ~/.celestia-app/config/genesis.json | jq ."chain_id"
"mocha-4"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants