Skip to content

Instantly share code, notes, and snippets.

@ohac
Last active July 11, 2017 15:34
Show Gist options
  • Select an option

  • Save ohac/b4e95f264cb158b423f756ce7bf1571b to your computer and use it in GitHub Desktop.

Select an option

Save ohac/b4e95f264cb158b423f756ce7bf1571b to your computer and use it in GitHub Desktop.
Electrum-Mona for Windows build memo (Dockerfile is here: https://twitter.com/cryptcoinjunkey/status/884251303811047425 )
diff --git a/electrum b/electrum
index b9ab196..2661de0 100755
--- a/electrum
+++ b/electrum
@@ -83,7 +83,7 @@ def check_imports():
except Exception:
sys.exit("cannot import ecdsa.curve_secp256k1. You probably need to u
# make sure that certificates are here
- assert os.path.exists(requests.utils.DEFAULT_CA_BUNDLE_PATH)
+ #assert os.path.exists(requests.utils.DEFAULT_CA_BUNDLE_PATH)
if not is_android:
diff --git a/lib/blockchain.py b/lib/blockchain.py
index d6f64c8..8bcb733 100644
--- a/lib/blockchain.py
+++ b/lib/blockchain.py
@@ -32,9 +32,10 @@ from bitcoin import *
try:
from ltc_scrypt import getPoWHash
+ pass
except ImportError:
util.print_msg("Warning: ltc_scrypt not available, using fallback")
- from scrypt import scrypt_1024_1_1_80 as getPoWHash
+ #from scrypt import scrypt_1024_1_1_80 as getPoWHash
MAX_TARGET = 0x00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
@@ -75,7 +76,7 @@ class Blockchain(util.PrintError):
def verify_header(self, header, prev_header, bits, target):
prev_hash = self.hash_header(prev_header)
- _hash = self.pow_hash_header(header) # TODO
+ #_hash = self.pow_hash_header(header) # TODO
if prev_hash != header.get('prev_block_hash'):
raise BaseException("prev hash mismatch: %s vs %s" % (prev_hash,
if not self.pass_checkpoint(header):
@@ -88,10 +89,10 @@ class Blockchain(util.PrintError):
# TODO
#raise BaseException("bits mismatch: %s vs %s" % (bits, header.ge
pass
- if int('0x' + _hash, 16) > target:
+ #if int('0x' + _hash, 16) > target:
# TODO
#raise BaseException("insufficient proof of work: %s vs target %s
- pass
+ #pass
def verify_chain(self, chain):
first_header = chain[0]
diff --git a/setup.py b/setup.py
index 5cbe55d..899fa8e 100755
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ setup(
'pbkdf2',
'requests',
'qrcode',
- 'ltc_scrypt',
+ #'ltc_scrypt',
'protobuf',
'dnspython',
'jsonrpclib',
diff --git a/contrib/build-wine/build-electrum-git.sh b/contrib/build-wine/build-electrum-git.sh
index d2eb4cf..d963b4f 100755
--- a/contrib/build-wine/build-electrum-git.sh
+++ b/contrib/build-wine/build-electrum-git.sh
@@ -1,9 +1,12 @@
#!/bin/bash
# You probably need to update only this link
-ELECTRUM_GIT_URL=git://github.com/spesmilo/electrum.git
-BRANCH=master
-NAME_ROOT=electrum
+#ELECTRUM_GIT_URL=git://github.com/spesmilo/electrum.git
+#BRANCH=master
+#NAME_ROOT=electrum
+ELECTRUM_GIT_URL=git://github.com/ohac/electrum.git
+BRANCH=monacoin-20170514
+NAME_ROOT=electrum-mona
# These settings probably don't need any change
#!/bin/bash
export WINEPREFIX=/opt/wine64
PYHOME=c:/python27
PYTHON="wine $PYHOME/python.exe -OO -B"
set -e
cd tmp
$PYTHON -m pip install urllib3
$PYTHON -m pip install chardet
$PYTHON -m pip install certifi
$PYTHON -m pip install idna
$PYTHON -m pip install win_inet_pton
#!/bin/bash
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
USENET="--net=host"
if ! [ -a $XAUTH ]; then
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
fi
docker run -it --rm \
-v $XSOCK:$XSOCK:rw -v $XAUTH:$XAUTH:rw \
-v $PWD:/data \
-e DISPLAY -e XAUTHORITY=${XAUTH} --ipc=host $USENET \
elewin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment