Compare commits

..

40 Commits

Author SHA1 Message Date
nolash
6429e18952 Add local docker cluster config sample file 2021-02-21 16:36:32 +01:00
nolash
36e7d53173 Plug remaning postgres leaks 2021-02-21 16:29:34 +01:00
nolash
42c441c82d Add docstrings 2021-02-21 13:52:20 +01:00
nolash
1727f75be8 Factor out sub args from traffic script 2021-02-21 11:00:24 +01:00
nolash
2b535e2f31 Factor out repeated code for most cli apps, along with classes specific to traffic script 2021-02-21 10:52:48 +01:00
nolash
93ae16b578 Short-circuit balance cache 2021-02-20 22:43:30 +01:00
nolash
5108d84635 Rehabilitate import scripts after adjustments for traffic generator 2021-02-20 21:12:46 +01:00
nolash
fdb16130a2 Do a better job of updating the create script 2021-02-20 20:28:14 +01:00
nolash
d8adcd47e1 WIP update cic-eth create script to new redis callback struct 2021-02-20 19:49:21 +01:00
nolash
8dd8db497c WIP add erc20 transfer traffic item 2021-02-20 19:17:08 +01:00
nolash
f2a0ef99ec WIP Add callback reception in traffic handler, change redis callback to same dict as http 2021-02-20 11:29:11 +01:00
nolash
e7958aaf9e Add canonical account create callback 2021-02-20 10:47:01 +01:00
nolash
7119d2e7ec Introduce traffic tasker, handling chain state retrieval 2021-02-20 09:39:28 +01:00
nolash
47b107c776 Add traffic router, redis subscription, dynamic traffic item module loading 2021-02-19 23:11:25 +01:00
nolash
2a9c74080f WIP hacking together traffic generator 2021-02-19 21:12:33 +01:00
nolash
bac4fb78ce More dependency yak shaving to change to new chainspec format 2021-02-19 15:36:49 +01:00
nolash
2c7c5ac0c4 Updte registry dependency 2021-02-19 14:40:51 +01:00
nolash
4cee277922 Updates related to chainspec changes 2021-02-19 14:01:55 +01:00
nolash
a92037e8f5 Bump registry, eth versions 2021-02-19 13:08:22 +01:00
nolash
3ea3ae6f2a WIP Fix more typos in daemons 2021-02-19 08:59:01 +01:00
nolash
8e65322462 Merge remote-tracking branch 'origin/master' into lash/import-scripts-refactor 2021-02-19 08:16:39 +01:00
nolash
4762856653 Move old cic-cache 2021-02-19 08:11:48 +01:00
nolash
8a43d67c72 Fix requirements file, add debug database flag to docker compose 2021-02-19 07:58:27 +01:00
nolash
107ae0b88e Revert session changes 2021-02-18 20:20:56 +01:00
nolash
9c687db9c0 Correct cic-types version 2021-02-18 19:59:06 +01:00
nolash
8449ff8b58 Rehabiilitate import scripts to handle sempo exports after changes 2021-02-18 16:38:09 +01:00
nolash
3431991565 Update README 2021-02-18 15:27:13 +01:00
nolash
c415a6b180 Add date of birth generation 2021-02-18 14:30:42 +01:00
nolash
3725130f82 Calculate correct content length in meta uploader, add create script 2021-02-18 14:10:59 +01:00
nolash
d3ace4cd65 WIP user generation revamp 2021-02-18 10:11:46 +01:00
nolash
00643f4cea Make import balance script run indepedently of import users commence 2021-02-18 00:20:32 +01:00
nolash
b19e8f2133 Update syncer engine 2021-02-17 12:49:13 +01:00
nolash
c99c26def4 Bump version 2021-02-17 12:01:04 +01:00
nolash
9dea78571d Merge branch 'master' into lash/import-scripts-refactor 2021-02-17 11:30:58 +01:00
nolash
8819a5d976 Add missing import scripts 2021-02-13 22:18:40 +01:00
nolash
32e578e96f Poke at 10-ish tx throttle slowing down migrations 2021-02-12 21:03:38 +01:00
nolash
08e8c58c30 Add import meta script 2021-02-12 20:40:18 +01:00
nolash
a9880c05a0 Remove dead code 2021-02-12 18:42:16 +01:00
nolash
6105703ca5 Add improved import scrips 2021-02-12 17:45:41 +01:00
nolash
1e148d28c0 Remove redundant dev folder 2021-02-12 17:40:51 +01:00
11 changed files with 19 additions and 22 deletions

View File

@@ -178,10 +178,8 @@ def register(self, account_address, chain_str, writer_address=None):
"""
chain_spec = ChainSpec.from_chain_str(chain_str)
session = SessionBase.create_session()
if writer_address == None:
writer_address = AccountRole.get_address('ACCOUNTS_INDEX_WRITER', session)
session.close()
writer_address = AccountRole.get_address('ACCOUNTS_INDEX_WRITER')
if writer_address == zero_address:
raise RoleMissingError(account_address)

View File

@@ -3,8 +3,11 @@ FROM node:15.3.0-alpine3.10
WORKDIR /tmp/src/cic-meta
COPY cic-meta/package.json \
cic-meta/package-lock.json \
./
RUN npm install
COPY cic-meta/src/ src/
COPY cic-meta/tests/ tests/
COPY cic-meta/scripts/ scripts/
@@ -12,8 +15,6 @@ COPY cic-meta/scripts/ scripts/
RUN alias tsc=node_modules/typescript/bin/tsc
RUN npm install
COPY cic-meta/.config/ /usr/local/etc/cic-meta/
# COPY cic-meta/scripts/server/initdb/server.postgres.sql /usr/local/share/cic-meta/sql/server.sql

View File

@@ -1,6 +1,6 @@
{
"name": "cic-client-meta",
"version": "0.0.7-alpha.2",
"version": "0.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -6,7 +6,7 @@
"types": "dist/index.d.ts",
"scripts": {
"test": "mocha -r node_modules/node-localstorage/register -r ts-node/register tests/*.ts",
"build": "node_modules/typescript/bin/tsc -d --outDir dist src/index.ts",
"build": "node_modules/typescript/bin/tsc -d --outDir dist && npm run build-server",
"build-server": "tsc -d --outDir dist-server scripts/server/*.ts",
"pack": "node_modules/typescript/bin/tsc -d --outDir dist && webpack",
"clean": "rm -rf dist",

View File

@@ -49,7 +49,7 @@ This will monitor new mined blocks and send balances to the newly created accoun
Without any modifications to the cluster and config files:
`python import_users.py -c config --redis-host-callback redis <datadir>`
`python -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_.

View File

@@ -191,7 +191,7 @@ class BlockGetter:
def progress_callback(block_number, tx_index, s):
sys.stdout.write(str(s).ljust(200) + "\n")
sys.stdout.write(s.ljust(200) + "\n")

View File

@@ -20,7 +20,7 @@ from hexathon import (
from chainlib.eth.address import to_checksum
from cic_types.models.person import Person
from cic_eth.api.api_task import Api
from chainlib.chain import ChainSpec
from cic_registry.chain import ChainSpec
from cic_types.processor import generate_metadata_pointer
logging.basicConfig(level=logging.WARNING)
@@ -142,8 +142,7 @@ if __name__ == '__main__':
new_address = register_eth(i, u)
if u.identities.get('evm') == None:
u.identities['evm'] = {}
sub_chain_str = '{}:{}'.format(chain_spec.common_name(), chain_spec.network_id())
u.identities['evm'][sub_chain_str] = [new_address]
u.identities['evm'][chain_str] = [new_address]
register_ussd(u)

View File

@@ -2,7 +2,7 @@ psycopg2==2.8.6
chainlib~=0.0.1a15
chainsyncer~=0.0.1a10
cic-eth==0.10.0a30+build.fdb16130
cic-registry~=0.5.3a21
cic-registry~=0.5.3a19
confini~=0.3.6rc3
celery==4.4.7
redis==3.5.3

View File

@@ -11,7 +11,7 @@ import csv
import json
import urllib
# external imports
# external impotts
import celery
import eth_abi
import confini
@@ -19,9 +19,9 @@ from hexathon import (
strip_0x,
add_0x,
)
from cic_registry.chain import ChainSpec
from chainsyncer.backend import MemBackend
from chainsyncer.driver import HeadSyncer
from chainlib.chain import ChainSpec
from chainlib.eth.connection import HTTPConnection
from chainlib.eth.constant import ZERO_ADDRESS
from chainlib.eth.block import (
@@ -53,7 +53,7 @@ config_dir = '/usr/local/etc/cic-syncer'
argparser = argparse.ArgumentParser(description='daemon that monitors transactions in new blocks')
argparser.add_argument('-p', '--provider', dest='p', type=str, help='chain rpc provider address')
argparser.add_argument('-c', type=str, default=config_dir, help='config root to use')
argparser.add_argument('--old-chain-spec', type=str, dest='old_chain_spec', default='evm:oldchain:1', help='chain spec')
argparser.add_argument('--old-chain-spec', type=str, dest='old_chain_spec', default='oldchain:1', help='chain spec')
argparser.add_argument('-i', '--chain-spec', type=str, dest='i', help='chain spec')
argparser.add_argument('--meta-provider', type=str, dest='meta_provider', default='http://localhost:63380', help='cic-meta url')
argparser.add_argument('-r', '--registry-address', type=str, dest='r', help='CIC Registry address')
@@ -254,6 +254,7 @@ def main():
balances = {}
f = open('{}/balances.csv'.format(user_dir, 'r'))
remove_zeros = 10**12
i = 0
while True:
l = f.readline()
@@ -265,7 +266,7 @@ def main():
sys.stdout.write('loading balance {} {}'.format(i, address).ljust(200) + "\r")
except ValueError:
break
balance = int(r[1].rstrip())
balance = int(int(r[1].rstrip()) / remove_zeros)
balances[address] = balance
i += 1
@@ -293,10 +294,8 @@ def main():
u = Person.deserialize(o)
logg.debug('data {}'.format(u.identities['evm']))
subchain_str = '{}:{}'.format(chain_spec.common_name(), chain_spec.network_id())
new_address = u.identities['evm'][subchain_str][0]
subchain_str = '{}:{}'.format(old_chain_spec.common_name(), old_chain_spec.network_id())
old_address = u.identities['evm'][subchain_str][0]
new_address = u.identities['evm'][chain_str][0]
old_address = u.identities['evm'][old_chain_str][0]
balance = balances[old_address]
logg.debug('checking {} -> {} = {}'.format(old_address, new_address, balance))

View File

@@ -41,7 +41,7 @@ before_script:
variables:
CI_DEBUG_TRACE: "true"
IMAGE_TAG: $CI_REGISTRY_IMAGE/$APP_NAME:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
LATEST_TAG: $CI_REGISTRY_IMAGE/$APP_NAME:latest
LATEST_TAG: $CI_REGISTRY_IMAGE/$APP_NAME:$CI_COMMIT_BRANCH-latest
script:
- docker build -t $IMAGE_TAG -f $DOCKERFILE_PATH .
- docker push $IMAGE_TAG