-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
3,486 additions
and
2,282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
venv/ | ||
.git/ | ||
.buildozer/ | ||
.pytest_cache/ | ||
.tox/ | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.swp | ||
*.pyc | ||
*.pyo | ||
venv/ | ||
bin/ | ||
.buildozer/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,21 @@ | ||
dist: trusty | ||
sudo: required | ||
|
||
language: generic | ||
|
||
before_script: | ||
- "export DISPLAY=:99.0" | ||
- "sh -e /etc/init.d/xvfb start" | ||
- sleep 3 # give xvfb some time to start | ||
# before_script: | ||
# - "export DISPLAY=:99.0" | ||
# - "sh -e /etc/init.d/xvfb start" | ||
# - sleep 3 # give xvfb some time to start | ||
|
||
before_install: | ||
# Required by Buildozer Android | ||
# https://buildozer.readthedocs.io/en/latest/installation.html#android-on-ubuntu-12-04-64bit | ||
- sudo apt-get update -q | ||
- sudo apt-get install build-essential ccache git lib32z1 lib32bz2-1.0 libncurses5:i386 libstdc++6:i386 python2.7 python2.7-dev openjdk-7-jdk unzip zlib1g-dev zlib1g:i386 | ||
# Required by Kivy | ||
# https://kivy.org/docs/installation/installation-linux.html#dependencies-with-sdl2 | ||
- sudo apt-get install python-pip build-essential git python-dev | ||
- sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev | ||
# Optional dependency for the cut and multitouch support | ||
- sudo apt-get install xclip libmtdev1 | ||
# Required for the project | ||
- sudo apt-get install libzbar-dev | ||
|
||
install: | ||
- sudo pip install coveralls | ||
services: | ||
- docker | ||
|
||
env: | ||
global: | ||
- COVERALLS_PARALLEL=true | ||
matrix: | ||
- SCRIPT_COMMAND="./travis/script_linux.sh" | ||
- SCRIPT_COMMAND="./travis/script_android.sh" | ||
- TAG=pywallet-linux DOCKERFILE=dockerfiles/Dockerfile-linux COMMAND='make test' | ||
- TAG=pywallet-android DOCKERFILE=dockerfiles/Dockerfile-android COMMAND='buildozer android debug' | ||
|
||
script: | ||
# runs in parallel | ||
- (eval "$SCRIPT_COMMAND") | ||
install: | ||
- docker build --tag=$TAG --file=$DOCKERFILE . | ||
|
||
after_success: | ||
- coveralls | ||
script: | ||
- travis_wait docker run $TAG $COMMAND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
VENV_NAME=venv | ||
ACTIVATE_PATH=$(VENV_NAME)/bin/activate | ||
PIP=`. $(ACTIVATE_PATH); which pip` | ||
TOX=`which tox` | ||
GARDEN=`. $(ACTIVATE_PATH); which garden` | ||
PYTHON=$(VENV_NAME)/bin/python | ||
SYSTEM_DEPENDENCIES=virtualenv build-essential libpython2.7-dev \ | ||
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \ | ||
cmake python-numpy tox wget curl libssl-dev libzbar-dev \ | ||
xclip xsel | ||
OS=$(shell lsb_release -si) | ||
OPENCV_VERSION=2.4.13.6 | ||
OPENCV_BASENAME=opencv-$(OPENCV_VERSION) | ||
OPENCV_BUILD=$(OPENCV_BASENAME)/build/lib/cv2.so | ||
OPENCV_DEPLOY=$(VENV_NAME)/lib/python2.7/site-packages/cv2.so | ||
NPROC=`grep -c '^processor' /proc/cpuinfo` | ||
|
||
|
||
all: system_dependencies opencv virtualenv | ||
|
||
virtualenv: | ||
test -d venv || virtualenv -p python2 venv | ||
. venv/bin/activate | ||
$(PIP) install Cython==0.26.1 | ||
$(PIP) install -r requirements/requirements.txt | ||
$(GARDEN) install qrcode | ||
$(GARDEN) install xcamera | ||
|
||
system_dependencies: | ||
ifeq ($(OS), Ubuntu) | ||
sudo apt install --yes --no-install-recommends $(SYSTEM_DEPENDENCIES) | ||
endif | ||
|
||
$(OPENCV_BUILD): | ||
curl --location https://github.com/opencv/opencv/archive/$(OPENCV_VERSION).tar.gz \ | ||
--progress-bar --output $(OPENCV_BASENAME).tar.gz | ||
tar -xf $(OPENCV_BASENAME).tar.gz | ||
cmake \ | ||
-D BUILD_DOCS=OFF -D BUILD_PACKAGE=OFF -D BUILD_PERF_TESTS=OFF \ | ||
-D BUILD_TESTS=OFF -D BUILD_opencv_apps=OFF \ | ||
-D BUILD_opencv_nonfree=OFF -D BUILD_opencv_stitching=OFF \ | ||
-D BUILD_opencv_superres=OFF -D BUILD_opencv_ts=OFF \ | ||
-D BUILD_WITH_DEBUG_INFO=OFF -D WITH_1394=OFF -D WITH_CUDA=OFF \ | ||
-D WITH_CUFFT=OFF -D WITH_GIGEAPI=OFF -D WITH_JASPER=OFF \ | ||
-D WITH_OPENEXR=OFF -D WITH_PVAPI=OFF -D WITH_GTK=OFF \ | ||
-D BUILD_opencv_python=ON -B$(OPENCV_BASENAME)/build -H$(OPENCV_BASENAME) | ||
cmake --build $(OPENCV_BASENAME)/build -- -j$(NPROC) | ||
|
||
opencv_build: $(OPENCV_BUILD) | ||
|
||
$(OPENCV_DEPLOY): opencv_build virtualenv | ||
cp $(OPENCV_BUILD) $(OPENCV_DEPLOY) | ||
|
||
opencv: $(OPENCV_DEPLOY) | ||
|
||
clean: | ||
rm -rf $(VENV_NAME) .tox/ $(OPENCV_BASENAME) | ||
|
||
test: | ||
$(TOX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Docker image for building Android APKs via buildozer | ||
# Build with: | ||
# docker build --tag=pywallet-android --file=dockerfiles/Dockerfile-android . | ||
# Run with: | ||
# docker run pywallet-android /bin/sh -c 'buildozer android debug' | ||
# Or using the entry point shortcut: | ||
# docker run pywallet-android 'buildozer android debug' | ||
# Or for interactive shell: | ||
# docker run -it --rm pywallet-android | ||
FROM ubuntu:18.04 | ||
|
||
ENV USER="user" | ||
ENV HOME_DIR="/home/${USER}" | ||
ENV WORK_DIR="${HOME_DIR}" \ | ||
PATH="${HOME_DIR}/.local/bin:${PATH}" | ||
ENV DOCKERFILES_VERSION="master" \ | ||
DOCKERFILES_URL="https://raw.githubusercontent.com/AndreMiras/dockerfiles" | ||
ENV MAKEFILES_URL="${DOCKERFILES_URL}/${DOCKERFILES_VERSION}/buildozer_android_new" | ||
# currently needed because buildozer still uses `tools/android` binary | ||
# even though we have the new `tools/bin/sdkmanager` available | ||
ENV USE_SDK_WRAPPER=true | ||
|
||
|
||
# configure locale | ||
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \ | ||
locales && \ | ||
locale-gen en_US.UTF-8 | ||
ENV LANG="en_US.UTF-8" \ | ||
LANGUAGE="en_US.UTF-8" \ | ||
LC_ALL="en_US.UTF-8" | ||
|
||
# install system dependencies (required to setup all the tools) | ||
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \ | ||
make curl ca-certificates xz-utils unzip openjdk-8-jdk sudo python-pip \ | ||
python-setuptools | ||
|
||
# install build dependencies (required to successfully build the project) | ||
# TODO: should this go to a Makefile instead so it can be shared/reused? | ||
RUN apt install -qq --yes --no-install-recommends \ | ||
file autoconf automake libtool gettext pkg-config libltdl-dev | ||
|
||
# prepare non root env | ||
RUN useradd --create-home --shell /bin/bash ${USER} | ||
# with sudo access and no password | ||
RUN usermod -append --groups sudo ${USER} | ||
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||
|
||
USER ${USER} | ||
WORKDIR ${WORK_DIR} | ||
|
||
# downloads and installs Android SDK | ||
# makes sure to have an up to date build-tools version to workaround buildozer bug, see: | ||
# https://github.com/kivy/buildozer/commit/83ad94d#r29065648 | ||
RUN curl --location --progress-bar ${MAKEFILES_URL}/android_sdk.mk --output android_sdk.mk | ||
RUN make -f android_sdk.mk | ||
|
||
# install buildozer and dependencies | ||
RUN curl --location --progress-bar ${MAKEFILES_URL}/buildozer.mk --output buildozer.mk | ||
RUN make -f buildozer.mk | ||
|
||
# links SDK to where buildozer is expecting to see it | ||
RUN mkdir -p ${HOME}/.buildozer/android/platform | ||
RUN ln -sfn ${HOME}/.android ${HOME}/.buildozer/android/platform/android-sdk-20 | ||
|
||
COPY . ${WORK_DIR} | ||
ENTRYPOINT ["./dockerfiles/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Docker image for installing dependencies on Linux and running tests. | ||
# Build with: | ||
# docker build --tag=pywallet-linux --file=dockerfiles/Dockerfile-linux . | ||
# Run with: | ||
# docker run pywallet-linux /bin/sh -c 'make test' | ||
# Or using the entry point shortcut: | ||
# docker run pywallet-linux 'make test' | ||
# Or for interactive shell: | ||
# docker run -it --rm pywallet-linux | ||
# TODO: | ||
# - delete archives to keep small the container small | ||
# - setup caching (for apt, and pip) | ||
FROM ubuntu:18.04 | ||
|
||
# configure locale | ||
RUN apt update -qq > /dev/null && apt install --yes --no-install-recommends \ | ||
locales && \ | ||
locale-gen en_US.UTF-8 | ||
ENV LANG="en_US.UTF-8" \ | ||
LANGUAGE="en_US.UTF-8" \ | ||
LC_ALL="en_US.UTF-8" | ||
|
||
# install system dependencies | ||
RUN apt update -qq > /dev/null && apt install --yes --no-install-recommends \ | ||
make lsb-release sudo | ||
|
||
# install kivy system dependencies | ||
# https://kivy.org/docs/installation/installation-linux.html#dependencies-with-sdl2 | ||
RUN apt install --yes --no-install-recommends \ | ||
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
RUN make | ||
ENTRYPOINT ["./dockerfiles/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# if a some command has been passed to container, executes it and exit, | ||
# otherwise runs bash | ||
if [[ $@ ]]; then | ||
eval $@ | ||
else | ||
/bin/bash | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Frequently Asked Questions | ||
|
||
|
||
## Why another Ethereum wallet? | ||
Back in 2016, I wanted to use an open source Android wallet with access to my private keys. | ||
I waited until early 2017 before I decided to create one. | ||
|
||
## Why in Python? | ||
Because it's fun and I like it. | ||
|
||
## Is it safe to use? | ||
It always depends. If your device is not full of malware and if your passphrase is strong enought, then yes it's safe. | ||
Since the private key is stored on device and not in some thirdparty service, you're responsible for keeping it safe. | ||
|
||
|
||
## Decentralized? | ||
There're different level of decentralization. | ||
PyWallet is only a light Ethereum client that stores private keys (encrypted) on device. | ||
But PyWallet doesn't keep track of the blockchain ledger. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.