Compare commits
5 Commits
bvander/on
...
lash/lockf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4a656707c
|
||
|
|
4a0dabe531 | ||
|
|
da751b64ce
|
||
|
|
bff9d5bfd7
|
||
| c21c1eb2ef |
@@ -3,7 +3,10 @@ import logging
|
|||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
import celery
|
import celery
|
||||||
from hexathon import strip_0x
|
from hexathon import (
|
||||||
|
strip_0x,
|
||||||
|
add_0x,
|
||||||
|
)
|
||||||
#from chainlib.eth.constant import ZERO_ADDRESS
|
#from chainlib.eth.constant import ZERO_ADDRESS
|
||||||
from chainlib.chain import ChainSpec
|
from chainlib.chain import ChainSpec
|
||||||
from chainlib.eth.address import is_checksum_address
|
from chainlib.eth.address import is_checksum_address
|
||||||
@@ -180,6 +183,7 @@ def check_gas(self, tx_hashes_hex, chain_spec_dict, txs_hex=[], address=None, ga
|
|||||||
if not is_checksum_address(address):
|
if not is_checksum_address(address):
|
||||||
raise ValueError('invalid address {}'.format(address))
|
raise ValueError('invalid address {}'.format(address))
|
||||||
address = tx_normalize.wallet_address(address)
|
address = tx_normalize.wallet_address(address)
|
||||||
|
address = add_0x(address)
|
||||||
|
|
||||||
tx_hashes = []
|
tx_hashes = []
|
||||||
txs = []
|
txs = []
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ from chainlib.eth.nonce import RPCNonceOracle
|
|||||||
from chainlib.eth.gas import RPCGasOracle
|
from chainlib.eth.gas import RPCGasOracle
|
||||||
from cic_eth_registry import CICRegistry
|
from cic_eth_registry import CICRegistry
|
||||||
from cic_eth_registry.error import UnknownContractError
|
from cic_eth_registry.error import UnknownContractError
|
||||||
import liveness.linux
|
|
||||||
|
|
||||||
# local imports
|
# local imports
|
||||||
from cic_eth.error import SeppukuError
|
from cic_eth.error import SeppukuError
|
||||||
@@ -48,6 +47,7 @@ class BaseTask(celery.Task):
|
|||||||
|
|
||||||
def on_failure(self, exc, task_id, args, kwargs, einfo):
|
def on_failure(self, exc, task_id, args, kwargs, einfo):
|
||||||
if isinstance(exc, SeppukuError):
|
if isinstance(exc, SeppukuError):
|
||||||
|
import liveness.linux
|
||||||
liveness.linux.reset(rundir=self.run_dir)
|
liveness.linux.reset(rundir=self.run_dir)
|
||||||
logg.critical(einfo)
|
logg.critical(einfo)
|
||||||
msg = 'received critical exception {}, calling shutdown'.format(str(exc))
|
msg = 'received critical exception {}, calling shutdown'.format(str(exc))
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ version = (
|
|||||||
0,
|
0,
|
||||||
12,
|
12,
|
||||||
4,
|
4,
|
||||||
'alpha.7',
|
'alpha.8',
|
||||||
)
|
)
|
||||||
|
|
||||||
version_object = semver.VersionInfo(
|
version_object = semver.VersionInfo(
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
@node cic-eth configuration
|
@node cic-eth configuration
|
||||||
@section Configuration
|
@section Configuration
|
||||||
|
|
||||||
(refer to @code{cic-base} for a general overview of the config pipeline)
|
|
||||||
|
|
||||||
Configuration parameters are grouped by configuration filename.
|
Configuration parameters are grouped by configuration filename.
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +38,26 @@ Boolean value. If set, the amount of available context for a task in the result
|
|||||||
|
|
||||||
@subsection database
|
@subsection database
|
||||||
|
|
||||||
See ref cic-base when ready
|
@table @var
|
||||||
|
@item host
|
||||||
|
Database host
|
||||||
|
@item port
|
||||||
|
Database port
|
||||||
|
@item name
|
||||||
|
Database name
|
||||||
|
@item user
|
||||||
|
Database user
|
||||||
|
@item password
|
||||||
|
Database password
|
||||||
|
@item engine
|
||||||
|
The engine part of the dsn connection string (@code{postgresql} in @code{postgresql+psycopg2})
|
||||||
|
@item driver
|
||||||
|
The driver part of the dsn connection string (@code{psycopg2} in @code{postgresql+psycopg2})
|
||||||
|
@item pool_size
|
||||||
|
Connection pool size for database drivers that provide connection pooling
|
||||||
|
@item debug
|
||||||
|
Output actual sql queries to logs. Potentially very verbose
|
||||||
|
@end table
|
||||||
|
|
||||||
|
|
||||||
@subsection eth
|
@subsection eth
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ def test_task_check_gas_ok(
|
|||||||
'cic_eth.eth.gas.check_gas',
|
'cic_eth.eth.gas.check_gas',
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
tx_hash_hex,
|
strip_0x(tx_hash_hex),
|
||||||
],
|
],
|
||||||
default_chain_spec.asdict(),
|
default_chain_spec.asdict(),
|
||||||
[],
|
[],
|
||||||
@@ -283,4 +283,3 @@ def test_task_resend_explicit(
|
|||||||
tx_after = unpack(bytes.fromhex(strip_0x(otx.signed_tx)), default_chain_spec)
|
tx_after = unpack(bytes.fromhex(strip_0x(otx.signed_tx)), default_chain_spec)
|
||||||
logg.debug('gasprices before {} after {}'.format(tx_before['gasPrice'], tx_after['gasPrice']))
|
logg.debug('gasprices before {} after {}'.format(tx_before['gasPrice'], tx_after['gasPrice']))
|
||||||
assert tx_after['gasPrice'] > tx_before['gasPrice']
|
assert tx_after['gasPrice'] > tx_before['gasPrice']
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,4 @@ RUN chmod 755 ./db.sh
|
|||||||
RUN alias tsc=node_modules/typescript/bin/tsc
|
RUN alias tsc=node_modules/typescript/bin/tsc
|
||||||
COPY docker/start_server.sh ./start_server.sh
|
COPY docker/start_server.sh ./start_server.sh
|
||||||
RUN chmod 755 ./start_server.sh
|
RUN chmod 755 ./start_server.sh
|
||||||
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "./start_server.sh"]
|
ENTRYPOINT ["sh", "./start_server.sh"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cic-eth[tools]==0.12.4a4
|
cic-eth[tools]==0.12.4a8
|
||||||
chainlib-eth>=0.0.9a7,<0.1.0
|
chainlib-eth>=0.0.9a9,<0.1.0
|
||||||
eth-erc20>=0.1.2a2,<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
|
||||||
eth-address-index>=0.2.3a4,<0.3.0
|
eth-address-index>=0.2.3a4,<0.3.0
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
.cache
|
.cache
|
||||||
.dot
|
.dot
|
||||||
**/doc
|
**/doc
|
||||||
**/node_modules
|
node_modules/
|
||||||
**/venv
|
**/venv
|
||||||
**/.venv
|
**/.venv
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ COPY package.json \
|
|||||||
package-lock.json \
|
package-lock.json \
|
||||||
.
|
.
|
||||||
|
|
||||||
RUN --mount=type=cache,mode=0755,target=/root/node_modules npm install
|
|
||||||
|
RUN npm ci --production
|
||||||
|
#RUN --mount=type=cache,mode=0755,target=/root/node_modules npm install
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ then
|
|||||||
else
|
else
|
||||||
python cic_ussd/import_users.py -vv -c "$CONFIG" --ussd-host "$USSD_HOST" --ussd-port "$USSD_PORT" --ussd-no-ssl "$IMPORT_DIR"
|
python cic_ussd/import_users.py -vv -c "$CONFIG" --ussd-host "$USSD_HOST" --ussd-port "$USSD_PORT" --ussd-no-ssl "$IMPORT_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting for import balance job to complete ..."
|
echo "Waiting for import balance job to complete ..."
|
||||||
|
|
||||||
tail --pid="$IMPORT_BALANCE_JOB" -f /dev/null
|
tail --pid="$IMPORT_BALANCE_JOB" -f /dev/null
|
||||||
set -e
|
set -e
|
||||||
echo "Importing pins"
|
echo "Importing pins"
|
||||||
|
|||||||
2216
apps/data-seeding/package-lock.json
generated
2216
apps/data-seeding/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
sarafu-faucet~=0.0.7a1
|
sarafu-faucet~=0.0.7a1
|
||||||
cic-eth[tools]~=0.12.4a7
|
cic-eth[tools]~=0.12.4a8
|
||||||
cic-types~=0.1.0a14
|
cic-types~=0.1.0a14
|
||||||
crypto-dev-signer>=0.4.15a1,<=0.4.15
|
crypto-dev-signer>=0.4.15a1,<=0.4.15
|
||||||
faker==4.17.1
|
faker==4.17.1
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ phone_tests = [
|
|||||||
'ussd_pins'
|
'ussd_pins'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
admin_tests = [
|
||||||
|
'local_key',
|
||||||
|
]
|
||||||
|
|
||||||
all_tests = eth_tests + custodial_tests + metadata_tests + phone_tests
|
all_tests = eth_tests + custodial_tests + metadata_tests + phone_tests
|
||||||
|
|
||||||
argparser = argparse.ArgumentParser(description='daemon that monitors transactions in new blocks')
|
argparser = argparse.ArgumentParser(description='daemon that monitors transactions in new blocks')
|
||||||
@@ -74,6 +78,7 @@ argparser.add_argument('-i', '--chain-spec', type=str, dest='i', help='chain spe
|
|||||||
argparser.add_argument('--meta-provider', type=str, dest='meta_provider', default='http://localhost:63380', help='cic-meta url')
|
argparser.add_argument('--meta-provider', type=str, dest='meta_provider', default='http://localhost:63380', help='cic-meta url')
|
||||||
argparser.add_argument('--ussd-provider', type=str, dest='ussd_provider', default='http://localhost:63315', help='cic-ussd url')
|
argparser.add_argument('--ussd-provider', type=str, dest='ussd_provider', default='http://localhost:63315', help='cic-ussd url')
|
||||||
argparser.add_argument('--skip-custodial', dest='skip_custodial', action='store_true', help='skip all custodial verifications')
|
argparser.add_argument('--skip-custodial', dest='skip_custodial', action='store_true', help='skip all custodial verifications')
|
||||||
|
argparser.add_argument('--skip-ussd', dest='skip_ussd', action='store_true', help='skip all ussd verifications')
|
||||||
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')
|
||||||
@@ -134,6 +139,11 @@ if args.skip_custodial:
|
|||||||
for t in custodial_tests:
|
for t in custodial_tests:
|
||||||
if t not in exclude:
|
if t not in exclude:
|
||||||
exclude.append(t)
|
exclude.append(t)
|
||||||
|
if args.skip_ussd:
|
||||||
|
logg.info('will skip all ussd verifications ({})'.format(','.join(phone_tests)))
|
||||||
|
for t in phone_tests:
|
||||||
|
if t not in exclude:
|
||||||
|
exclude.append(t)
|
||||||
if args.skip_metadata:
|
if args.skip_metadata:
|
||||||
logg.info('will skip all metadata verifications ({})'.format(','.join(metadata_tests)))
|
logg.info('will skip all metadata verifications ({})'.format(','.join(metadata_tests)))
|
||||||
for t in metadata_tests:
|
for t in metadata_tests:
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
services:
|
|
||||||
|
|
||||||
cic-frontend-auth:
|
|
||||||
networks:
|
|
||||||
- traefik
|
|
||||||
image: localhost:5000/cic-auth-proxy:latest
|
|
||||||
ports:
|
|
||||||
- 8080
|
|
||||||
environment:
|
|
||||||
GPG_TRUSTED_PUBLICKEY_FINGERPRINT: CCE2E1D2D0E36ADE0405E2D0995BB21816313BD5
|
|
||||||
GPG_IMPORT_DIR: /usr/src/cic-auth-proxy/meta/tests/testdata/dev/
|
|
||||||
GPG_PUBLICKEY_FILENAME: publickeys.asc
|
|
||||||
GPG_SIGNATURE_FILENAME: signature.asc
|
|
||||||
PROXY_HOST: cic-meta-server
|
|
||||||
PROXY_PORT: 80
|
|
||||||
PROXY_PROTO: http
|
|
||||||
PROXY_PATH_PREFIX: "/"
|
|
||||||
HOMEDIR: .gnupg
|
|
||||||
labels:
|
|
||||||
- "traefik.enable=true"
|
|
||||||
|
|
||||||
cic-meta-server:
|
|
||||||
networks:
|
|
||||||
- traefik
|
|
||||||
- default
|
|
||||||
labels:
|
|
||||||
- "traefik.enable=true"
|
|
||||||
- "traefik.http.routers.cic-meta-server.rule=Path(`/protected`)"
|
|
||||||
- "traefik.http.routers.cic-meta-server.middlewares=cic-auth"
|
|
||||||
- "traefik.http.middlewares.cic-auth.forwardauth.address=http://cic-frontend-auth/"
|
|
||||||
- "traefik.http.middlewares.cic-auth.forwardauth.authRequestHeaders=Authorization"
|
|
||||||
|
|
||||||
proxy:
|
|
||||||
networks:
|
|
||||||
- traefik
|
|
||||||
image: traefik:v2.5
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "8080:8080"
|
|
||||||
command:
|
|
||||||
# Enable Docker in Traefik, so that it reads labels from Docker services
|
|
||||||
- --providers.docker
|
|
||||||
# Add a constraint to only use services with the label for this stack
|
|
||||||
# Do not expose all Docker services, only the ones explicitly exposed
|
|
||||||
- --providers.docker.exposedbydefault=false
|
|
||||||
- "--providers.docker.network=traefik"
|
|
||||||
# Disable Docker Swarm mode for local development
|
|
||||||
# - --providers.docker.swarmmode
|
|
||||||
# Enable the access log, with HTTP requests
|
|
||||||
- --accesslog
|
|
||||||
# - log.level=DEBUG
|
|
||||||
# Enable the Traefik log, for configurations and errors
|
|
||||||
- --log
|
|
||||||
- --log.level=DEBUG
|
|
||||||
# Enable the Dashboard and API
|
|
||||||
- --api
|
|
||||||
# Enable the Dashboard and API in insecure mode for local development
|
|
||||||
- --api.insecure=true
|
|
||||||
labels:
|
|
||||||
- traefik.enable=true
|
|
||||||
|
|
||||||
networks:
|
|
||||||
traefik:
|
|
||||||
name: "traefik"
|
|
||||||
@@ -117,7 +117,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- contract-config:/tmp/cic/config
|
- contract-config:/tmp/cic/config
|
||||||
|
|
||||||
|
|
||||||
cic-cache-tracker:
|
cic-cache-tracker:
|
||||||
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:${TAG:-latest}
|
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:${TAG:-latest}
|
||||||
profiles:
|
profiles:
|
||||||
|
|||||||
Reference in New Issue
Block a user