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

Include import-validator as a hidden algorand-indexer subcommand. #871

Merged
merged 2 commits into from
Feb 9, 2022

Conversation

winder
Copy link
Contributor

@winder winder commented Feb 8, 2022

Summary

Add a ./algorand-indexer import-validator subcommand which behaves the same as the current import-validator utility.

Test Plan

Manual testing:

  1. Start postgres in a terminal: docker run -it --rm --name some-postgres -p 5555:5432 -e POSTGRES_PASSWORD=algorand -e POSTGRES_USER=algorand -e POSTGRES_DB=algorand postgres
  2. Initialize a ledger directory with the current import-validator: ./import-validator --postgres "user=algorand password=algorand host=localhost dbname=algorand port=5555 sslmode=disable" --algod-net https://<URL> --algod-token <token> --algod-ledger ledger
  3. Kill import-validator and start the new subcommand: ./algorand-indexer import-validator --postgres "user=algorand password=algorand host=localhost dbname=algorand port=5555 sslmode=disable" --algod-net https://<URL> --algod-token <token> --algod-ledger ../import-validator/ledger

@tolikzinovyev
Copy link
Contributor

What's the rationale?

@winder
Copy link
Contributor Author

winder commented Feb 8, 2022

What's the rationale?

@tolikzinovyev Bundling in the most useful utilities should make it easier to perform release testing and ensure the utilities match the algorand-indexer version. There is also some automation I want to add, which will be simpler if I don't have to rebuild the utilities when a new release is detected. I'm planning to include block-generator and validator next.

@tolikzinovyev
Copy link
Contributor

could you give one specific example where this is useful?

@winder
Copy link
Contributor Author

winder commented Feb 8, 2022

could you give one specific example where this is useful?

I would like to setup the import-validator on an EC2 instance, along with a cron job that fetches the latest release. With this tool in the latest release this is simple to automate. If it isn't in the release the script would also need a full development environment and would have to guess about which code to use (usually the tip of master, but not necessarily).

There is some release automation with similar issues, they become more straight-forward when the utilities are bundled together:

  1. Grabbing a new release and starting a new indexer deployment is simple, but once caught up how do we run validator?
  2. The performance benchmarks can get the latest version, but when if the block generator also had changed?

Copy link
Contributor

@tolikzinovyev tolikzinovyev left a comment

Choose a reason for hiding this comment

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

The code looks good, but imo it seems like too much automation. You could have a script that takes a git hash as input and does everything else.

cmd/import-validator/core/service.go Outdated Show resolved Hide resolved
@winder winder merged commit f5344d7 into develop Feb 9, 2022
@winder winder deleted the will/unify-import-validator branch February 9, 2022 15:03
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.

None yet

2 participants