Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

feat: raw and process snapshot commands - #6

Open
Pantani wants to merge 34 commits into
mainfrom
feat/read-state
Open

feat: raw and process snapshot commands#6
Pantani wants to merge 34 commits into
mainfrom
feat/read-state

Conversation

@Pantani

@Pantani Pantani commented Dec 20, 2022

Copy link
Copy Markdown
Contributor

Description

  • Add cmd commands;
  • Add debug main package to test locally;
  • Create a snapshot package to generate a raw snapshot and filter based on the stake and bank modules;
  • Create a config package to parse the snapshot config file;
  • Create a formula package to calculate the airdrop balance (WIP/Blocked);
  • Create a genesis package to handle genesis files;
  • Create a encode package to decode/encode the genesis state;
  • Fix CI;

How to test

Run the raw airdrop command to generate the raw data

go run cmd/debug/debug.go airdrop raw testdata/genesis.json 2> raw-snapshot.json

Run the process command to generate the claim records

go run cmd/debug/debug.go airdrop process testdata/config.yml raw-snapshot.json 2> snapshot.json

Generate the new genesis json with the claimable state based on the output genesis

go run cmd/debug/debug.go airdrop genesis testdata/config.yml raw-snapshot.json testdata/genesis.json

Or you can only use the generate command to run all four above with one command

go run cmd/debug/debug.go airdrop generate testdata/config.yml testdata/genesis.json testdata/genesis.json

@Pantani Pantani self-assigned this Dec 20, 2022
@Pantani Pantani changed the title feat: airdrop feat: generate raw snapshot Dec 21, 2022
@Pantani
Pantani marked this pull request as ready for review December 21, 2022 16:14
@codecov

codecov Bot commented Dec 21, 2022

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@Pantani Pantani changed the title feat: generate raw snapshot feat: raw and process snapshot commands Dec 22, 2022
Comment thread cmd/cmd.go Outdated
Comment thread pkg/config/config.go Outdated
Comment thread pkg/snapshot/generate.go Outdated
Comment thread pkg/snapshot/generate.go Outdated
Comment thread cmd/cmd.go Outdated
func NewAirdropRaw() *cobra.Command {
return &cobra.Command{
Use: "raw [input-genesis]",
Short: "Generate raw airdrop data based on the input genesis",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the input genesis for the raw command? Is it the genesis that has been exported from the chain to parse snapshot from? It's a bit unclear since we should also have the "input genesis" where we populate the claim genesis state from the snapshot data

This may be implemented but I think we should let the use the ability to provide a RPC address for the chain, where the genesis would be automatically exported

@Pantani
Pantani marked this pull request as draft December 26, 2022 04:13
- add comments
- unexport config validate method
Comment thread cmd/debug/debug.go
# Conflicts:
#	.github/workflows/test.yml
#	go.mod
#	go.sum
@Pantani
Pantani requested review from lubtd and tbruyelle January 9, 2023 18:54
@lubtd

lubtd commented Jan 10, 2023

Copy link
Copy Markdown
Contributor

Still in draft @Pantani ?

@Pantani

Pantani commented Jan 10, 2023

Copy link
Copy Markdown
Contributor Author

Still in draft @Pantani ?

yes, I'm working on it today

@Pantani
Pantani marked this pull request as ready for review January 10, 2023 22:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants