From 426e46c79161abbffed8617f60d7a52c2cf68ea9 Mon Sep 17 00:00:00 2001 From: Louis Holbrook Date: Wed, 31 Mar 2021 11:04:05 +0000 Subject: [PATCH] Sovereign import part II --- apps/contract-migration/scripts/README.md | 19 ++++++++++++++++++- .../scripts/import_sovereign_users.py | 3 --- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/contract-migration/scripts/README.md b/apps/contract-migration/scripts/README.md index 048a1f6f..cdefe7f5 100644 --- a/apps/contract-migration/scripts/README.md +++ b/apps/contract-migration/scripts/README.md @@ -21,9 +21,13 @@ Make sure the following is running in the cluster: * eth * postgres * redis + * cic-meta-server + + +If using the _custodial_ alternative for user imports, also run: * cic-eth-tasker * cic-eth-dispatcher - * cic-eth-manager-head + * cic-eth-tracker You will want to run these in sequence: @@ -47,12 +51,25 @@ This will monitor new mined blocks and send balances to the newly created accoun ### 3. Users +Only use **one** of the following + +#### Custodial + +This alternative generates accounts using the `cic-eth` custodial engine + Without any modifications to the cluster and config files: `python import_users.py -c config --redis-host-callback redis ` ** A note on the The callback**: The script uses a redis callback to retrieve the newly generated custodial address. This is the redis server _from the perspective of the cic-eth component_. +#### Sovereign + +This alternative generates keystore files, while registering corresponding addresses in the accounts registry directly + +`python import_sovereign_users.py -c config -i -r -p -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c ` + +A `keystore` sub-directory in the data path is created, with ethereum keystore files for all generated private keys. Passphrase is set to empty string for all of them. ## VERIFY diff --git a/apps/contract-migration/scripts/import_sovereign_users.py b/apps/contract-migration/scripts/import_sovereign_users.py index 31dcf4cd..39f4143a 100644 --- a/apps/contract-migration/scripts/import_sovereign_users.py +++ b/apps/contract-migration/scripts/import_sovereign_users.py @@ -105,7 +105,6 @@ def register_eth(i, u): (tx_hash_hex, o) = c.add(account_registry_address, signer_address, address) logg.debug('o {}'.format(o)) rpc.do(o) - #r = rpc.wait(tx_hash_hex) pk = keystore.get(address) keyfile_content = to_keyfile_dict(pk, '') @@ -165,8 +164,6 @@ if __name__ == '__main__': f.write(json.dumps(o)) f.close() - #old_address = to_checksum_address(add_0x(y[:len(y)-5])) - #fi.write('{},{}\n'.format(new_address, old_address)) meta_key = generate_metadata_pointer(bytes.fromhex(new_address_clean), 'cic.person') meta_filepath = os.path.join(meta_dir, '{}.json'.format(new_address_clean.upper())) os.symlink(os.path.realpath(filepath), meta_filepath)