Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Codaone/DEXBot into easyc…
Browse files Browse the repository at this point in the history
…onfig

Conflicts:
	dexbot/basestrategy.py
	dexbot/bot.py
	dexbot/cli.py
	dexbot/ui.py
	setup.py
  • Loading branch information
ihaywood3 committed May 28, 2018
2 parents a540f0b + d6e7f72 commit aa6f244
Show file tree
Hide file tree
Showing 60 changed files with 3,405 additions and 1,711 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ deprecated
*.yml
venv/
.idea/
dexbot/views/ui/*_ui.py
dexbot/views/ui/**/*_ui.py
dexbot/resources/*_rc.py
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
sudo: true
matrix:
include:
- os: linux
language: python
python: '3.6'
- os: osx
language: generic
before_install:
- python --version
- brew upgrade python
install:
- make install
script:
- echo "@TODO - Running tests..."
- pyinstaller --distpath dist/$TRAVIS_OS_NAME gui.spec
- pyinstaller --distpath dist/$TRAVIS_OS_NAME cli.spec
before_deploy:
- git config --local user.name "Travis"
- git config --local user.email "[email protected]"
- git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"
- tar -czvf dist/DEXBot-$TRAVIS_OS_NAME.tar.gz dist/$TRAVIS_OS_NAME/*
deploy:
- provider: releases
skip_cleanup: true
api_key:
secure: YHAPA2G3qu7at2hMu4AplXH/niI1ChlgldJVetaKO92iDQiyOk5VqFfhV1ec+nYdX8rtniwfD7YJr2nG2x1ATwKw4MyFcJEXqaOUmKWTeZ/Q3PnQQsa+2BnN4Rfz1aynpsKHDYS9gCU/YTqymujE8bdlxW1WtpYOqOSDkspGxZGZTiUKQ7/qhrjB3Dywm/KF9WEoba/X7tbhmSuU8sL45gBGY008TXZRWqAPM42qa/aBIrG/cIA865VlCUltPC6vzskcWI5q1UtYh6g2CiXJghcpFEO2rWWXmS1A+5nQp6ptJigjRgnhyFHmHb27lRM8aRGRDTeyJvlNuoyIvNj/FxhLXZvomgTyGyzTIl67WIXcxWMKx6KqqrqGyiooRMeFpDEYobZL/FY9whi3M+gUwsofAVQ6oL4a1L185egaXlMKGbM5GYB4OxVLsVtL2c0pJjvNIkCGGDzaqNpdo+vZflB4iCwvw548rWJsqsHnP1XMo28ZU86hibD7V0x+JW2BJEI0lMvOkRBslOhYBafIsbZakO4Zf4d+5b2dd8/xY/wTbuxwgDuBOmpqoByVYeCBah4bbnb8JS6eze+vUyxaI1XLAdQXbLQ788Agr2jdHGuy1wI8io9g5vtzS5oOyq8YFBM1tVKM2Mtw5nkSsTbPJsZg8m/kkre6qiXJl2gPQTE=
file: dist/*.tar.gz
file_glob: true
on:
tags: true
notifications:
email: false
slack:
secure: iQwBqvwq0HmEODoWI52pnNi2trfZ4ly5/fDPmkr6Ez8z9rm5XQ3CBLtpH7JpNdkyen5r+dVTczJDIOTBLpXwe/AzwFKLqZc/0pkXnxzNSENnm++/G6uqS0u5fMdYSoR4fJC1zjzEj2ly11OdS+wX3y9//hD13U96u3iO6T/7EXU2VYt82wekziJXzyfK4JeJMs1L5M2Oz7ZBwiHeAZ/3ZNjKE+9TX7S/mlmG+bNiQhv/wSin2AnsB1recgFjp17ZHq4cW+K77TDnRlPZ0bVsOhGYUtMlW9llidXZbunLj3qITIDl7dufowBG95PTHh+L2KDcPv7UCxlN02kXWuz3nL47UwD7BZcLMJ0RLYk4g+qNBrytgrmhH82gdmenzCQ4PgHI/U1/8hgiEyGlBZWUTXrso5EF3VBRUhCtu8dG/F+rdGHSfK1mZQyDPe6my9E888TvfcWWCpVNammAZicrGWU9nY3Rqn7DFodBL896iFPs1DJD5fTF1th6hHEyRSuKZC80irFZRoxccDPuDYVIfPExJH328tFeh75WOuzQt4QCBFiOsiFDlCYhnQ8tNw/MWntPQHwY8PkUlvpvelPCgfh73ihXtMD61/6Hq+lOijkGFhEzgpqmzL4mSUd/EQRJHLE9lAVvRGdrzlaIV6f4CirJkZSAgf4LuYDl2JMZ3kE=
4 changes: 3 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
The MIT License (MIT)

Copyright (c) 2017 ChainSquad GmbH
Copyright for portions of project DEXBot are held by ChainSquad GmbH 2017
as part of project stakemachine. All other copyright for project DEXBot
are held by Codaone Oy 2018.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include *.md
include dexbot/resources/img/*
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.PHONY: clean-pyc clean-build docs

clean: clean-build clean-pyc
clean: clean-build clean-pyc clean-ui

clean-ui:
find dexbot/views/ui/*.py ! -name '__init__.py' -type f -exec rm -f {} +

clean-build:
rm -fr build/
Expand All @@ -13,10 +16,13 @@ clean-pyc:
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +

pip:
python3 -m pip install -r requirements.txt

lint:
flake8 dexbot/

build:
build: pip
python3 setup.py build

install: build
Expand All @@ -29,10 +35,14 @@ git:
git push --all
git push --tags

check:
check: pip
python3 setup.py check

dist:
package: build
pyinstaller gui.spec
pyinstaller cli.spec

dist: build
python3 setup.py sdist upload -r pypi
python3 setup.py bdist_wheel upload

Expand Down
27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@
# DEXBot

Trading Bot for the BitShares Decentralized Exchange
(DEX).
Trading Bot for the BitShares Decentralized Exchange (DEX).

**Warning**: This is highly experimental code! Use at your OWN risk!

## Installation
## Build status

git clone https://github.com/codaone/dexbot
cd dexbot
python3 setup.py install
# or
python3 setup.py install --user
master:
[![Build Status](https://travis-ci.org/Codaone/DEXBot.svg?branch=master)](https://travis-ci.org/Codaone/DEXBot)

## Configuration

Configuration happens in `config.yml`

## Requirements
**Warning**: This is highly experimental code! Use at your OWN risk!

Add your account's private key to the pybitshares wallet using `uptick`
## Installing and running the software

uptick addkey
See instructions in the [Wiki](https://github.com/Codaone/DEXBot/wiki/Installing-and-Running)

## Execution
## Contributing

dexbot run
Install the software, use it and report any problems by creating a ticket.

# IMPORTANT NOTE

Expand Down
30 changes: 0 additions & 30 deletions app.spec

This file was deleted.

64 changes: 64 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: 0.1.{build}

image: Visual Studio 2015

environment:
matrix:
# Python 3.5.3 - 64-bit
- PYTHON: "C:\\Python35-x64"

#---------------------------------#
# build #
#---------------------------------#

build: off

configuration: Release

install:
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%;C:\MinGW\bin
- copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe
- copy c:\Python35-x64\python.exe c:\Python35-x64\python3.exe
- python --version
- make install

after_test:
- make package
- '7z a DEXBot-win64.zip %APPVEYOR_BUILD_FOLDER%\dist\DEXBot-gui.exe %APPVEYOR_BUILD_FOLDER%\dist\DEXBot-cli.exe'

# @TODO: Run tests..
test_script:
- "echo tests..."

artifacts:
- path: DEXBot-win64.zip
name: DEXBot-win64.zip

#---------------------------------#
# deployment #
#---------------------------------#

shallow_clone: false

clone_depth: 1

deploy:
- provider: GitHub
artifact: DEXBot-win64.zip
draft: false
prerelease: false
force_update: true
auth_token:
secure: 9qvwlVUHFBV4GwMz1Gu2HSnqU8Ex2nv5dsY4mVNCurrb+6ULIoHPgbvJPWTo3qV6
on:
appveyor_repo_tag: true # deploy on tag push only

#---------------------------------#
# notifications #
#---------------------------------#

notifications:
- provider: Slack
auth_token:
secure: G9OMj9l2s3+lX8cRiNXXhuQJpnnjcBc0cqP8gzkdKVWqGA8vBTOIPGxD/536VKpeBH/5dJFQWT+vmnGS+XciaCg4hh5s6hDpnvePq2+uEYE=
channel: '#ci'
3 changes: 2 additions & 1 deletion cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

from dexbot import cli

cli.main()
if __name__ == '__main__':
cli.main()
45 changes: 45 additions & 0 deletions cli.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- mode: python -*-

import os
import sys
block_cipher = None

hiddenimports_strategies = [
'dexbot',
'dexbot.strategies',
'dexbot.strategies.echo',
'dexbot.strategies.relative_orders',
'dexbot.strategies.staggered_orders',
'dexbot.strategies.storagedemo',
'dexbot.strategies.walls',
]

hiddenimports_packaging = [
'packaging', 'packaging.version', 'packaging.specifiers', 'packaging.requirements'
]

a = Analysis(['dexbot/cli.py'],
binaries=[],
datas=[],
hiddenimports=hiddenimports_packaging + hiddenimports_strategies,
hookspath=['hooks'],
runtime_hooks=['hooks/rthook-Crypto.py'],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)

pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name=os.path.join('dist', 'DEXBot-cli' + ('.exe' if sys.platform == 'win32' else '')),
debug=True,
strip=False,
upx=True,
runtime_tmpdir=None,
console=True )
3 changes: 0 additions & 3 deletions config.yml

This file was deleted.

23 changes: 23 additions & 0 deletions dexbot/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pathlib
import os
from appdirs import user_config_dir

APP_NAME = "dexbot"
VERSION = '0.2.3'
AUTHOR = "codaone"
__version__ = VERSION


config_dir = user_config_dir(APP_NAME, appauthor=AUTHOR)
config_file = os.path.join(config_dir, "config.yml")

default_config = """
node: wss://bitshares.openledger.info/ws
workers: {}
"""

if not os.path.isfile(config_file):
pathlib.Path(config_dir).mkdir(parents=True, exist_ok=True)
with open(config_file, 'w') as f:
f.write(default_config)
print("Created default config file at {}".format(config_file))
Loading

0 comments on commit aa6f244

Please sign in to comment.