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

Bugfix: Adding migrations to the hidden imports #2007

Merged
merged 2 commits into from Dec 7, 2022

Conversation

k9ert
Copy link
Collaborator

@k9ert k9ert commented Dec 7, 2022

It seems that the migrations never got packaged into the specterd. That didn't caused so much trouble up to now. However, now migration_0002 is a critical one. Not shipping it caused #2006

This PR is fixing that:

2022-12-07T17:22:39.304Z [info] : stderr-SPECTERD: INFO in specter_migrator: Initiated MigDataManager(~/.specter_mainchain/migration_data.json events:0 execs:0 )
SPECTERD: INFO in specter_migrator: A new version has been started compared to last time: v1.14.1-pre1

2022-12-07T17:22:39.305Z [info] : stderr-SPECTERD: INFO in specter_migrator: Collecting possible migrations ...

2022-12-07T17:22:39.305Z [info] : stderr-SPECTERD: INFO in specter_migrator: Collecting possible migrations ...

2022-12-07T17:22:39.305Z [info] : stderr-SPECTERD: INFO in specter_migrator: Collecting possible migrations ...

2022-12-07T17:22:39.306Z [info] : stderr-SPECTERD: INFO in specter_migrator:   --> Starting Migration SpecterMigration_0002
SPECTERD: INFO in specter_migrator: Node-class migration:
            We introduced the Spectrum Node on an extension. With that, we made the choice of 
            the Node to be instantiated much more flexible. The node.json gets an attribute called
            python_class which is the fully qualified package name of the class the NodeManager
            should instantiate.
            This migrates all the node.json files to the new format.
            Effectively it will:
            * Iterate over all nodes in ~/.specter/nodes/*.json
            * load each node.json and adds the correct python_class 
            * stores it again
            In order to reverse this migration, you do need to reverse the addition of the 
            python_class like this:
            
            sudo apt-get install moreutils jq
            cd ~/.specter/nodes
            # remove python_class key
            for file in `ls *.json`; do jq 'del(.python_class)' $file | sponge $file ; done
            cd ..
            jq 'del(.migration_executions[] | select(.migration_id == 2))' migration_data.json | sponge migration_data.json

        

2022-12-07T17:22:39.306Z [info] : stderr-SPECTERD: INFO in migration_0002: No node_folder found in {self.data_folder}. Nothing to do
SPECTERD: INFO in specter_migrator:   --> Completed Migration SpecterMigration_0002

2022-12-07T17:22:39.306Z [info] : stderr-SPECTERD: INFO in specter_migrator:   --> Starting Migration SpecterMigration_0001
SPECTERD: INFO in specter_migrator: Single-Node migration:
            In v1.3.1 Single Node implementation has been implemented
            Later we had multiple nodes. This migrates the single installation to one of many.
            Effectively it will:
            * Check whether an internal node was existing in ~/.specter/.bitcoin
            * Check whether a new internal default node (bitcoin/main) is NOT existing
            * Move the ~/.specter/.bitcoin to ~/.specter/nodes/specter_bitcoin/.bitcoin-main
            * Creates a json-definition in ~/.specter/nodes/specter_bitcoin.json
        

2022-12-07T17:22:39.306Z [info] : stderr-SPECTERD: INFO in migration_0001: No .bitcoin directory found in {self.data_folder}. Nothing to do

2022-12-07T17:22:39.306Z [info] : stderr-SPECTERD: INFO in specter_migrator:   --> Completed Migration SpecterMigration_0001

2022-12-07T17:22:39.306Z [info] : stderr-SPECTERD: INFO in specter_migrator:   --> Starting Migration SpecterMigration_0000
SPECTERD: INFO in specter_migrator: A dummy migration:
            * It will do nothing
            * It's just here to explain how SpecterMigration works
            * It will be shown in the logs when it's executed (just like the other real migrations but doing nothing)
        

2022-12-07T17:22:39.307Z [info] : stderr-SPECTERD: INFO in specter_migrator:   --> Completed Migration SpecterMigration_0000

2022-12-07T17:22:39.307Z [info] : stderr-SPECTERD: INFO in server: Initializing LoginManager


@netlify
Copy link

netlify bot commented Dec 7, 2022

Deploy Preview for specter-desktop-docs canceled.

Name Link
🔨 Latest commit ed9f746
🔍 Latest deploy log https://app.netlify.com/sites/specter-desktop-docs/deploys/6390c8e95febc600098188a7

@k9ert k9ert merged commit 3ad8f22 into cryptoadvance:master Dec 7, 2022
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