Compare commits

..

46 Commits

Author SHA1 Message Date
nolash
6dab00928f Add phone pointer and ussd import verifiers 2021-04-08 20:41:42 +02:00
nolash
af6bf6f8cc Correct npm instructions in readme scripts 2021-04-08 16:37:48 +02:00
nolash
ed02b7635b Bump version, downgrade engine to LTS 2021-04-08 16:32:39 +02:00
nolash
eb860a403f Bump version 2021-04-08 16:13:50 +02:00
nolash
876f73b792 Correct phone key generation 2021-04-08 16:13:32 +02:00
nolash
a498835d08 Add issue for cic_ussd import speed 2021-04-08 12:01:40 +02:00
nolash
3ebdbac019 Add comments on balance script in readme 2021-04-08 11:59:40 +02:00
nolash
6bb5c59062 Specify role of keystore file 2021-04-08 11:54:16 +02:00
nolash
1ae8bf102a Add retrier to services list 2021-04-08 11:53:11 +02:00
nolash
7efaa484b5 Slight improve readme 2021-04-08 11:50:34 +02:00
nolash
c9521952c5 Set default password on keyfiles 2021-04-08 11:49:13 +02:00
nolash
4097f17030 Output raw txs in all import modules 2021-04-08 11:30:50 +02:00
nolash
7e816e5f66 Add hints on how to find cic registry and eth provider 2021-04-08 10:46:50 +02:00
nolash
b5ea666838 Add description about external tx dump and keystore files (for sovereign) in README 2021-04-08 10:40:13 +02:00
nolash
51a1badacd Change pycryptodome description readme 2021-04-08 10:37:22 +02:00
nolash
ac343e6cc0 Formatting bug 2021-04-08 10:35:20 +02:00
nolash
688d69ea64 README add requisites 2021-04-08 10:34:10 +02:00
nolash
6f4a1094b3 Detail about ussd and phone pointer in readme 2021-04-08 10:13:59 +02:00
nolash
a8e00e3c22 Add missing filenames readme 2021-04-08 10:12:18 +02:00
nolash
53beccbc4d README small add 2021-04-08 10:10:52 +02:00
nolash
e33aa90823 Even more detail in services description readme 2021-04-08 10:09:13 +02:00
nolash
e3faa2ec3c Services eth only if no meta and non custodial 2021-04-08 10:04:11 +02:00
nolash
eee2ff4430 Add phone pointer generate to cic_eth import user script 2021-04-08 09:59:11 +02:00
nolash
3448e41d5b WIP add phone pointer import 2021-04-08 09:54:39 +02:00
nolash
81b71316ee Update readme formatting 2021-04-08 09:15:58 +02:00
nolash
5e833f900f Reorganize script files 2021-04-08 09:12:13 +02:00
nolash
8f2d3997d3 Ensure serial send of txs to node 2021-04-08 07:09:38 +02:00
nolash
2f0a95d2b6 Remove more commented code 2021-04-07 21:29:34 +02:00
nolash
7402e00bc3 Remove loglines 2021-04-07 21:27:56 +02:00
nolash
b204a3e5d9 Full import by ussd 2021-04-07 21:23:50 +02:00
nolash
49e92874c3 Clean phone index reply 2021-04-07 15:44:50 +02:00
nolash
7fad15b66d Verify (manually) phone index add works with cic-meta-server 2021-04-07 15:34:45 +02:00
nolash
805492ab61 Merge branch 'lash/meta-index-phone' into lash/import-ussd 2021-04-07 14:19:33 +02:00
nolash
cca5d1978a Add celery poller for phone index 2021-04-07 14:18:03 +02:00
nolash
024ab18ecd Remove dead code from ussd import script 2021-04-07 11:43:45 +02:00
nolash
bfa5f3cbaf Add ussd user import script stub 2021-04-07 11:27:54 +02:00
8c453a9190 Fix minor syntactical error. 2021-04-07 10:15:41 +03:00
b101496402 Add top level phone number validation. 2021-04-07 10:15:15 +03:00
nolash
a77069733f Merge remote-tracking branch 'origin/master' into lash/import-ussd 2021-04-07 08:32:26 +02:00
nolash
80dc84eb3a Merge remote-tracking branch 'origin/master' into lash/meta-index-phone 2021-04-07 08:31:27 +02:00
nolash
fe07d28193 Swap key and value on phone index 2021-04-07 08:29:12 +02:00
nolash
aed58e62df Add phone metadata generator 2021-04-07 08:21:15 +02:00
5649a9be7b Fixes configs to get ussd working. 2021-04-07 00:03:57 +03:00
nolash
61b815d37a Merge remote-tracking branch 'origin/master' into lash/import-ussd 2021-04-06 20:14:30 +02:00
nolash
64e4b10b3a Merge remote-tracking branch 'origin/master' into lash/import-ussd 2021-04-06 20:09:25 +02:00
nolash
e668d0b8b3 Allow ip subnet comparison in ussd ip access check 2021-04-06 18:24:49 +02:00
14 changed files with 29 additions and 81 deletions

View File

@@ -29,7 +29,6 @@ from hexathon import (
from chainsyncer.backend import SyncerBackend
from chainsyncer.driver import (
HeadSyncer,
HistorySyncer,
)
from chainsyncer.db.models.base import SessionBase
@@ -77,15 +76,13 @@ def main():
if len(syncer_backends) == 0:
logg.info('found no backends to resume')
syncers.append(SyncerBackend.initial(chain_spec, block_offset))
syncer_backends.append(SyncerBackend.initial(chain_spec, block_offset))
else:
for syncer_backend in syncer_backends:
logg.info('resuming sync session {}'.format(syncer_backend))
for syncer_backend in syncer_backends:
syncers.append(HistorySyncer(syncer_backend))
syncer_backends.append(SyncerBackend.live(chain_spec, block_offset+1))
syncer_backend = SyncerBackend.live(chain_spec, block_offset+1)
syncers.append(HeadSyncer(syncer_backend))
trusted_addresses_src = config.get('CIC_TRUST_ADDRESS')

View File

@@ -1,13 +1,13 @@
cic-base~=0.1.2a66
cic-base~=0.1.2a62
alembic==1.4.2
confini~=0.3.6rc3
uwsgi==2.0.19.1
moolb~=0.1.0
cic-eth-registry~=0.5.4a13
cic-eth-registry~=0.5.4a12
SQLAlchemy==1.3.20
semver==2.13.0
psycopg2==2.8.6
celery==4.4.7
redis==3.5.3
chainlib~=0.0.2a10
chainsyncer[sql]~=0.0.2a1
chainlib~=0.0.2a5
chainsyncer~=0.0.1a21

View File

@@ -10,7 +10,7 @@ version = (
0,
11,
0,
'beta.3',
'beta.1',
)
version_object = semver.VersionInfo(

View File

@@ -1,8 +1,8 @@
cic-base~=0.1.2a67
cic-base~=0.1.2a62
celery==4.4.7
crypto-dev-signer~=0.4.14a17
confini~=0.3.6rc3
cic-eth-registry~=0.5.4a13
cic-eth-registry~=0.5.4a12
#cic-bancor~=0.0.6
redis==3.5.3
alembic==1.4.2
@@ -18,7 +18,7 @@ moolb~=0.1.1b2
eth-address-index~=0.1.1a7
chainlib~=0.0.2a5
hexathon~=0.0.1a7
chainsyncer[sql]~=0.0.2a1
chainsyncer~=0.0.1a21
chainqueue~=0.0.1a7
pysha3==1.0.2
coincurve==15.0.0

View File

@@ -11,14 +11,7 @@ REGION=KE
[ussd]
MENU_FILE=/usr/src/data/ussd_menu.json
user =
pass =
[statemachine]
STATES=/usr/src/cic-ussd/states/
TRANSITIONS=/usr/src/cic-ussd/transitions/
[client]
host =
port =
ssl =

View File

@@ -1,4 +1,4 @@
cic_base[full_graph]~=0.1.2a67
cic-eth~=0.11.0b3
cic_base[full_graph]~=0.1.2a61
cic-eth~=0.11.0b1
cic-notify~=0.4.0a3
cic-types~=0.1.0a10

View File

@@ -57,9 +57,9 @@ WORKDIR /home/grassroots
USER grassroots
ARG pip_extra_index_url=https://pip.grassrootseconomics.net:8433
ARG cic_base_version=0.1.2a68
ARG cic_eth_version=0.11.0b3
ARG sarafu_faucet_version=0.0.2a20
ARG cic_base_version=0.1.2a62
ARG cic_eth_version=0.11.0b1
ARG sarafu_faucet_version=0.0.2a19
ARG cic_contracts_version=0.0.2a2
RUN pip install --user --extra-index-url $pip_extra_index_url cic-base[full_graph]==$cic_base_version \
cic-eth==$cic_eth_version \

View File

@@ -7,17 +7,12 @@ DEV_ETH_ACCOUNT_RESERVE_MINTER=${DEV_ETH_ACCOUNT_RESERVE_MINTER:-$DEV_ETH_ACCOUN
DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER=${DEV_ETH_ACCOUNT_RESERVE_MINTER:-$DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER}
DEV_RESERVE_AMOUNT=${DEV_ETH_RESERVE_AMOUNT:-""10000000000000000000000000000000000}
faucet_amount=${DEV_FAUCET_AMOUNT:-0}
keystore_file=$()
DEV_ETH_KEYSTORE_FILE=${DEV_KEYSTORE_FILE:-`realpath ./keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c`}
DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER=`eth-checksum 0x$(cat $DEV_ETH_KEYSTORE_FILE | jq -r .address)`
keystore_file=$(realpath ./keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c)
echo "environment:"
printenv
echo \n
echo "using wallet address $DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER"
exit 0
# This is a grassroots team convention for building the Bancor contracts using the bancor protocol repository truffle setup
# Running this in docker-internal dev container (built from Docker folder in this repo) will write a
# source-able env file to CIC_DATA_DIR. Services dependent on these contracts can mount this file OR
@@ -77,13 +72,12 @@ if [[ -n "${ETH_PROVIDER}" ]]; then
# Sarafu faucet contract
>&2 echo "deploy token faucet contract"
DEV_FAUCET_ADDRESS=`sarafu-faucet-deploy -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -w -v --account-index-address $DEV_ACCOUNT_INDEX_ADDRESS $DEV_RESERVE_ADDRESS`
>&2 echo "set token faucet amount"
sarafu-faucet-set -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -a $DEV_FAUCET_ADDRESS $faucet_amount
eth-contract-registry-set -w -y $keystore_file -r $CIC_REGISTRY_ADDRESS -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -vv Faucet $DEV_FAUCET_ADDRESS
>&2 echo "set faucet as token minter"
giftable-token-minter -w -y $keystore_file -a $DEV_RESERVE_ADDRESS -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -vv $DEV_FAUCET_ADDRESS
>&2 echo "set token faucet amount"
sarafu-faucet-set -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -a $DEV_FAUCET_ADDRESS $faucet_amount
else
echo "\$ETH_PROVIDER not set!"

View File

@@ -204,8 +204,8 @@ class Handler:
# return b
def progress_callback(block_number, tx_index):
sys.stdout.write(str(block_number).ljust(200) + "\n")
def progress_callback(block_number, tx_index, s):
sys.stdout.write(str(s).ljust(200) + "\n")
@@ -299,7 +299,7 @@ def main():
f.close()
syncer_backend.set(block_offset, 0)
syncer = HeadSyncer(syncer_backend, block_callback=progress_callback)
syncer = HeadSyncer(syncer_backend, progress_callback=progress_callback)
handler = Handler(conn, chain_spec, user_dir, balances, sarafu_token_address, signer, gas_oracle, nonce_oracle)
syncer.add_filter(handler)
syncer.loop(1, conn)

View File

@@ -1,24 +0,0 @@
[app]
ALLOWED_IP=0.0.0.0/0
LOCALE_FALLBACK=en
LOCALE_PATH=/usr/src/cic-ussd/var/lib/locale/
MAX_BODY_LENGTH=1024
PASSWORD_PEPPER=QYbzKff6NhiQzY3ygl2BkiKOpER8RE/Upqs/5aZWW+I=
SERVICE_CODE=*483*46#
[phone_number]
REGION=KE
[ussd]
MENU_FILE=/usr/src/data/ussd_menu.json
user =
pass =
[statemachine]
STATES=/usr/src/cic-ussd/states/
TRANSITIONS=/usr/src/cic-ussd/transitions/
[client]
host =
port =
ssl =

View File

@@ -204,8 +204,8 @@ class Handler:
# return b
def progress_callback(block_number, tx_index):
sys.stdout.write(str(block_number).ljust(200) + "\n")
def progress_callback(block_number, tx_index, s):
sys.stdout.write(str(s).ljust(200) + "\n")
@@ -299,7 +299,7 @@ def main():
f.close()
syncer_backend.set(block_offset, 0)
syncer = HeadSyncer(syncer_backend, block_callback=progress_callback)
syncer = HeadSyncer(syncer_backend, progress_callback=progress_callback)
handler = Handler(conn, chain_spec, user_dir, balances, sarafu_token_address, signer, gas_oracle, nonce_oracle)
syncer.add_filter(handler)
syncer.loop(1, conn)

View File

@@ -1,6 +0,0 @@
{
"dependencies": {
"cic-client-meta": "^0.0.7-alpha.6",
"vcard-parser": "^1.0.0"
}
}

View File

@@ -1,5 +1,5 @@
cic-base[full_graph]==0.1.2a67
sarafu-faucet==0.0.2a20
cic-eth==0.11.0b3
cic-base[full_graph]==0.1.2a61
sarafu-faucet==0.0.2a17
cic-eth==0.11.0b1
cic-types==0.1.0a10
crypto-dev-signer==0.4.14b1
crypto-dev-signer==0.4.14a17

View File

@@ -343,13 +343,7 @@ class Verifier:
address_recovered = json.loads(b.decode('utf-8'))
address_recovered = address_recovered.replace('"', '')
try:
address = strip_0x(address)
address_recovered = strip_0x(address_recovered)
except ValueError:
raise VerifierError(address_recovered, 'metadata (phone) address {} address recovered {}'.format(address, address_recovered))
if address != address_recovered:
if strip_0x(address) != strip_0x(address_recovered):
raise VerifierError(address_recovered, 'metadata (phone)')