diff --git a/README.md b/README.md index 0e66bca..6ed307d 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ Next, you can install in 3 different modes: 1. For the "backend", a daemon, install: - `python setup.py --backend install` + `python setupall.py --daemon` Then, you can run the daemon with `cd scripts; python joinmarketd.py ` 2. For the client code, using joinmarket's own bitcoin library on the command line: - `python setup.py --client-bitcoin install` + `python setupall.py --client-bitcoin` If you have installed this "full" version of the client, you can use it with the command line scripts as explained in the [scripts README](https://github.com/AdamISZ/joinmarket-clientserver/tree/master/scripts). @@ -53,7 +53,7 @@ command line scripts as explained in the [scripts README](https://github.com/Ada 3. For the client code, using another bitcoin backend library (currently only Electrum supported, see https://github.com/AdamISZ/electrum-joinmarket-plugin for details): - `python setup.py --client-only install` + `python setupall.py --client-only` You can then access the library via `import jmclient`. In particular the jmclient.Taker class must be instantiated. diff --git a/jmbase/__init__.py b/jmbase/jmbase/__init__.py similarity index 100% rename from jmbase/__init__.py rename to jmbase/jmbase/__init__.py diff --git a/jmbase/bigstring.py b/jmbase/jmbase/bigstring.py similarity index 100% rename from jmbase/bigstring.py rename to jmbase/jmbase/bigstring.py diff --git a/jmbase/commands.py b/jmbase/jmbase/commands.py similarity index 100% rename from jmbase/commands.py rename to jmbase/jmbase/commands.py diff --git a/jmbase/support.py b/jmbase/jmbase/support.py similarity index 100% rename from jmbase/support.py rename to jmbase/jmbase/support.py diff --git a/jmbase/setup.py b/jmbase/setup.py new file mode 100644 index 0000000..afab244 --- /dev/null +++ b/jmbase/setup.py @@ -0,0 +1,13 @@ +from setuptools import setup + + +setup(name='joinmarketbase', + version='0.1', + description='Joinmarket client library for Bitcoin coinjoins', + url='http://github.com/AdamISZ/joinmarket-clientserver/jmbase', + author='Adam Gibson', + author_email='ekaggata@gmail.com', + license='GPL', + packages=['jmbase'], + install_requires=['twisted',], + zip_safe=False) diff --git a/jmbitcoin/__init__.py b/jmbitcoin/jmbitcoin/__init__.py similarity index 100% rename from jmbitcoin/__init__.py rename to jmbitcoin/jmbitcoin/__init__.py diff --git a/jmbitcoin/bci.py b/jmbitcoin/jmbitcoin/bci.py similarity index 100% rename from jmbitcoin/bci.py rename to jmbitcoin/jmbitcoin/bci.py diff --git a/jmbitcoin/secp256k1_deterministic.py b/jmbitcoin/jmbitcoin/secp256k1_deterministic.py similarity index 100% rename from jmbitcoin/secp256k1_deterministic.py rename to jmbitcoin/jmbitcoin/secp256k1_deterministic.py diff --git a/jmbitcoin/secp256k1_main.py b/jmbitcoin/jmbitcoin/secp256k1_main.py similarity index 100% rename from jmbitcoin/secp256k1_main.py rename to jmbitcoin/jmbitcoin/secp256k1_main.py diff --git a/jmbitcoin/secp256k1_transaction.py b/jmbitcoin/jmbitcoin/secp256k1_transaction.py similarity index 100% rename from jmbitcoin/secp256k1_transaction.py rename to jmbitcoin/jmbitcoin/secp256k1_transaction.py diff --git a/jmbitcoin/setup.py b/jmbitcoin/setup.py new file mode 100644 index 0000000..0670144 --- /dev/null +++ b/jmbitcoin/setup.py @@ -0,0 +1,13 @@ +from setuptools import setup + + +setup(name='joinmarketbitcoin', + version='0.1', + description='Joinmarket client library for Bitcoin coinjoins', + url='http://github.com/AdamISZ/joinmarket-clientserver/jmbitcoin', + author='Adam Gibson', + author_email='ekaggata@gmail.com', + license='GPL', + packages=['jmbitcoin'], + install_requires=['secp256k1',], + zip_safe=False) diff --git a/jmclient/__init__.py b/jmclient/jmclient/__init__.py similarity index 100% rename from jmclient/__init__.py rename to jmclient/jmclient/__init__.py diff --git a/jmclient/blockchaininterface.py b/jmclient/jmclient/blockchaininterface.py similarity index 100% rename from jmclient/blockchaininterface.py rename to jmclient/jmclient/blockchaininterface.py diff --git a/jmclient/btc.py b/jmclient/jmclient/btc.py similarity index 100% rename from jmclient/btc.py rename to jmclient/jmclient/btc.py diff --git a/jmclient/client_protocol.py b/jmclient/jmclient/client_protocol.py similarity index 100% rename from jmclient/client_protocol.py rename to jmclient/jmclient/client_protocol.py diff --git a/jmclient/commitment_utils.py b/jmclient/jmclient/commitment_utils.py similarity index 100% rename from jmclient/commitment_utils.py rename to jmclient/jmclient/commitment_utils.py diff --git a/jmclient/configure.py b/jmclient/jmclient/configure.py similarity index 100% rename from jmclient/configure.py rename to jmclient/jmclient/configure.py diff --git a/jmclient/jsonrpc.py b/jmclient/jmclient/jsonrpc.py similarity index 100% rename from jmclient/jsonrpc.py rename to jmclient/jmclient/jsonrpc.py diff --git a/jmclient/old_mnemonic.py b/jmclient/jmclient/old_mnemonic.py similarity index 100% rename from jmclient/old_mnemonic.py rename to jmclient/jmclient/old_mnemonic.py diff --git a/jmclient/podle.py b/jmclient/jmclient/podle.py similarity index 100% rename from jmclient/podle.py rename to jmclient/jmclient/podle.py diff --git a/jmclient/schedule.py b/jmclient/jmclient/schedule.py similarity index 100% rename from jmclient/schedule.py rename to jmclient/jmclient/schedule.py diff --git a/jmclient/slowaes.py b/jmclient/jmclient/slowaes.py similarity index 100% rename from jmclient/slowaes.py rename to jmclient/jmclient/slowaes.py diff --git a/jmclient/socks.py b/jmclient/jmclient/socks.py similarity index 100% rename from jmclient/socks.py rename to jmclient/jmclient/socks.py diff --git a/jmclient/support.py b/jmclient/jmclient/support.py similarity index 100% rename from jmclient/support.py rename to jmclient/jmclient/support.py diff --git a/jmclient/taker.py b/jmclient/jmclient/taker.py similarity index 100% rename from jmclient/taker.py rename to jmclient/jmclient/taker.py diff --git a/jmclient/wallet.py b/jmclient/jmclient/wallet.py similarity index 100% rename from jmclient/wallet.py rename to jmclient/jmclient/wallet.py diff --git a/jmclient/setup.py b/jmclient/setup.py new file mode 100644 index 0000000..522c559 --- /dev/null +++ b/jmclient/setup.py @@ -0,0 +1,13 @@ +from setuptools import setup + + +setup(name='joinmarketclient', + version='0.1', + description='Joinmarket client library for Bitcoin coinjoins', + url='http://github.com/AdamISZ/joinmarket-clientserver/jmclient', + author='Adam Gibson', + author_email='ekaggata@gmail.com', + license='GPL', + packages=['jmclient'], + install_requires=['joinmarketbase'], + zip_safe=False) diff --git a/jmdaemon/__init__.py b/jmdaemon/jmdaemon/__init__.py similarity index 100% rename from jmdaemon/__init__.py rename to jmdaemon/jmdaemon/__init__.py diff --git a/jmdaemon/daemon_protocol.py b/jmdaemon/jmdaemon/daemon_protocol.py similarity index 100% rename from jmdaemon/daemon_protocol.py rename to jmdaemon/jmdaemon/daemon_protocol.py diff --git a/jmdaemon/enc_wrapper.py b/jmdaemon/jmdaemon/enc_wrapper.py similarity index 100% rename from jmdaemon/enc_wrapper.py rename to jmdaemon/jmdaemon/enc_wrapper.py diff --git a/jmdaemon/irc.py b/jmdaemon/jmdaemon/irc.py similarity index 100% rename from jmdaemon/irc.py rename to jmdaemon/jmdaemon/irc.py diff --git a/jmdaemon/message_channel.py b/jmdaemon/jmdaemon/message_channel.py similarity index 100% rename from jmdaemon/message_channel.py rename to jmdaemon/jmdaemon/message_channel.py diff --git a/jmdaemon/orderbookwatch.py b/jmdaemon/jmdaemon/orderbookwatch.py similarity index 100% rename from jmdaemon/orderbookwatch.py rename to jmdaemon/jmdaemon/orderbookwatch.py diff --git a/jmdaemon/protocol.py b/jmdaemon/jmdaemon/protocol.py similarity index 100% rename from jmdaemon/protocol.py rename to jmdaemon/jmdaemon/protocol.py diff --git a/jmdaemon/socks.py b/jmdaemon/jmdaemon/socks.py similarity index 100% rename from jmdaemon/socks.py rename to jmdaemon/jmdaemon/socks.py diff --git a/jmdaemon/setup.py b/jmdaemon/setup.py new file mode 100644 index 0000000..1d874ac --- /dev/null +++ b/jmdaemon/setup.py @@ -0,0 +1,13 @@ +from setuptools import setup + + +setup(name='joinmarketdaemon', + version='0.1', + description='Joinmarket client library for Bitcoin coinjoins', + url='http://github.com/AdamISZ/joinmarket-clientserver/jmdaemon', + author='Adam Gibson', + author_email='ekaggata@gmail.com', + license='GPL', + packages=['jmdaemon'], + install_requires=['libnacl', 'joinmarketbase'], + zip_safe=False) diff --git a/setup.py b/setup.py deleted file mode 100644 index f6d7137..0000000 --- a/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -from setuptools import setup -import sys -if '--client-only' in sys.argv: - sys.argv.remove('--client-only') - setup(name='joinmarketclient', - version='0.1', - description='Joinmarket client library for Bitcoin coinjoins', - url='http://github.com/Joinmarket-Org/joinmarket-client', - author='Adam Gibson', - author_email='ekaggata@gmail.com', - license='GPL', - packages=['jmbase', 'jmclient'], - install_requires=['twisted',], - zip_safe=False) -elif '--client-bitcoin' in sys.argv: - sys.argv.remove('--client-bitcoin') - setup(name='joinmarketclient', - version='0.1', - description='Joinmarket client library for Bitcoin coinjoins', - url='http://github.com/Joinmarket-Org/joinmarket-client', - author='Adam Gibson', - author_email='ekaggata@gmail.com', - license='GPL', - packages=['jmbase', 'jmbitcoin', 'jmclient'], - install_requires=['twisted', 'secp256k1'], - zip_safe=False) - -elif '--backend' in sys.argv: - sys.argv.remove('--backend') - setup(name='joinmarketdaemon', - version='0.1', - description='Joinmarket daemon for Bitcoin coinjoins', - author='Adam Gibson', - author_email='ekaggata@gmail.com', - license='GPL', - packages=['jmbase','jmdaemon'], - install_requires=['libnacl', 'twisted'], - zip_safe=False) -else: - raise Exception("Invalid arguments") diff --git a/setupall.py b/setupall.py new file mode 100644 index 0000000..2a5d7e3 --- /dev/null +++ b/setupall.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +from __future__ import print_function +import sys, os, subprocess + +"""A script to install in one of 3 modes: +(a) daemon - installs jmbase, jmdaemon +(b) client-only - installs jmbase, jmclient +(c) client-bitcoin - installs jmbase, jmclient, jmbitcoin + +Note that b and c are distinct mainly due to the fact that +the latter requires the secp256k1 (libsecp256k1 via the secp256k1-py binding), +which is something that would be an annoyance if you don't need it (wallets). +While only (a) has a similarly annoying dependency on libnacl as the binding +to libsodium. +All modes require and install twisted. +""" + +def help(): + print("Usage: python setupall.py \n" + "Mode is one of:\n" + "`--daemon` - for joinmarketd\n" + "`--client-only` - for client not using joinmarket's own bitcoin code\n" + "`--client-bitcoin` - using joinmarket bitcoin code, installs secp256k1.") + sys.exit(0) + +if len(sys.argv) != 2: + help() + +curdir = os.getcwd() + +mode = sys.argv[1] + +packages = {"--daemon": ["jmbase", "jmdaemon"], + "--client-only": ["jmbase", "jmclient"], + "--client-bitcoin": ["jmbase", "jmbitcoin", "jmclient"]} +if mode not in packages: + help() + +for x in packages[mode]: + dirtorun = os.path.join(curdir, x) + p = subprocess.Popen(['python', 'setup.py', 'install'], cwd=dirtorun) + p.wait()