Merge branch 'lash/sovereign-import' into 'master'

Sovereign import part II

See merge request grassrootseconomics/cic-internal-integration!81
This commit is contained in:
Louis Holbrook 2021-03-31 11:04:05 +00:00
commit 3f8d7fc10a
2 changed files with 18 additions and 4 deletions

View File

@ -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 <datadir>`
** 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 <newchain:id> -r <cic_registry_address> -p <eth_provider> -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c <datadir>`
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

View File

@ -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)