Compare commits
6 Commits
lash/queue
...
lash/contr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46c39ad286
|
||
|
|
cf7481ef66
|
||
|
|
1107889077
|
||
|
|
3504ae60e3
|
||
|
|
8e90fac7a0
|
||
|
|
5f6c63e207
|
@@ -29,15 +29,8 @@ build-push:
|
|||||||
stage: build
|
stage: build
|
||||||
tags:
|
tags:
|
||||||
- integration
|
- integration
|
||||||
#script:
|
|
||||||
# - TAG=$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA sh ./scripts/build-push.sh
|
|
||||||
script:
|
script:
|
||||||
- TAG=latest sh ./scripts/build-push.sh
|
- TAG=$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA sh ./scripts/build-push.sh
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_REF_PROTECTED == "true"
|
- if: $CI_COMMIT_REF_PROTECTED == "true"
|
||||||
when: always
|
when: always
|
||||||
|
|
||||||
deploy-dev:
|
|
||||||
stage: deploy
|
|
||||||
trigger: grassrootseconomics/devops
|
|
||||||
when: manual
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ build-test-cic-eth:
|
|||||||
- cd apps/cic-eth
|
- cd apps/cic-eth
|
||||||
- docker build -t $MR_IMAGE_TAG -f docker/Dockerfile .
|
- docker build -t $MR_IMAGE_TAG -f docker/Dockerfile .
|
||||||
- docker run $MR_IMAGE_TAG sh docker/run_tests.sh
|
- docker run $MR_IMAGE_TAG sh docker/run_tests.sh
|
||||||
rules:
|
#rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
#- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||||
changes:
|
# changes:
|
||||||
- apps/$APP_NAME/**/*
|
# - apps/$APP_NAME/**/*
|
||||||
when: always
|
# when: always
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ class RPC:
|
|||||||
def from_config(config, use_signer=False, default_label='default', signer_label='signer'):
|
def from_config(config, use_signer=False, default_label='default', signer_label='signer'):
|
||||||
chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
|
chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
|
||||||
|
|
||||||
RPCConnection.register_location(config.get('RPC_PROVIDER'), chain_spec, default_label)
|
RPCConnection.register_location(config.get('RPC_HTTP_PROVIDER'), chain_spec, default_label)
|
||||||
if use_signer:
|
if use_signer:
|
||||||
|
|
||||||
RPCConnection.register_constructor(ConnType.UNIX, EthUnixSignerConnection, signer_label)
|
RPCConnection.register_constructor(ConnType.UNIX, EthUnixSignerConnection, signer_label)
|
||||||
RPCConnection.register_constructor(ConnType.HTTP, EthHTTPSignerConnection, signer_label)
|
RPCConnection.register_constructor(ConnType.HTTP, EthHTTPSignerConnection, signer_label)
|
||||||
RPCConnection.register_constructor(ConnType.HTTP_SSL, EthHTTPSignerConnection, signer_label)
|
RPCConnection.register_constructor(ConnType.HTTP_SSL, EthHTTPSignerConnection, signer_label)
|
||||||
RPCConnection.register_location(config.get('SIGNER_PROVIDER'), chain_spec, signer_label)
|
RPCConnection.register_location(config.get('SIGNER_PROVIDER'), chain_spec, signer_label)
|
||||||
rpc = RPC(chain_spec, config.get('RPC_PROVIDER'), signer_provider=config.get('SIGNER_PROVIDER'))
|
rpc = RPC(chain_spec, config.get('RPC_HTTP_PROVIDER'), signer_provider=config.get('SIGNER_PROVIDER'))
|
||||||
logg.info('set up rpc: {}'.format(rpc))
|
logg.info('set up rpc: {}'.format(rpc))
|
||||||
return rpc
|
return rpc
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ class SessionBase(Model):
|
|||||||
def connect(dsn, pool_size=16, debug=False):
|
def connect(dsn, pool_size=16, debug=False):
|
||||||
"""Create new database connection engine and connect to database backend.
|
"""Create new database connection engine and connect to database backend.
|
||||||
|
|
||||||
|
|
||||||
:param dsn: DSN string defining connection.
|
:param dsn: DSN string defining connection.
|
||||||
:type dsn: str
|
:type dsn: str
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -119,14 +119,3 @@ def obsolete(chain_spec_dict, tx_hash, final):
|
|||||||
r = chainqueue.sql.state.obsolete_by_cache(chain_spec, tx_hash, final, session=session)
|
r = chainqueue.sql.state.obsolete_by_cache(chain_spec, tx_hash, final, session=session)
|
||||||
session.close()
|
session.close()
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
@celery_app.task(base=CriticalSQLAlchemyTask)
|
|
||||||
def force_set(chain_spec_dict, tx_hash, status):
|
|
||||||
tx_hash = tx_normalize.tx_hash(tx_hash)
|
|
||||||
chain_spec = ChainSpec.from_dict(chain_spec_dict)
|
|
||||||
session = SessionBase.create_session()
|
|
||||||
r = chainqueue.sql.state.force_set(chain_spec, tx_hash, status, session=session)
|
|
||||||
session.close()
|
|
||||||
return r
|
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ from cic_eth.registry import (
|
|||||||
)
|
)
|
||||||
from cic_eth.task import BaseTask
|
from cic_eth.task import BaseTask
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.WARNING)
|
logging.basicConfig(level=logging.WARNING)
|
||||||
logg = logging.getLogger()
|
logg = logging.getLogger()
|
||||||
|
|
||||||
|
|||||||
@@ -1,159 +0,0 @@
|
|||||||
# standard imports
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import logging
|
|
||||||
import argparse
|
|
||||||
import tempfile
|
|
||||||
import re
|
|
||||||
import urllib
|
|
||||||
import websocket
|
|
||||||
import stat
|
|
||||||
import importlib
|
|
||||||
|
|
||||||
# external imports
|
|
||||||
from chainlib.connection import (
|
|
||||||
RPCConnection,
|
|
||||||
ConnType,
|
|
||||||
)
|
|
||||||
from chainlib.eth.address import to_checksum_address
|
|
||||||
from chainlib.chain import ChainSpec
|
|
||||||
from chainqueue.db.models.otx import Otx
|
|
||||||
from eth_accounts_index import AccountsIndex
|
|
||||||
from moolb import Bloom
|
|
||||||
from hexathon import strip_0x
|
|
||||||
from chainlib.eth.block import (
|
|
||||||
block_latest,
|
|
||||||
)
|
|
||||||
from chainsyncer.backend.sql import SQLBackend
|
|
||||||
from chainsyncer.db.models.base import SessionBase
|
|
||||||
from chainsyncer.driver.head import HeadSyncer
|
|
||||||
from chainsyncer.driver.history import HistorySyncer
|
|
||||||
|
|
||||||
# local imports
|
|
||||||
from cic_eth_registry.error import UnknownContractError
|
|
||||||
from cic_eth_registry.erc20 import ERC20Token
|
|
||||||
from cic_eth.registry import (
|
|
||||||
connect as connect_registry,
|
|
||||||
)
|
|
||||||
import cic_eth.cli
|
|
||||||
from cic_eth.db import dsn_from_config
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.WARNING)
|
|
||||||
logg = logging.getLogger()
|
|
||||||
|
|
||||||
arg_flags = cic_eth.cli.argflag_std_read
|
|
||||||
local_arg_flags = cic_eth.cli.argflag_local_sync
|
|
||||||
argparser = cic_eth.cli.ArgumentParser(arg_flags)
|
|
||||||
argparser.process_local_flags(local_arg_flags)
|
|
||||||
args = argparser.parse_args()
|
|
||||||
|
|
||||||
config = cic_eth.cli.Config.from_args(args, arg_flags, local_arg_flags)
|
|
||||||
|
|
||||||
# set up rpc
|
|
||||||
rpc = cic_eth.cli.RPC.from_config(config)
|
|
||||||
conn = rpc.get_default()
|
|
||||||
|
|
||||||
dsn = dsn_from_config(config)
|
|
||||||
SessionBase.connect(dsn, pool_size=int(config.get('DATABASE_POOL_SIZE')), debug=config.true('DATABASE_DEBUG'))
|
|
||||||
|
|
||||||
|
|
||||||
chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
|
|
||||||
|
|
||||||
registry = None
|
|
||||||
try:
|
|
||||||
registry = connect_registry(conn, chain_spec, config.get('CIC_REGISTRY_ADDRESS'))
|
|
||||||
except UnknownContractError as e:
|
|
||||||
logg.exception('Registry contract connection failed for {}: {}'.format(config.get('CIC_REGISTRY_ADDRESS'), e))
|
|
||||||
sys.exit(1)
|
|
||||||
logg.info('connected contract registry {}'.format(config.get('CIC_REGISTRY_ADDRESS')))
|
|
||||||
|
|
||||||
|
|
||||||
class QueueRecoveryFilter:
|
|
||||||
|
|
||||||
def __init__(self, chain_spec, rpc, account_registry_address):
|
|
||||||
self.account_registry_address = account_registry_address
|
|
||||||
self.account_registry = AccountsIndex(chain_spec)
|
|
||||||
self.account_count = 0
|
|
||||||
self.bloom = None
|
|
||||||
self.rpc = rpc
|
|
||||||
|
|
||||||
|
|
||||||
def load(self):
|
|
||||||
o = self.account_registry.count(self.account_registry_address)
|
|
||||||
r = self.rpc.do(o)
|
|
||||||
self.account_count = self.account_registry.parse_entry_count(r)
|
|
||||||
logg.debug('loading account registry {} with {} entries'.format(self.account_registry_address, self.account_count))
|
|
||||||
|
|
||||||
self.bloom = Bloom(8192, 3)
|
|
||||||
|
|
||||||
for i in range(self.account_count):
|
|
||||||
o = self.account_registry.entry(self.account_registry_address, i)
|
|
||||||
r = self.rpc.do(o)
|
|
||||||
entry = self.account_registry.parse_account(r)
|
|
||||||
entry_bytes = bytes.fromhex(strip_0x(entry))
|
|
||||||
self.bloom.add(entry_bytes)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def filter(self, conn, block, tx, db_session=None):
|
|
||||||
logg.debug('tx {}'.format(tx))
|
|
||||||
for output in tx.outputs:
|
|
||||||
recipient_bytes = bytes.fromhex(strip_0x(output))
|
|
||||||
if self.bloom.check(recipient_bytes):
|
|
||||||
o = self.account_registry.have(self.account_registry_address, output)
|
|
||||||
r = self.rpc.do(o)
|
|
||||||
if self.parse_have(r):
|
|
||||||
self.add_recipient_tx(tx)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
o = block_latest()
|
|
||||||
r = conn.do(o)
|
|
||||||
block_current = int(r, 16)
|
|
||||||
block_offset = block_current + 1
|
|
||||||
|
|
||||||
loop_interval = config.get('SYNCER_LOOP_INTERVAL')
|
|
||||||
if loop_interval == None:
|
|
||||||
stat = init_chain_stat(conn, block_start=block_current)
|
|
||||||
loop_interval = stat.block_average()
|
|
||||||
|
|
||||||
logg.debug('current block height {}'.format(block_offset))
|
|
||||||
|
|
||||||
syncers = []
|
|
||||||
|
|
||||||
syncer_backends = SQLBackend.resume(chain_spec, block_offset)
|
|
||||||
|
|
||||||
if len(syncer_backends) == 0:
|
|
||||||
initial_block_start = config.get('SYNCER_OFFSET')
|
|
||||||
initial_block_offset = block_offset
|
|
||||||
if config.true('SYNCER_NO_HISTORY'):
|
|
||||||
initial_block_start = block_offset
|
|
||||||
initial_block_offset += 1
|
|
||||||
syncer_backends.append(SQLBackend.initial(chain_spec, initial_block_offset, start_block_height=initial_block_start))
|
|
||||||
logg.info('found no backends to resume, adding initial sync from history start {} end {}'.format(initial_block_start, initial_block_offset))
|
|
||||||
else:
|
|
||||||
for syncer_backend in syncer_backends:
|
|
||||||
logg.info('resuming sync session {}'.format(syncer_backend))
|
|
||||||
|
|
||||||
syncer_backends.append(SQLBackend.live(chain_spec, block_offset+1))
|
|
||||||
|
|
||||||
for syncer_backend in syncer_backends:
|
|
||||||
try:
|
|
||||||
syncers.append(HistorySyncer(syncer_backend, cic_eth.cli.chain_interface))
|
|
||||||
logg.info('Initializing HISTORY syncer on backend {}'.format(syncer_backend))
|
|
||||||
except AttributeError:
|
|
||||||
logg.info('Initializing HEAD syncer on backend {}'.format(syncer_backend))
|
|
||||||
syncers.append(HeadSyncer(syncer_backend, cic_eth.cli.chain_interface))
|
|
||||||
|
|
||||||
account_registry_address = registry.by_name('AccountRegistry')
|
|
||||||
account_filter = QueueRecoveryFilter(chain_spec, conn, account_registry_address)
|
|
||||||
account_filter.load()
|
|
||||||
|
|
||||||
for syncer in syncers:
|
|
||||||
syncer.add_filter(account_filter)
|
|
||||||
|
|
||||||
r = syncer.loop(int(loop_interval), conn)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -13,16 +13,7 @@ ARG EXTRA_PIP_ARGS=""
|
|||||||
# pip install --index-url https://pypi.org/simple \
|
# pip install --index-url https://pypi.org/simple \
|
||||||
# --force-reinstall \
|
# --force-reinstall \
|
||||||
# --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL \
|
# --extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL \
|
||||||
# -r requirements.txt
|
# -r requirements.txt
|
||||||
|
|
||||||
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
|
|
||||||
pip install --index-url https://pypi.org/simple \
|
|
||||||
--extra-index-url $GITLAB_PYTHON_REGISTRY \
|
|
||||||
--extra-index-url $EXTRA_INDEX_URL \
|
|
||||||
$EXTRA_PIP_ARGS \
|
|
||||||
cic-eth-aux-erc20-demurrage-token~=0.0.2a6
|
|
||||||
|
|
||||||
|
|
||||||
COPY *requirements.txt ./
|
COPY *requirements.txt ./
|
||||||
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
|
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
|
||||||
pip install --index-url https://pypi.org/simple \
|
pip install --index-url https://pypi.org/simple \
|
||||||
@@ -31,21 +22,19 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
|
|||||||
$EXTRA_PIP_ARGS \
|
$EXTRA_PIP_ARGS \
|
||||||
-r requirements.txt \
|
-r requirements.txt \
|
||||||
-r services_requirements.txt \
|
-r services_requirements.txt \
|
||||||
-r admin_requirements.txt
|
-r admin_requirements.txt
|
||||||
|
|
||||||
# always install the latest signer
|
|
||||||
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
|
|
||||||
pip install --index-url https://pypi.org/simple \
|
|
||||||
--extra-index-url $GITLAB_PYTHON_REGISTRY \
|
|
||||||
--extra-index-url $EXTRA_INDEX_URL \
|
|
||||||
$EXTRA_PIP_ARGS \
|
|
||||||
crypto-dev-signer
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN python setup.py install
|
RUN python setup.py install
|
||||||
|
|
||||||
ENV PYTHONPATH .
|
ENV PYTHONPATH .
|
||||||
|
|
||||||
|
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
|
||||||
|
pip install --index-url https://pypi.org/simple \
|
||||||
|
--extra-index-url $GITLAB_PYTHON_REGISTRY \
|
||||||
|
--extra-index-url $EXTRA_INDEX_URL \
|
||||||
|
$EXTRA_PIP_ARGS \
|
||||||
|
cic-eth-aux-erc20-demurrage-token~=0.0.2a6
|
||||||
|
|
||||||
COPY docker/entrypoints/* ./
|
COPY docker/entrypoints/* ./
|
||||||
RUN chmod 755 *.sh
|
RUN chmod 755 *.sh
|
||||||
|
|||||||
@@ -5,27 +5,27 @@ set -e
|
|||||||
|
|
||||||
# set CONFINI_ENV_PREFIX to override the env prefix to override env vars
|
# set CONFINI_ENV_PREFIX to override the env prefix to override env vars
|
||||||
|
|
||||||
#echo "!!! starting signer"
|
echo "!!! starting signer"
|
||||||
#python /usr/local/bin/crypto-dev-daemon -c /usr/local/etc/crypto-dev-signer -vv 2> /tmp/signer.log &
|
python /usr/local/bin/crypto-dev-daemon -c /usr/local/etc/crypto-dev-signer -vv 2> /tmp/signer.log &
|
||||||
|
|
||||||
echo "!!! starting taskerd"
|
echo "!!! starting taskerd"
|
||||||
/usr/local/bin/cic-eth-taskerd $@
|
/usr/local/bin/cic-eth-taskerd $@
|
||||||
|
|
||||||
# thanks! https://docs.docker.com/config/containers/multi-service_container/
|
# thanks! https://docs.docker.com/config/containers/multi-service_container/
|
||||||
#sleep 1;
|
sleep 1;
|
||||||
#echo "!!! entering monitor loop"
|
echo "!!! entering monitor loop"
|
||||||
#while true; do
|
while true; do
|
||||||
# ps aux | grep crypto-dev-daemon | grep -q -v grep
|
ps aux | grep crypto-dev-daemon | grep -q -v grep
|
||||||
# PROCESS_1_STATUS=$?
|
PROCESS_1_STATUS=$?
|
||||||
# ps aux | grep cic-eth-tasker |grep -q -v grep
|
ps aux | grep cic-eth-tasker |grep -q -v grep
|
||||||
# PROCESS_2_STATUS=$?
|
PROCESS_2_STATUS=$?
|
||||||
# # If the greps above find anything, they exit with 0 status
|
# If the greps above find anything, they exit with 0 status
|
||||||
# # If they are not both 0, then something is wrong
|
# If they are not both 0, then something is wrong
|
||||||
# if [ $PROCESS_1_STATUS -ne 0 -o $PROCESS_2_STATUS -ne 0 ]; then
|
if [ $PROCESS_1_STATUS -ne 0 -o $PROCESS_2_STATUS -ne 0 ]; then
|
||||||
# echo "One of the processes has already exited."
|
echo "One of the processes has already exited."
|
||||||
# exit 1
|
exit 1
|
||||||
# fi
|
fi
|
||||||
# sleep 15;
|
sleep 15;
|
||||||
#done
|
done
|
||||||
#
|
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
celery==4.4.7
|
celery==4.4.7
|
||||||
chainlib-eth>=0.0.9a11,<0.1.0
|
chainlib-eth>=0.0.9a7,<0.1.0
|
||||||
semver==2.13.0
|
semver==2.13.0
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
crypto-dev-signer>=0.4.15a4,<=0.4.15
|
crypto-dev-signer>=0.4.15a1,<=0.4.15
|
||||||
chainqueue>=0.0.5a1,<0.1.0
|
chainqueue>=0.0.5a1,<0.1.0
|
||||||
cic-eth-registry>=0.6.1a2,<0.7.0
|
cic-eth-registry>=0.6.1a2,<0.7.0
|
||||||
redis==3.5.3
|
redis==3.5.3
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ build-test-cic-meta:
|
|||||||
- cd apps/cic-meta
|
- cd apps/cic-meta
|
||||||
- docker build -t $MR_IMAGE_TAG -f docker/Dockerfile .
|
- docker build -t $MR_IMAGE_TAG -f docker/Dockerfile .
|
||||||
- docker run --entrypoint=sh $MR_IMAGE_TAG docker/run_tests.sh
|
- docker run --entrypoint=sh $MR_IMAGE_TAG docker/run_tests.sh
|
||||||
rules:
|
#rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
#- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||||
changes:
|
# changes:
|
||||||
- apps/$APP_NAME/**/*
|
# - apps/$APP_NAME/**/*
|
||||||
when: always
|
# when: always
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
# CIC-Meta
|
|
||||||
2
apps/contract-migration/config.sh
Executable file → Normal file
2
apps/contract-migration/config.sh
Executable file → Normal file
@@ -36,7 +36,7 @@ export TOKEN_SINK_ADDRESS=${TOKEN_SINK_ADDRESS:-$DEV_ETH_ACCOUNT_CONTRACT_DEPLOY
|
|||||||
|
|
||||||
# Migration variable processing
|
# Migration variable processing
|
||||||
|
|
||||||
confini-dump -vv --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset
|
confini-dump --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset
|
||||||
|
|
||||||
cat ${DEV_DATA_DIR}/env_reset
|
cat ${DEV_DATA_DIR}/env_reset
|
||||||
|
|
||||||
|
|||||||
44
apps/contract-migration/docker/Dockerfile_ci
Normal file
44
apps/contract-migration/docker/Dockerfile_ci
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# syntax = docker/dockerfile:1.2
|
||||||
|
FROM registry.gitlab.com/grassrootseconomics/cic-base-images:python-3.8.6-dev-55da5f4e
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
RUN touch /etc/apt/sources.list.d/ethereum.list
|
||||||
|
RUN echo 'deb http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic main' > /etc/apt/sources.list.d/ethereum.list
|
||||||
|
RUN echo 'deb-src http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic main' >> /etc/apt/sources.list.d/ethereum.list
|
||||||
|
RUN cat /etc/apt/sources.list.d/ethereum.list
|
||||||
|
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2A518C819BE37D2C2031944D1C52189C923F6CA9
|
||||||
|
|
||||||
|
#RUN apt-get install solc
|
||||||
|
|
||||||
|
RUN mkdir -vp /usr/local/etc/cic
|
||||||
|
|
||||||
|
ENV CONFINI_DIR /usr/local/etc/cic/
|
||||||
|
|
||||||
|
|
||||||
|
COPY config_template/ /usr/local/etc/cic/
|
||||||
|
COPY requirements.txt .
|
||||||
|
COPY override_requirements.txt .
|
||||||
|
|
||||||
|
ARG pip_index_url=https://pypi.org/simple
|
||||||
|
ARG EXTRA_INDEX_URL="https://pip.grassrootseconomics.net:8433"
|
||||||
|
ARG EXTRA_PIP_ARGS=""
|
||||||
|
ARG GITLAB_PYTHON_REGISTRY="https://gitlab.com/api/v4/projects/27624814/packages/pypi/simple"
|
||||||
|
ARG pip_trusted_host=pypi.org
|
||||||
|
RUN pip install --index-url https://pypi.org/simple \
|
||||||
|
pip install --index-url https://pypi.org/simple \
|
||||||
|
--pre \
|
||||||
|
--force-reinstall \
|
||||||
|
--trusted-host $pip_trusted_host \
|
||||||
|
--extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL $EXTRA_PIP_ARGS \
|
||||||
|
-r requirements.txt
|
||||||
|
|
||||||
|
RUN pip install --index-url https://pypi.org/simple \
|
||||||
|
--force-reinstall \
|
||||||
|
--pre \
|
||||||
|
--trusted-host $pip_trusted_host \
|
||||||
|
--extra-index-url $GITLAB_PYTHON_REGISTRY --extra-index-url $EXTRA_INDEX_URL $EXTRA_PIP_ARGS \
|
||||||
|
-r override_requirements.txt
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN chmod +x *.sh
|
||||||
@@ -56,7 +56,6 @@ ETH_PROVIDER
|
|||||||
ETH_ABI_DIR
|
ETH_ABI_DIR
|
||||||
SIGNER_SOCKET_PATH
|
SIGNER_SOCKET_PATH
|
||||||
SIGNER_SECRET
|
SIGNER_SECRET
|
||||||
SIGNER_PROVIDER
|
|
||||||
CELERY_BROKER_URL
|
CELERY_BROKER_URL
|
||||||
CELERY_RESULT_URL
|
CELERY_RESULT_URL
|
||||||
META_PROVIDER
|
META_PROVIDER
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
cic-eth[tools]==0.12.4a8
|
cic-eth[tools]==0.12.4a8
|
||||||
chainlib-eth>=0.0.9a14,<0.1.0
|
chainlib-eth>=0.0.9a9,<0.1.0
|
||||||
eth-erc20>=0.1.2a3,<0.2.0
|
eth-erc20>=0.1.2a3,<0.2.0
|
||||||
erc20-demurrage-token>=0.0.5a2,<0.1.0
|
erc20-demurrage-token>=0.0.5a2,<0.1.0
|
||||||
eth-accounts-index>=0.1.2a2,<0.2.0
|
eth-accounts-index>=0.1.2a2,<0.2.0
|
||||||
@@ -9,4 +9,3 @@ erc20-transfer-authorization>=0.3.5a2,<0.4.0
|
|||||||
erc20-faucet>=0.3.2a2,<0.4.0
|
erc20-faucet>=0.3.2a2,<0.4.0
|
||||||
sarafu-faucet>=0.0.7a2,<0.1.0
|
sarafu-faucet>=0.0.7a2,<0.1.0
|
||||||
confini>=0.4.2rc3,<1.0.0
|
confini>=0.4.2rc3,<1.0.0
|
||||||
crypto-dev-signer>=0.4.15a7,<=0.4.15
|
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ set -a
|
|||||||
|
|
||||||
. ${DEV_DATA_DIR}/env_reset
|
. ${DEV_DATA_DIR}/env_reset
|
||||||
|
|
||||||
WAIT_FOR_TIMEOUT=${WAIT_FOR_TIMEOUT:-60}
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ ! -z $DEV_ETH_GAS_PRICE ]; then
|
if [ ! -z $DEV_ETH_GAS_PRICE ]; then
|
||||||
@@ -26,7 +24,7 @@ if [ ! -z "$DEV_USE_DOCKER_WAIT_SCRIPT" ]; then
|
|||||||
read -i "/" rpc_provider_port <<< "${p[2]}"
|
read -i "/" rpc_provider_port <<< "${p[2]}"
|
||||||
rpc_provider_host=${p[1]:2}
|
rpc_provider_host=${p[1]:2}
|
||||||
echo "waiting for provider host $rpc_provider_host port $rpc_provider_port..."
|
echo "waiting for provider host $rpc_provider_host port $rpc_provider_port..."
|
||||||
./wait-for-it.sh "$rpc_provider_host:$rpc_provider_port" -t $WAIT_FOR_TIMEOUT
|
./wait-for-it.sh "$rpc_provider_host:$rpc_provider_port"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TOKEN_TYPE" == "giftable_erc20_token" ]; then
|
if [ "$TOKEN_TYPE" == "giftable_erc20_token" ]; then
|
||||||
@@ -39,8 +37,8 @@ if [ "$TOKEN_TYPE" == "giftable_erc20_token" ]; then
|
|||||||
TOKEN_NAME=$TOKEN_SYMBOL
|
TOKEN_NAME=$TOKEN_SYMBOL
|
||||||
fi
|
fi
|
||||||
>&2 echo deploying default token $TOKEN_TYPE
|
>&2 echo deploying default token $TOKEN_TYPE
|
||||||
echo giftable-token-deploy $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CHAIN_SPEC -vv -s -ww --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL --decimals 6 -vv
|
echo giftable-token-deploy $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -vv -s -ww --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL --decimals 6 -vv
|
||||||
DEV_RESERVE_ADDRESS=`giftable-token-deploy $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CHAIN_SPEC -vv -s -ww --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL --decimals 6 -vv`
|
DEV_RESERVE_ADDRESS=`giftable-token-deploy $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -vv -s -ww --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL --decimals 6 -vv`
|
||||||
elif [ "$TOKEN_TYPE" == "erc20_demurrage_token" ]; then
|
elif [ "$TOKEN_TYPE" == "erc20_demurrage_token" ]; then
|
||||||
if [ -z "$TOKEN_SYMBOL" ]; then
|
if [ -z "$TOKEN_SYMBOL" ]; then
|
||||||
>&2 echo token symbol not set, setting defaults for type $TOKEN_TYPE
|
>&2 echo token symbol not set, setting defaults for type $TOKEN_TYPE
|
||||||
@@ -56,62 +54,58 @@ elif [ "$TOKEN_TYPE" == "erc20_demurrage_token" ]; then
|
|||||||
>&2 echo -e "\033[;93mtoken sink address not set, so redistribution will be BURNED\033[;39m"
|
>&2 echo -e "\033[;93mtoken sink address not set, so redistribution will be BURNED\033[;39m"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
DEV_RESERVE_ADDRESS=`erc20-demurrage-token-deploy $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CHAIN_SPEC --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL -vv -ww -s`
|
DEV_RESERVE_ADDRESS=`erc20-demurrage-token-deploy $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL -vv -ww -s`
|
||||||
else
|
else
|
||||||
>&2 echo unknown token type $TOKEN_TYPE
|
>&2 echo unknown token type $TOKEN_TYPE
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "giftable-token-gift $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CHAIN_SPEC -vv -w -e $DEV_RESERVE_ADDRESS $DEV_RESERVE_AMOUNT"
|
echo "giftable-token-gift $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -vv -w -e $DEV_RESERVE_ADDRESS $DEV_RESERVE_AMOUNT"
|
||||||
giftable-token-gift $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CHAIN_SPEC -u -vv -s -w -e $DEV_RESERVE_ADDRESS $DEV_RESERVE_AMOUNT
|
giftable-token-gift $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -u -vv -s -w -e $DEV_RESERVE_ADDRESS $DEV_RESERVE_AMOUNT
|
||||||
|
|
||||||
>&2 echo "deploy account index contract"
|
>&2 echo "deploy account index contract"
|
||||||
DEV_ACCOUNT_INDEX_ADDRESS=`eth-accounts-index-deploy $fee_price_arg -i $CHAIN_SPEC -p $RPC_PROVIDER -y $WALLET_KEY_FILE -vv -s -u -w`
|
DEV_ACCOUNT_INDEX_ADDRESS=`eth-accounts-index-deploy $fee_price_arg -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -y $WALLET_KEY_FILE -vv -s -u -w`
|
||||||
>&2 echo "add deployer address as account index writer"
|
>&2 echo "add deployer address as account index writer"
|
||||||
eth-accounts-index-writer $fee_price_arg -s -u -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -e $DEV_ACCOUNT_INDEX_ADDRESS -ww -vv $debug $DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER
|
eth-accounts-index-writer $fee_price_arg -s -u -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -e $DEV_ACCOUNT_INDEX_ADDRESS -ww -vv $debug $DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER
|
||||||
|
|
||||||
>&2 echo "deploy contract registry contract"
|
>&2 echo "deploy contract registry contract"
|
||||||
CIC_REGISTRY_ADDRESS=`eth-contract-registry-deploy $fee_price_arg -i $CHAIN_SPEC -y $WALLET_KEY_FILE --identifier AccountRegistry --identifier TokenRegistry --identifier AddressDeclarator --identifier Faucet --identifier TransferAuthorization --identifier ContractRegistry -p $RPC_PROVIDER -vv -s -u -w`
|
CIC_REGISTRY_ADDRESS=`eth-contract-registry-deploy $fee_price_arg -i $CIC_CHAIN_SPEC -y $WALLET_KEY_FILE --identifier AccountRegistry --identifier TokenRegistry --identifier AddressDeclarator --identifier Faucet --identifier TransferAuthorization --identifier ContractRegistry -p $RPC_PROVIDER -vv -s -u -w`
|
||||||
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier ContractRegistry $CIC_REGISTRY_ADDRESS
|
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier ContractRegistry $CIC_REGISTRY_ADDRESS
|
||||||
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier AccountRegistry $DEV_ACCOUNT_INDEX_ADDRESS
|
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier AccountRegistry $DEV_ACCOUNT_INDEX_ADDRESS
|
||||||
|
|
||||||
# Deploy address declarator registry
|
# Deploy address declarator registry
|
||||||
>&2 echo "deploy address declarator contract"
|
>&2 echo "deploy address declarator contract"
|
||||||
declarator_description=0x546869732069732074686520434943206e6574776f726b000000000000000000
|
declarator_description=0x546869732069732074686520434943206e6574776f726b000000000000000000
|
||||||
DEV_DECLARATOR_ADDRESS=`eth-address-declarator-deploy -s -u -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -w -vv $declarator_description`
|
DEV_DECLARATOR_ADDRESS=`eth-address-declarator-deploy -s -u -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -w -vv $declarator_description`
|
||||||
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier AddressDeclarator $DEV_DECLARATOR_ADDRESS
|
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier AddressDeclarator $DEV_DECLARATOR_ADDRESS
|
||||||
|
|
||||||
# Deploy transfer authorization contact
|
# Deploy transfer authorization contact
|
||||||
>&2 echo "deploy transfer auth contract"
|
>&2 echo "deploy transfer auth contract"
|
||||||
DEV_TRANSFER_AUTHORIZATION_ADDRESS=`erc20-transfer-auth-deploy $gas_price_arg -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -w -vv`
|
DEV_TRANSFER_AUTHORIZATION_ADDRESS=`erc20-transfer-auth-deploy $gas_price_arg -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -w -vv`
|
||||||
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier TransferAuthorization $DEV_TRANSFER_AUTHORIZATION_ADDRESS
|
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier TransferAuthorization $DEV_TRANSFER_AUTHORIZATION_ADDRESS
|
||||||
|
|
||||||
# Deploy token index contract
|
# Deploy token index contract
|
||||||
>&2 echo "deploy token index contract"
|
>&2 echo "deploy token index contract"
|
||||||
DEV_TOKEN_INDEX_ADDRESS=`eth-token-index-deploy -s -u $fee_price_arg -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -w -vv`
|
DEV_TOKEN_INDEX_ADDRESS=`eth-token-index-deploy -s -u $fee_price_arg -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -w -vv`
|
||||||
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier TokenRegistry $DEV_TOKEN_INDEX_ADDRESS
|
eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier TokenRegistry $DEV_TOKEN_INDEX_ADDRESS
|
||||||
>&2 echo "add reserve token to token index"
|
>&2 echo "add reserve token to token index"
|
||||||
eth-token-index-add $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -vv -e $DEV_TOKEN_INDEX_ADDRESS $DEV_RESERVE_ADDRESS
|
eth-token-index-add $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv -e $DEV_TOKEN_INDEX_ADDRESS $DEV_RESERVE_ADDRESS
|
||||||
|
|
||||||
# Sarafu faucet contract
|
# Sarafu faucet contract
|
||||||
>&2 echo "deploy token faucet contract"
|
>&2 echo "deploy token faucet contract"
|
||||||
DEV_FAUCET_ADDRESS=`sarafu-faucet-deploy $fee_price_arg -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -w -vv --account-index-address $DEV_ACCOUNT_INDEX_ADDRESS $DEV_RESERVE_ADDRESS -s`
|
DEV_FAUCET_ADDRESS=`sarafu-faucet-deploy $fee_price_arg -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -w -vv --account-index-address $DEV_ACCOUNT_INDEX_ADDRESS $DEV_RESERVE_ADDRESS -s`
|
||||||
|
|
||||||
>&2 echo "set token faucet amount"
|
>&2 echo "set token faucet amount"
|
||||||
sarafu-faucet-set $fee_price_arg -w -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -e $DEV_FAUCET_ADDRESS -vv -s --fee-limit 100000 $DEV_FAUCET_AMOUNT
|
sarafu-faucet-set $fee_price_arg -y $WALLET_KEY_FILE -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -e $DEV_FAUCET_ADDRESS -vv -s --fee-limit 100000 $DEV_FAUCET_AMOUNT
|
||||||
|
|
||||||
>&2 echo "register faucet in registry"
|
>&2 echo "register faucet in registry"
|
||||||
eth-contract-registry-set -s -u $fee_price_arg -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier Faucet $DEV_FAUCET_ADDRESS
|
eth-contract-registry-set -s -u $fee_price_arg -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv --identifier Faucet $DEV_FAUCET_ADDRESS
|
||||||
|
|
||||||
>&2 echo "set faucet as token minter"
|
>&2 echo "set faucet as token minter"
|
||||||
giftable-token-minter -s -u $fee_price_arg -w -y $WALLET_KEY_FILE -e $DEV_RESERVE_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER -vv $DEV_FAUCET_ADDRESS
|
giftable-token-minter -s -u $fee_price_arg -w -y $WALLET_KEY_FILE -e $DEV_RESERVE_ADDRESS -i $CIC_CHAIN_SPEC -p $RPC_PROVIDER -vv $DEV_FAUCET_ADDRESS
|
||||||
|
|
||||||
|
|
||||||
#echo "export CIC_DEFAULT_TOKEN_SYMBOL=$TOKEN_SYMBOL" >> ${DEV_DATA_DIR}/env_reset
|
confini-dump --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset
|
||||||
export CIC_DEFAULT_TOKEN_SYMBOL=$TOKEN_SYMBOL
|
|
||||||
|
|
||||||
confini-dump -vv --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config --prefix export > ${DEV_DATA_DIR}/env_reset
|
|
||||||
confini-dump --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config
|
|
||||||
|
|
||||||
set +a
|
set +a
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
>&2 echo -e "\033[;96mRUNNING\033[;39m configurations"
|
>&2 echo -e "\033[;96mRUNNING\033[;39m configurations"
|
||||||
./config.sh
|
. ./config.sh
|
||||||
if [ $? -ne "0" ]; then
|
if [ $? -ne "0" ]; then
|
||||||
>&2 echo -e "\033[;31mFAILED\033[;39m configurations"
|
>&2 echo -e "\033[;31mFAILED\033[;39m configurations"
|
||||||
exit 1;
|
exit 1;
|
||||||
|
|||||||
@@ -82,7 +82,5 @@ cic-eth-ctl -i $CHAIN_SPEC unlock INIT
|
|||||||
cic-eth-ctl -i $CHAIN_SPEC unlock SEND
|
cic-eth-ctl -i $CHAIN_SPEC unlock SEND
|
||||||
cic-eth-ctl -i $CHAIN_SPEC unlock QUEUE
|
cic-eth-ctl -i $CHAIN_SPEC unlock QUEUE
|
||||||
|
|
||||||
confini-dump --schema-module chainlib.eth.data.config --schema-module cic_eth.data.config --schema-dir ./config
|
|
||||||
|
|
||||||
set +a
|
set +a
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ config = confini.Config(config_dir, os.environ.get('CONFINI_ENV_PREFIX'))
|
|||||||
config.process()
|
config.process()
|
||||||
args_override = {
|
args_override = {
|
||||||
'CIC_REGISTRY_ADDRESS': getattr(args, 'r'),
|
'CIC_REGISTRY_ADDRESS': getattr(args, 'r'),
|
||||||
'CHAIN_SPEC': getattr(args, 'i'),
|
'CIC_CHAIN_SPEC': getattr(args, 'i'),
|
||||||
'KEYSTORE_FILE_PATH': getattr(args, 'y')
|
'KEYSTORE_FILE_PATH': getattr(args, 'y')
|
||||||
}
|
}
|
||||||
config.dict_override(args_override, 'cli')
|
config.dict_override(args_override, 'cli')
|
||||||
@@ -86,7 +86,7 @@ os.makedirs(txs_dir)
|
|||||||
|
|
||||||
user_dir = args.user_dir
|
user_dir = args.user_dir
|
||||||
|
|
||||||
chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
|
chain_spec = ChainSpec.from_chain_str(config.get('CIC_CHAIN_SPEC'))
|
||||||
chain_str = str(chain_spec)
|
chain_str = str(chain_spec)
|
||||||
|
|
||||||
old_chain_spec = ChainSpec.from_chain_str(args.old_chain_spec)
|
old_chain_spec = ChainSpec.from_chain_str(args.old_chain_spec)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
sarafu-faucet~=0.0.7a1
|
sarafu-faucet~=0.0.7a1
|
||||||
cic-eth[tools]~=0.12.4a8
|
cic-eth[tools]~=0.12.4a8
|
||||||
cic-types~=0.1.0a14
|
cic-types~=0.1.0a14
|
||||||
crypto-dev-signer>=0.4.15a4,<=0.4.15
|
crypto-dev-signer>=0.4.15a1,<=0.4.15
|
||||||
faker==4.17.1
|
faker==4.17.1
|
||||||
chainsyncer~=0.0.6a3
|
chainsyncer~=0.0.6a3
|
||||||
chainlib-eth~=0.0.9a13
|
chainlib-eth~=0.0.9a7
|
||||||
eth-address-index~=0.2.3a4
|
eth-address-index~=0.2.3a4
|
||||||
eth-contract-registry~=0.6.3a3
|
eth-contract-registry~=0.6.3a3
|
||||||
eth-accounts-index~=0.1.2a3
|
eth-accounts-index~=0.1.2a3
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ argparser.add_argument('--skip-ussd', dest='skip_ussd', action='store_true', hel
|
|||||||
argparser.add_argument('--skip-metadata', dest='skip_metadata', action='store_true', help='skip all metadata verifications')
|
argparser.add_argument('--skip-metadata', dest='skip_metadata', action='store_true', help='skip all metadata verifications')
|
||||||
argparser.add_argument('--exclude', action='append', type=str, default=[], help='skip specified verification')
|
argparser.add_argument('--exclude', action='append', type=str, default=[], help='skip specified verification')
|
||||||
argparser.add_argument('--include', action='append', type=str, help='include specified verification')
|
argparser.add_argument('--include', action='append', type=str, help='include specified verification')
|
||||||
argparser.add_argument('--token-symbol', default='GFT', type=str, dest='token_symbol', help='Token symbol to use for transactions')
|
argparser.add_argument('--token-symbol', default='GFT', type=str, dest='token_symbol', help='Token symbol to use for trnsactions')
|
||||||
argparser.add_argument('-r', '--registry-address', type=str, dest='r', help='CIC Registry address')
|
argparser.add_argument('-r', '--registry-address', type=str, dest='r', help='CIC Registry address')
|
||||||
argparser.add_argument('--env-prefix', default=os.environ.get('CONFINI_ENV_PREFIX'), dest='env_prefix', type=str, help='environment prefix for variables to overwrite configuration')
|
argparser.add_argument('--env-prefix', default=os.environ.get('CONFINI_ENV_PREFIX'), dest='env_prefix', type=str, help='environment prefix for variables to overwrite configuration')
|
||||||
argparser.add_argument('-x', '--exit-on-error', dest='x', action='store_true', help='Halt exection on error')
|
argparser.add_argument('-x', '--exit-on-error', dest='x', action='store_true', help='Halt exection on error')
|
||||||
@@ -471,11 +471,7 @@ def main():
|
|||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
logg.critical('lookup failed for token {}: {}'.format(token_symbol, e))
|
logg.critical('lookup failed for token {}: {}'.format(token_symbol, e))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
logg.info('found token address {}'.format(token_address))
|
||||||
if token_address == ZERO_ADDRESS:
|
|
||||||
logg.warning('unknown token. token tests will not work.')
|
|
||||||
else:
|
|
||||||
logg.info('found token address {}'.format(token_address))
|
|
||||||
|
|
||||||
balances = {}
|
balances = {}
|
||||||
f = open('{}/balances.csv'.format(user_dir, 'r'))
|
f = open('{}/balances.csv'.format(user_dir, 'r'))
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ services:
|
|||||||
# image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/contract-migration:latest
|
# image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/contract-migration:latest
|
||||||
environment:
|
environment:
|
||||||
RPC_PROVIDER: ${RPC_PROVIDER:-http://eth:8545}
|
RPC_PROVIDER: ${RPC_PROVIDER:-http://eth:8545}
|
||||||
ETH_PROVIDER: ${RPC_PROVIDER:-http://eth:8545}
|
|
||||||
DEV_USE_DOCKER_WAIT_SCRIPT: 1
|
DEV_USE_DOCKER_WAIT_SCRIPT: 1
|
||||||
CHAIN_SPEC: ${CHAIN_SPEC:-evm:bloxberg:8996}
|
CHAIN_SPEC: ${CHAIN_SPEC:-evm:bloxberg:8996}
|
||||||
CIC_CHAIN_SPEC: ${CHAIN_SPEC:-evm:bloxberg:8996}
|
CIC_CHAIN_SPEC: ${CHAIN_SPEC:-evm:bloxberg:8996}
|
||||||
@@ -94,15 +93,14 @@ services:
|
|||||||
RUN_MASK: ${RUN_MASK:-0} # bit flags; 1: contract migrations 2: seed data
|
RUN_MASK: ${RUN_MASK:-0} # bit flags; 1: contract migrations 2: seed data
|
||||||
DEV_FAUCET_AMOUNT: ${DEV_FAUCET_AMOUNT:-0}
|
DEV_FAUCET_AMOUNT: ${DEV_FAUCET_AMOUNT:-0}
|
||||||
DEV_ETH_GAS_PRICE: $DEV_ETH_GAS_PRICE
|
DEV_ETH_GAS_PRICE: $DEV_ETH_GAS_PRICE
|
||||||
|
CIC_DEFAULT_TOKEN_SYMBOL: ${CIC_DEFAULT_TOKEN_SYMBOL:-SARAFU}
|
||||||
TOKEN_NAME: ${TOKEN_NAME:-Sarafu Token}
|
TOKEN_NAME: ${TOKEN_NAME:-Sarafu Token}
|
||||||
TOKEN_SYMBOL: ${TOKEN_SYMBOL:-GFT}
|
|
||||||
TOKEN_DECIMALS: $TOKEN_DECIMALS
|
TOKEN_DECIMALS: $TOKEN_DECIMALS
|
||||||
TOKEN_REDISTRIBUTION_PERIOD: $TOKEN_DEMURRAGE_REDISTRIBUTION_PERIOD
|
TOKEN_REDISTRIBUTION_PERIOD: $TOKEN_DEMURRAGE_REDISTRIBUTION_PERIOD
|
||||||
TOKEN_SUPPLY_LIMIT: $TOKEN_SUPPLY_LIMIT
|
TOKEN_SUPPLY_LIMIT: $TOKEN_SUPPLY_LIMIT
|
||||||
TOKEN_DEMURRAGE_LEVEL: $TOKEN_DEMURRAGE_LEVEL
|
TOKEN_DEMURRAGE_LEVEL: $TOKEN_DEMURRAGE_LEVEL
|
||||||
TOKEN_SINK_ADDRESS: $TOKEN_SINK_ADDRESS
|
TOKEN_SINK_ADDRESS: $TOKEN_SINK_ADDRESS
|
||||||
TOKEN_TYPE: $TOKEN_TYPE
|
TOKEN_TYPE: $TOKEN_TYPE
|
||||||
SIGNER_PROVIDER: ${SIGNER_SOCKET_PATH:-http://cic-eth-signer:8000}
|
|
||||||
command: ["./run_job.sh"]
|
command: ["./run_job.sh"]
|
||||||
#command: ["./reset.sh"]
|
#command: ["./reset.sh"]
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -150,7 +148,7 @@ services:
|
|||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||||
./start_tracker.sh -c /usr/local/etc/cic-cache -vv
|
./start_tracker.sh -c /usr/local/etc/cic-cache -vv
|
||||||
volumes:
|
volumes:
|
||||||
- contract-config:/tmp/cic/config/:ro
|
- contract-config:/tmp/cic/config/:ro
|
||||||
@@ -191,7 +189,7 @@ services:
|
|||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||||
/usr/local/bin/cic-cache-taskerd -vv
|
/usr/local/bin/cic-cache-taskerd -vv
|
||||||
volumes:
|
volumes:
|
||||||
- contract-config:/tmp/cic/config/:ro
|
- contract-config:/tmp/cic/config/:ro
|
||||||
@@ -225,7 +223,7 @@ services:
|
|||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||||
"/usr/local/bin/uwsgi" \
|
"/usr/local/bin/uwsgi" \
|
||||||
--wsgi-file /root/cic_cache/runnable/daemons/server.py \
|
--wsgi-file /root/cic_cache/runnable/daemons/server.py \
|
||||||
--http :8000 \
|
--http :8000 \
|
||||||
@@ -262,9 +260,8 @@ services:
|
|||||||
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis}
|
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis}
|
||||||
CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis}
|
CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis}
|
||||||
CELERY_DEBUG: ${CELERY_DEBUG:-1}
|
CELERY_DEBUG: ${CELERY_DEBUG:-1}
|
||||||
#SIGNER_SOCKET_PATH: ${SIGNER_SOCKET_PATH:-http://cic-eth-signer:8000}
|
SIGNER_SOCKET_PATH: ${SIGNER_SOCKET_PATH:-ipc:///run/crypto-dev-signer/jsonrpc.ipc}
|
||||||
SIGNER_PROVIDER: ${SIGNER_PROVIDER:-http://cic-eth-signer:8000}
|
SIGNER_PROVIDER: ${SIGNER_SOCKET_PATH:-ipc:///run/crypto-dev-signer/jsonrpc.ipc}
|
||||||
SIGNER_PROVIDER: http://cic-eth-signer:8000
|
|
||||||
SIGNER_SECRET: ${SIGNER_SECRET:-deadbeef}
|
SIGNER_SECRET: ${SIGNER_SECRET:-deadbeef}
|
||||||
ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER: ${DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER:-0xACB0BC74E1686D62dE7DC6414C999EA60C09F0eA}
|
ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER: ${DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER:-0xACB0BC74E1686D62dE7DC6414C999EA60C09F0eA}
|
||||||
TASKS_TRACE_QUEUE_STATUS: ${TASKS_TRACE_QUEUE_STATUS:-1}
|
TASKS_TRACE_QUEUE_STATUS: ${TASKS_TRACE_QUEUE_STATUS:-1}
|
||||||
@@ -273,75 +270,18 @@ services:
|
|||||||
- eth
|
- eth
|
||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
- cic-eth-signer
|
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
volumes:
|
volumes:
|
||||||
- signer-data:/run/crypto-dev-signer
|
- signer-data:/tmp/cic/signer
|
||||||
- contract-config:/tmp/cic/config/:ro
|
- contract-config:/tmp/cic/config/:ro
|
||||||
#command: ["/usr/local/bin/cic-eth-taskerd"]
|
|
||||||
#command: ["sleep", "3600"]
|
|
||||||
command:
|
command:
|
||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||||
./start_tasker.sh --aux-all -q cic-eth -vv
|
./start_tasker.sh --aux-all -q cic-eth -vv
|
||||||
|
|
||||||
cic-eth-signer:
|
|
||||||
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:${TAG:-latest}
|
|
||||||
build:
|
|
||||||
context: apps/cic-eth
|
|
||||||
dockerfile: docker/Dockerfile
|
|
||||||
target: dev
|
|
||||||
args:
|
|
||||||
EXTRA_INDEX_URL: ${EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8433}
|
|
||||||
environment:
|
|
||||||
CIC_REGISTRY_ADDRESS: $CIC_REGISTRY_ADDRESS
|
|
||||||
ETH_GAS_PROVIDER_ADDRESS: $DEV_ETH_ACCOUNT_GAS_PROVIDER
|
|
||||||
ETH_PROVIDER: ${ETH_PROVIDER:-http://eth:8545}
|
|
||||||
RPC_HTTP_PROVIDER: ${ETH_PROVIDER:-http://eth:8545}
|
|
||||||
DATABASE_USER: ${DATABASE_USER:-grassroots}
|
|
||||||
DATABASE_HOST: ${DATABASE_HOST:-postgres}
|
|
||||||
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-tralala}
|
|
||||||
DATABASE_NAME: ${DATABASE_NAME_CIC_ETH:-cic_eth}
|
|
||||||
DATABASE_PORT: ${DATABASE_PORT:-5432}
|
|
||||||
DATABASE_ENGINE: ${DATABASE_ENGINE:-postgres}
|
|
||||||
DATABASE_DRIVER: ${DATABASE_DRIVER:-psycopg2}
|
|
||||||
DATABASE_DEBUG: ${DATABASE_DEBUG:-0}
|
|
||||||
DATABASE_POOL_SIZE: 0
|
|
||||||
REDIS_PORT: 6379
|
|
||||||
REDIS_HOST: redis
|
|
||||||
PGPASSWORD: ${DATABASE_PASSWORD:-tralala}
|
|
||||||
CIC_CHAIN_SPEC: ${CIC_CHAIN_SPEC:-evm:bloxberg:8996}
|
|
||||||
CHAIN_SPEC: ${CIC_CHAIN_SPEC:-evm:bloxberg:8996}
|
|
||||||
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis}
|
|
||||||
CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis}
|
|
||||||
CELERY_DEBUG: ${CELERY_DEBUG:-1}
|
|
||||||
SIGNER_SOCKET_PATH: ${SIGNER_SOCKET_PATH:-http://0.0.0.0:8000}
|
|
||||||
SIGNER_PROVIDER: ${SIGNER_SOCKET_PATH:-http://0.0.0.0:8000}
|
|
||||||
SIGNER_SECRET: ${SIGNER_SECRET:-deadbeef}
|
|
||||||
ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER: ${DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER:-0xACB0BC74E1686D62dE7DC6414C999EA60C09F0eA}
|
|
||||||
TASKS_TRACE_QUEUE_STATUS: ${TASKS_TRACE_QUEUE_STATUS:-1}
|
|
||||||
CIC_DEFAULT_TOKEN_SYMBOL: ${CIC_DEFAULT_TOKEN_SYMBOL:-GFT}
|
|
||||||
depends_on:
|
|
||||||
- eth
|
|
||||||
- postgres
|
|
||||||
- redis
|
|
||||||
deploy:
|
|
||||||
restart_policy:
|
|
||||||
condition: on-failure
|
|
||||||
volumes:
|
|
||||||
- signer-data:/run/crypto-dev-signer
|
|
||||||
- contract-config:/tmp/cic/config/:ro
|
|
||||||
command: ["python", "/usr/local/bin/crypto-dev-daemon", "-c", "/usr/local/etc/crypto-dev-signer", "-vv"]
|
|
||||||
#command:
|
|
||||||
# - /bin/bash
|
|
||||||
# - -c
|
|
||||||
# - |
|
|
||||||
# if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
|
||||||
# ./start_tasker.sh --aux-all -q cic-eth -vv
|
|
||||||
# command: [/bin/sh, "./start_tasker.sh", -q, cic-eth, -vv ]
|
# command: [/bin/sh, "./start_tasker.sh", -q, cic-eth, -vv ]
|
||||||
|
|
||||||
cic-eth-tracker:
|
cic-eth-tracker:
|
||||||
@@ -383,7 +323,7 @@ services:
|
|||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||||
#./start_tracker.sh -vv -c /usr/local/etc/cic-eth
|
#./start_tracker.sh -vv -c /usr/local/etc/cic-eth
|
||||||
./start_tracker.sh -vv
|
./start_tracker.sh -vv
|
||||||
# command: "/root/start_manager.sh head -vv"
|
# command: "/root/start_manager.sh head -vv"
|
||||||
@@ -429,10 +369,9 @@ services:
|
|||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||||
./start_dispatcher.sh -q cic-eth -vv
|
./start_dispatcher.sh -q cic-eth -vv
|
||||||
# command: "/root/start_dispatcher.sh -q cic-eth -vv"
|
# command: "/root/start_dispatcher.sh -q cic-eth -vv"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cic-eth-retrier:
|
cic-eth-retrier:
|
||||||
@@ -477,7 +416,7 @@ services:
|
|||||||
- /bin/bash
|
- /bin/bash
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
if [[ -f /tmp/cic/config/env_reset ]]; then source /tmp/cic/config/env_reset; fi
|
if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi
|
||||||
./start_retry.sh -vv
|
./start_retry.sh -vv
|
||||||
# command: "/root/start_retry.sh -q cic-eth -vv"
|
# command: "/root/start_retry.sh -q cic-eth -vv"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user