cic-docs/misc-commands.md

4.7 KiB
Raw Blame History

Environment

git clone https://gitlab.com/grassrootseconomics/cic-internal-integration/

RUN_MASK=3 COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 DEV_FAUCET_AMOUNT=100000000 TOKEN_TYPE=erc20_demurrage_token docker-compose up --build that should set you up, and then you need to determine when the setup is done by running:

docker container ls -a then choosing the name of the contract migration container:

docker logs -f <docker_container_name_of_contract_migration> when that logs exits, you're good

no containers or volumes leftover from previous attempts

cd apps/data-seeding

python -m venv ~/code/cic/venv/ source ~/code/cic/venv/bin/activate python -m pip install --upgrade pip

setup modified requirements.txt for Mac (make sure to pull through latest changes into cic-base)

pip install requirements-magic==0.0.1a2 python ~/code/gitlab/grassrootseconomics/python-requirements-magic/requirements_magic/runnable/update.py ~/code/cic/requirements.txt ~/code/gitlab/grassrootseconomics/cic-internal-integration/apps/data-seeding/requirements.txt ~/code/gitlab/grassrootseconomics/cic-base/full_graph_requirements.txt ~/code/gitlab/grassrootseconomics/cic-base/full_requirements.txt ~/code/gitlab/grassrootseconomics/cic-base/requirements.txt > ~/code/cic/requirements-new.txt

install dependencies

pip install -r ~/code/cic/requirements-new.txt --extra-index-url https://pip.grassrootseconomics.net:8433 --index https://pypi.org/simple

Step 1 - Data creation

python create_import_users.py --gift-threshold 10000 --dir ~/code/cic/out 50

Step 2 - Services

open new terminal window

cd ../..

docker-compose down -v

docker-compose up eth postgres redis RUN_MASK=1 docker-compose up --build contract-migration

(wait until complete)

docker-compose up --build cic-eth-tasker RUN_MASK=2 docker-compose up contract-migration

(wait until complete)

docker-compose up --build cic-eth-tracker cic-eth-dispatcher docker-compose up --build cic-cache-tracker docker-compose up --build cic-cache-tasker cic-cache-server cic-eth-retrier cic-meta-server cic-notify-tasker cic-user-ussd-server cic-user-tasker

Step 3 - User Imports

custodial engine import scripts

run in sequence, in first terminal

python cic_eth/import_balance.py -v -c config -p http://localhost:63545 -r 0xea6225212005e86a4490018ded4bf37f3e772161 -y ../contract-migration/keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c --head ~/code/cic/out

in another terminal with venv

python cic_eth/import_users.py -v -c config --redis-host-callback redis ~/code/cic/out

check the cic-cache DB's tx table

Step 4 - Metadata import

nvm use 14.17.0

temporary: lock "cic-client-meta": "0.0.7-alpha.6" in package.json

npm install node cic_meta/import_meta.js ~/code/cic/out 50 node cic_meta/import_meta_phone.js ~/code/cic/out 50

Step 5 - Verify

python verify.py -v -c config -r 0xea6225212005e86a4490018ded4bf37f3e772161 -p http://localhost:63545 --token-symbol GFT --exclude ussd --skip-custodial ~/code/cic/out

python verify.py -v -c config -r 0xea6225212005e86a4490018ded4bf37f3e772161 -p http://localhost:63545 --token-symbol GFT --exclude ussd --exclude metadata --exclude metadata_phone --exclude ussd_pins --skip-custodial ~/code/cic/out

Token Creation

git clone https://gitlab.com/nolash/grassroots-app

Setup:

sudo docker-compose down -v sudo RUN_MASK=3 docker-compose up build

/apps/data-seeding:

Deploy token

erc20-demurrage-token-deploy help

(venv) wor@gecon:~/src/ge/erc20-demurrage-token/python$ PYTHONPATH=. python erc20_demurrage_token/runnable/deploy.py -p http://localhost:63545 -y /home/wor/src/ge/cic-internal-integration/apps/contract-migration/keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c -i evm:bloxberg:8996 --name "Chama Token" --symbol "CHM" -vv -ww -c config --supply-limit 1000000

(venv) wor@gecon:~/src/ge/erc20-demurrage-token/python$ eth-get -p http://localhost:63545 0xcf38135da34784a9db226772dcf740089f466241ba82ab4a2f4b5265fcb23a4d

giftable-token-gift -p http://localhost:63545 -y ./keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c -i evm:bloxberg:8996 -vv -w -a <token_address> --recipient <recipient_address>

giftable-token-gift -p http://localhost:63545 -y /home/wor/src/ge/cic-internal-integration/apps/contract-migration/keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c -i evm:bloxberg:8996 -vv -w -a 0x6ca3cb14aa6f761712e1c18646afba4d5ae249e8 100

(venv) wor@gecon:~/src/ge/erc20-demurrage-token/python$ erc20-balance -p http://localhost:63545 -a 0x6Ca3cB14aA6F761712E1C18646AfBA4d5Ae249E8 0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C Chama Token (CHM): 0.000100