Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…issuer into v3
  • Loading branch information
lemoustachiste committed Dec 9, 2021
2 parents 7ce5a0a + db7d026 commit d888f7d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RUN apk add --update \
gmp-dev \
libffi-dev \
libressl-dev \
libxml2-dev \
libxslt-dev \
linux-headers \
make \
musl-dev \
Expand All @@ -21,16 +23,19 @@ RUN apk add --update \
tar \
&& python3 -m ensurepip \
&& pip3 install --upgrade pip setuptools \
&& pip3 install Cython \
&& pip3 install wheel \
&& mkdir -p /etc/cert-issuer/data/unsigned_certificates \
&& mkdir /etc/cert-issuer/data/blockchain_certificates \
&& mkdir ~/.bitcoin \
&& echo $'rpcuser=foo\nrpcpassword=bar\nrpcport=8332\nregtest=1\nrelaypriority=0\nrpcallowip=127.0.0.1\nrpcconnect=127.0.0.1\n' > /root/.bitcoin/bitcoin.conf \
&& pip3 install /cert-issuer/. \
&& pip3 install -r /cert-issuer/ethereum_requirements.txt \
&& rm -r /usr/lib/python*/ensurepip \
&& rm -rf /var/cache/apk/* \
&& rm -rf /root/.cache \
&& sed -i.bak s/==1\.0b1/\>=1\.0\.2/g /usr/lib/python3.*/site-packages/merkletools-1.0.2-py3.*.egg-info/requires.txt
&& rm -rf /root/.cache


ENTRYPOINT bitcoind -daemon && bash


6 changes: 3 additions & 3 deletions cert_issuer/blockchain_handlers/ethereum/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def broadcast_tx(self, tx):
"params": ["0x" + tx],
"id": 1
}
response = requests.post(self.base_url, json=data)
response = requests.post(self.base_url, json=data, headers={'user-agent':'cert-issuer'})
if 'error' in response.json():
logging.error("MyEtherWallet returned an error: %s", response.json()['error'])
raise BroadcastError(response.json()['error'])
Expand All @@ -257,7 +257,7 @@ def get_balance(self, address):
"params": [address, "latest"],
"id": 1
}
response = requests.post(self.base_url, json=data)
response = requests.post(self.base_url, json=data, headers={'user-agent':'cert-issuer'})
if int(response.status_code) == 200:
logging.info('Balance check response: %s', response.json())
balance = int(response.json().get('result', None), 0)
Expand All @@ -278,7 +278,7 @@ def get_address_nonce(self, address):
"params": [address, "pending"],
"id": 1
}
response = requests.post(self.base_url, json=data)
response = requests.post(self.base_url, json=data, headers={'user-agent':'cert-issuer'})
if int(response.status_code) == 200:
# the int(res, 0) transforms the hex nonce to int
nonce = int(response.json().get('result', None), 0)
Expand Down
2 changes: 1 addition & 1 deletion cert_issuer/merkle_tree_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime

from cert_core import Chain
from chainpoint.chainpoint import MerkleTools
from merkletools import MerkleTools
from pycoin.serialize import h2b
from lds_merkle_proof_2019.merkle_proof_2019 import MerkleProof2019
from cert_issuer import helpers
Expand Down
3 changes: 2 additions & 1 deletion ethereum_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
web3==5.11.0
web3<=4.4.1
coincurve==7.1.0
ethereum==2.3.1
rlp<1
eth-account<=0.3.0

0 comments on commit d888f7d

Please sign in to comment.