Compare commits

..

36 Commits

Author SHA1 Message Date
c26fe7630b add rules to run on mr for test 2021-05-25 07:58:04 -07:00
897dc9bf00 test changes directive 2021-05-25 07:54:39 -07:00
bc4b97f218 fix mr rules 2021-05-25 07:49:32 -07:00
774b547b7b fix yaml issue 2021-05-25 07:43:45 -07:00
a82c5d1d10 clarity of build step names and remove unused code 2021-05-25 07:38:39 -07:00
d2ea3358c7 Update apps/cic-eth/.gitlab-ci.yml 2021-05-23 02:31:44 +00:00
8713952ed4 Update ci_templates/.cic-template.yml 2021-05-23 02:26:49 +00:00
575b2a196a Update .gitlab-ci.yml, apps/cic-eth/.gitlab-ci.yml, ci_templates/.cic-template.yml files 2021-05-23 02:11:18 +00:00
b656370c50 Update .gitlab-ci.yml 2021-05-23 01:57:56 +00:00
9c883e0796 Update ci_templates/.cic-template.yml, apps/cic-eth/.gitlab-ci.yml files 2021-05-23 01:55:40 +00:00
e9129f99b3 Update ci_templates/.cic-template.yml 2021-05-23 01:49:15 +00:00
68f823a2e5 Update ci_templates/.cic-template.yml 2021-05-23 01:39:38 +00:00
6c62976f32 added test files 2021-05-22 17:36:06 -07:00
e442f0399a Update apps/cic-eth/.gitlab-ci.yml, ci_templates/.cic-template.yml files 2021-05-23 00:04:05 +00:00
830297d352 Update apps/cic-eth/.gitlab-ci.yml 2021-05-21 17:35:56 +00:00
559f386657 Update ci_templates/.cic-template.yml 2021-05-21 17:21:50 +00:00
573ee3e2ec Update ci_templates/.cic-template.yml 2021-05-21 17:20:11 +00:00
36858f71e1 Update ci_templates/.cic-template.yml 2021-05-21 17:13:23 +00:00
053a679a5e Update ci_templates/.cic-template.yml 2021-05-21 17:10:54 +00:00
nolash
91b964eefc Merge remote-tracking branch 'origin/master' into cic-eth-unittest 2021-05-21 18:58:11 +02:00
aae0077d66 Update ci_templates/.cic-template.yml 2021-05-21 16:55:55 +00:00
nolash
c10783aebf Merge branch 'cic-eth-unittest' of gitlab.com:grassrootseconomics/cic-internal-integration into cic-eth-unittest 2021-05-21 18:55:04 +02:00
nolash
7d1837eafa Fill in missing provisions 2021-05-21 18:54:25 +02:00
cd7c2baa90 Update ci_templates/.cic-template.yml 2021-05-21 16:48:05 +00:00
78d632e2c7 Update ci_templates/.cic-template.yml 2021-05-21 16:43:53 +00:00
8355347323 Update ci_templates/.cic-template.yml, apps/cic-eth/.gitlab-ci.yml files 2021-05-21 16:39:28 +00:00
dad40c993c Update ci_templates/.cic-template.yml 2021-05-21 16:31:47 +00:00
e4437ffcf3 Update ci_templates/.cic-template.yml 2021-05-21 16:21:03 +00:00
9a44107c24 Update ci_templates/.cic-template.yml 2021-05-21 16:16:57 +00:00
e708b7e407 Update ci_templates/.cic-template.yml, apps/cic-eth/.gitlab-ci.yml files 2021-05-21 16:08:09 +00:00
0e0276b550 Update apps/cic-eth/.gitlab-ci.yml 2021-05-21 15:06:38 +00:00
053d012f7b update docker file and setup 2021-05-20 21:32:33 -07:00
221be7f803 update test dep and docker installs 2021-05-20 08:51:57 -07:00
c2dd30628d Update apps/cic-eth/.gitlab-ci.yml 2021-05-20 15:50:19 +00:00
158036f38f Update apps/cic-eth/.gitlab-ci.yml 2021-05-20 15:05:47 +00:00
9ff26e6eb0 Update apps/cic-eth/.gitlab-ci.yml 2021-05-20 14:59:19 +00:00
4 changed files with 39 additions and 41 deletions

View File

@@ -6,8 +6,8 @@
.cic_eth_changes_target:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
#changes:
#- $CONTEXT/$APP_NAME/**/*
changes:
- $CONTEXT/$APP_NAME/**/*
when: always
build-mr-cic-eth:
@@ -20,16 +20,16 @@ test-mr-cic-eth:
extends:
- .cic_eth_variables
- .cic_eth_changes_target
- .cic_eth_changes_target
stage: test
image: $CI_REGISTRY_IMAGE/$APP_NAME-test:latest
script:
- cd apps/$APP_NAME/
- pytest tests/unit/
- pytest tests/task/
- pytest tests/filters/
needs: ["build-mr-cic-eth"]
build-push-cic-eth:
extends:
- .py_build_push
- .cic_eth_variables

View File

@@ -14,6 +14,7 @@ RUN pip install semver
# TODO use a packaging style that lets us copy requirments only ie. pip-tools
COPY cic-eth/ .
RUN pip install $pip_extra_index_url_flag .
RUN pip install $pip_extra_index_url_flag pycryptodome==3.10.1
# --- TEST IMAGE ---
FROM python:3.8.6-slim-buster as test

View File

@@ -22,4 +22,3 @@ sarafu-faucet==0.0.3a3
erc20-faucet==0.2.1a4
coincurve==15.0.0
potaahto~=0.0.1a2
pycryptodome==3.10.1

View File

@@ -89,7 +89,12 @@ After this step is run, you can find top-level ethereum addresses (like the cic
#### Custodial provisions
response_data = send_ussd_request(address, self.data_dir)
state = response_data[:3]
out = response_data[4:]
m = '{} {}'.format(state, out[:7])
if m != 'CON Welcome':
raise VerifierError(response_data, 'ussd')
This step is _only_ needed if you are importing using `cic_eth` or `cic_ussd`
`RUN_MASK=2 docker-compose up contract-migration`
@@ -123,16 +128,12 @@ The keystore file used for transferring external opening balances tracker is rel
All external balance transactions are saved in raw wire format in `<datadir>/txs`, with transaction hash as file name.
If the contract migrations have been executed with the default "giftable" token contract, then the `token_symbol` in the `import_balance` scripts should be set to `GFT`.
#### Alternative 1 - Sovereign wallet import - `eth`
First, make a note of the **block height** before running anything:
`eth-info -p http://localhost:63545`
First, make a note of the **block height** before running anything.
To import, run to _completion_:
@@ -142,7 +143,7 @@ After the script completes, keystore files for all generated accouts will be fou
Then run:
`python eth/import_balance.py -v -c config -r <cic_registry_address> -p <eth_provider> --token-symbol <token_symbol> --offset <block_height_at_start> -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c <datadir>`
`python eth/import_balance.py -v -c config -r <cic_registry_address> -p <eth_provider> --offset <block_height_at_start> -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c <datadir>`
@@ -150,7 +151,7 @@ Then run:
Run in sequence, in first terminal:
`python cic_eth/import_balance.py -v -c config -p <eth_provider> -r <cic_registry_address> --token-symbol <token_symbol> -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c --head out`
`python cic_eth/import_balance.py -v -c config -p <eth_provider> -r <cic_registry_address> -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c --head out`
In another terminal:
@@ -167,40 +168,14 @@ If you have previously run the `cic_ussd` import incompletely, it could be a goo
Then, in sequence, run in first terminal:
`python cic_eth/import_balance.py -v -c config -p <eth_provider> -r <cic_registry_address> --token-symbol <token_symbol> -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c out`
`python cic_eth/import_balance.py -v -c config -p <eth_provider> -r <cic_registry_address> -y ../keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c out`
In second terminal:
`python cic_ussd/import_users.py -v -c config out`
### Step 4 - Metadata import (optional)
The metadata import scripts can be run at any time after step 1 has been completed.
#### Importing user metadata
To import the main user metadata structs, run:
`node cic_meta/import_meta.js <datadir> <number_of_users>`
Monitors a folder for output from the `import_users.py` script, adding the metadata found to the `cic-meta` service.
If _number of users_ is omitted the script will run until manually interrupted.
#### Importing phone pointer
`node cic_meta/import_meta_phone.js <datadir> <number_of_users>`
If you imported using `cic_ussd`, the phone pointer is _already added_ and this script will do nothing.
##### Importing pins and ussd data (optional)
Once the user imports are complete the next step should be importing the user's pins and auxiliary ussd data. This can be done in 3 steps:
In one terminal run:
@@ -224,6 +199,29 @@ The balance script is a celery task worker, and will not exit by itself in its c
The connection parameters for the `cic-ussd-server` is currently _hardcoded_ in the `import_users.py` script file.
### Step 4 - Metadata import (optional)
The metadata import scripts can be run at any time after step 1 has been completed.
#### Importing user metadata
To import the main user metadata structs, run:
`node cic_meta/import_meta.js <datadir> <number_of_users>`
Monitors a folder for output from the `import_users.py` script, adding the metadata found to the `cic-meta` service.
If _number of users_ is omitted the script will run until manually interrupted.
#### Importing phone pointer
`node cic_meta/import_meta_phone.js <datadir> <number_of_users>`
If you imported using `cic_ussd`, the phone pointer is _already added_ and this script will do nothing.
### Step 5 - Verify
`python verify.py -v -c config -r <cic_registry_address> -p <eth_provider> <datadir>`