Commit fc0ded4f authored by cyjseagull's avatar cyjseagull
Browse files

merge code from master into dev

parents b3939bed 1d87eb85
......@@ -20,14 +20,6 @@ matrix:
- name: "Python 3.5 on Xenial Linux"
python: 3.5
dist: xenial
# - name: "Python 3.7.3 on Windows"
# os: windows # Windows 10.0.17134 N/A Build 17134
# language: shell # 'language: python' is an error on Travis CI Windows
# before_install:
# - choco install python
# - python -m pip install --upgrade pip
# # - pip install configobj
# env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
addons:
apt:
packages:
......
FROM python:3.7-alpine
ENV USER root
ENV PATH /root/.local/bin/:$PATH
RUN mkdir /python-sdk
WORKDIR /python-sdk
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk add --no-cache gcc g++ python python-dev py-pip openssl bash linux-headers libffi-dev openssl-dev curl wget
COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --no-cache-dir
RUN curl -LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/"$(curl -s https://api.github.com/repos/FISCO-BCOS/FISCO-BCOS/releases | grep "\"v2\.[0-9]\.[0-9]\"" | sort -u | tail -n 1 | cut -d \" -f 4)"/build_chain.sh && chmod u+x build_chain.sh && \
bash build_chain.sh -l "127.0.0.1:4" -p 30300,20200,8545
COPY . /python-sdk
RUN bash init_env.sh -i && \
cp /python-sdk/nodes/127.0.0.1/sdk/* bin/ && \
ln -s /root/.local/bin/register-python-argcomplete /bin/register-python-argcomplete && \
echo "eval \"\$(register-python-argcomplete ./console.py)\"" >> ~/.bashrc && \
echo "eval \"/python-sdk/nodes/127.0.0.1/start_all.sh\"" >> ~/.bashrc
EXPOSE 20200 30300 8545
CMD ["bash"]
......@@ -250,6 +250,17 @@ class RPCConsole:
json_str = int(json_str, 16)
return json_str
def convertHexToDec(self, cmd, json_str):
if cmd == "getTotalTransactionCount":
json_str["blockNumber"] = int(json_str["blockNumber"], 16)
json_str["failedTxSum"] = int(json_str["failedTxSum"], 16)
json_str["txSum"] = int(json_str["txSum"], 16)
elif cmd == "getPendingTxSize" or cmd == "getPbftView":
if isinstance(json_str, int):
return json_str
json_str = int(json_str, 16)
return json_str
def exec_command(self, cmd, params):
"""
exec_command
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment