Skip to content

Commit

Permalink
utils/: remove numpy as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
elric1 committed Feb 9, 2022
1 parent 7809773 commit 49c1e27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions utils/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ ENV PYTHONUNBUFFERED=1

RUN PIP="pip --no-cache install" \
APK_ADD="apk add --no-cache"; \
$APK_ADD --virtual .build-deps gcc g++ python3-dev \
$APK_ADD --virtual .build-deps gcc python3-dev \
libffi-dev musl-dev make \
&& $APK_ADD git libsodium-dev libsecp256k1-dev gmp-dev \
&& $APK_ADD libsodium-dev libsecp256k1-dev gmp-dev \
&& $APK_ADD zeromq-dev \
&& $PIP install base58 pynacl \
&& $PIP install pytezos requests \
&& $PIP install pyblake2 pysodium numpy flask \
&& $PIP install pyblake2 pysodium flask \
&& $PIP install -e 'git+https://github.com/vbuterin/pybitcointools.git@aeb0a2bbb8bbfe421432d776c649650eaeb882a5#egg=bitcoin' \
&& apk del .build-deps git \
&& apk del .build-deps \
&& $APK_ADD jq netcat-openbsd curl binutils \
&& $APK_ADD lz4

Expand Down
8 changes: 2 additions & 6 deletions utils/faucet-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import json
import bitcoin
import binascii
import numpy as np
import pysodium
from pyblake2 import blake2b
import unicodedata
Expand Down Expand Up @@ -71,8 +70,8 @@ def genesis_commitments(wallets, blind):
def make_dummy_wallets(n, blind):
# Not a realistic shape, but for an alphanet faucet it's better to
# have less variance.
amounts = np.random.pareto(10.0, n)
amounts = amounts / sum(amounts) * 700e6
amounts = [ random.paretovariate(10.0) - 1 for i in range(n) ]
amounts = [ i / sum(amounts) * 700e6 for i in amounts ]
wallets = {}
secrets = {}
for i in range(0, n):
Expand Down Expand Up @@ -103,9 +102,6 @@ def make_dummy_wallets(n, blind):
blind = args.seed.encode('utf-8')
# initialize random functions for determinism
random.seed(a=blind, version=2)
numpy_seed = random.randint(0,2**32)
print("numpy seed is %s" % numpy_seed)
np.random.seed(seed=numpy_seed)
wallets, secrets = make_dummy_wallets(args.number_of_accounts, blind)

commitments = genesis_commitments(wallets, blind)
Expand Down

0 comments on commit 49c1e27

Please sign in to comment.