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: raw and process snapshot commands #6

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open

Conversation

Pantani
Copy link
Contributor

@Pantani Pantani commented Dec 20, 2022

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
Copy link

codecov bot commented Dec 21, 2022

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
cmd/cmd.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/snapshot/generate.go Outdated Show resolved Hide resolved
pkg/snapshot/generate.go Outdated Show resolved Hide resolved
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
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
# Conflicts:
#	.github/workflows/test.yml
#	go.mod
#	go.sum
@lumtis
Copy link
Contributor

lumtis commented Jan 10, 2023

Still in draft @Pantani ?

@Pantani
Copy link
Contributor Author

Pantani commented Jan 10, 2023

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 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