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

Replace init task with seed values #351

Merged
merged 1 commit into from
Aug 16, 2018
Merged

Replace init task with seed values #351

merged 1 commit into from
Aug 16, 2018

Conversation

sangaman
Copy link
Collaborator

Closes #331.

This commit makes xud add seed values for pairs and currencies when a new database is created during startup. These are in addition to the seed nodes. An initDb config option can be set to false to disable initializing new databases with these seed values. This makes the db:init task obsolete.

I didn't add a value to the [db] config section because we've had that line up with Sequelize options and initValues would have broken that. I tried this approach at first but it was getting messy making changes to DB.ts to accommodate it. So instead I put initDb as a top level config option.

@ghost ghost assigned sangaman Aug 16, 2018
@ghost ghost added the in progress label Aug 16, 2018
@sangaman sangaman requested review from moshababo and kilrau August 16, 2018 05:39
Copy link
Collaborator

@moshababo moshababo left a comment

Choose a reason for hiding this comment

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

Looks good, thanks.

Please remove the init task from the tasks index file and the gulpfile as well. We might add it again later, to be used for test automation (with different values), but for now it's not needed.

@kilrau
Copy link
Contributor

kilrau commented Aug 16, 2018

works like a charme, but it's still based on hosts, so you might have adjust this to nodes as per #315 ? @sangaman

@sangaman
Copy link
Collaborator Author

sangaman commented Aug 16, 2018

Yup, I will refactor once #315 is merged.

Edit: Which should be now, one moment.

This commit makes xud add seed values for pairs and currencies when a new database is created during startup. These are in addition to the seed nodes. An `initDb` config option can be set to `false` to disable initializing new databases with these seed values. This makes the `db:init` task obsolete.
@sangaman
Copy link
Collaborator Author

@kilrau Rebase done, do you want to try this again one more time now that it's using nodes?

Copy link
Contributor

@kilrau kilrau left a comment

Choose a reason for hiding this comment

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

like a charme!

@sangaman sangaman merged commit 7c7f293 into master Aug 16, 2018
@ghost ghost removed the in progress label Aug 16, 2018
@sangaman sangaman deleted the remove_init branch August 16, 2018 21:19
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