Skip to content

chore: added htr token seed#256

Merged
andreabadesso merged 4 commits intomasterfrom
chore/htr-seed
Apr 24, 2025
Merged

chore: added htr token seed#256
andreabadesso merged 4 commits intomasterfrom
chore/htr-seed

Conversation

@andreabadesso
Copy link
Copy Markdown
Collaborator

@andreabadesso andreabadesso commented Apr 16, 2025

Motivation

Previously, the HTR token was inserted via a migration, which could lead to issues if the database was reset or cleaned, as the migration would not re-insert the token. Additionally, there was no clear, documented process for cleaning up the database and reseeding essential data.

This PR introduces a proper seed script for the HTR token that dynamically calculates its transaction count, and updates the documentation to provide clear instructions for database cleanup and reseeding.

Acceptance Criteria

  • A seed script exists to insert the HTR token with the correct transaction count based on current database state.
  • The README includes clear instructions for reseeding the HTR token after a database reset.
  • The README includes a section and SQL script for safely cleaning up (truncating) all tables in the database, handling foreign key constraints.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged
  • Make sure either the unit tests and/or the QA tests are capable of testing the new features
  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@andreabadesso andreabadesso self-assigned this Apr 16, 2025
@andreabadesso andreabadesso requested review from luislhl and r4mmer April 16, 2025 13:43
@andreabadesso andreabadesso added the enhancement New feature or request label Apr 16, 2025
@andreabadesso andreabadesso moved this from Todo to In Progress (WIP) in Hathor Network Apr 16, 2025
@andreabadesso andreabadesso moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Apr 16, 2025
r4mmer
r4mmer previously approved these changes Apr 16, 2025
@andreabadesso andreabadesso moved this from In Progress (Done) to In Review (WIP) in Hathor Network Apr 16, 2025
Comment thread README.md
To run the seed and add the HTR token again, use the following command:

```
yarn dlx sequelize-cli db:seed:all
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For this to work, I think there should exist a .env file with the right variables, is that correct?

Maybe we should state this in the guide.

Also, I believe NODE_ENV=production should be present among the variables, otherwise it will always try to connect to a database in localhost instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I updated the readme with the minimal env variables required to run the seeder

@andreabadesso andreabadesso merged commit a2394d0 into master Apr 24, 2025
1 check passed
@github-project-automation github-project-automation Bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Apr 24, 2025
@andreabadesso andreabadesso deleted the chore/htr-seed branch April 24, 2025 15:09
r4mmer added a commit that referenced this pull request Jul 3, 2025
…-lib-v2.1.1

* origin/master:
  chore: bumped to v1.9.0 (#259)
  chore: nano-testnet-hackaton (#243)
  fix: address invalid parameter (#235)
  chore: added htr token seed (#256)
  fix: invalid assert in release tx proposal utxos (#251)
  fix: we should await mark utxos with proposal id to prevent a race condition (#250)
  Merge pull request #248 from HathorNetwork/feat/version-camel-case
  fix: v1.8.2-rc.3 qa issues (#246)
  fix: firebase env variables should be optional (#245)
  chore: remove error handler middleware from authorization lambda (#242)
  feat: version data validation (#241)
  fix: Mainnet release script (#203)
This was referenced Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants