Skip to content
Snippets Groups Projects
Select Git revision
  • tuxmain/gdev
  • master default protected
  • hugo-add-cert-emission-block
  • duniter-v2s-issue-125-industrialize-releases
4 results

py-g1-migrator

user avatar
ZettaScript authored
e1c966dd
History

Data migration from Ğ1v1 to Ğ1v2

TL;DR

time (./main.py && ./generate_transactions_history.py && ./boot_gdev.sh poka gdevX && ./push-gdev.sh)

or just:

./orchestra.sh poka gdevX

Tested with python 3.8 and 3.9

this tool allows you to transform current Ğ1v1 data into genesis Ğv2.

It also allows importing up-to-date Ğ1v1 history for your indexer v2s.

You will need substrate-interface pip package:
pip install -r requirements.txt or pip install substrate-interface

0. Add optionnal custom data

You can add link your new Ğ1v2 address with your actual Ğ1v1 pubkey by editing custom/identities.json file.
You can add your owns identities by editing custom/identities.json file.
You can add your identity to smiths wot by editing custom/smiths.json file.
You can add your identity to tech commitee by editing custom/technical_committee.json file.
You can edit currency parameters in custom/parameters.py file.

1. Generate your up-to-date v2s Ğ1data genesis: ./main.py

This is making all the parsing and formating to generate final ĞTest genesis JSON.
Inputs data are downloaded from https://g1-migrator.axiom-team.fr, which is provided by dex every days at 6:30 am.

This take about 5 seconds, depends of your internet connection and CPU.

After that:

$ ls output/
gdev.json

You can optionally add the provisional launch timestamp of your blockchain, so as to adapt the expiration dates of the identities:
./main.py 1665373345

2. Start you new Duniter v2s node with up-to-date Ğ1v1 datas ! : rm -rf output/chains && docker compose up

Congratulations ! Your ĞTest blockchain starts.
You can explore it with: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer

3. (optionnal) Generate your up-to-date v2s-indexer Ğ1 transactions history: ./generate_transactions_history.py

Then you can start a new v2s-indexer with your new output/history.json json file.