Skip to content

Commit

Permalink
init Graphene
Browse files Browse the repository at this point in the history
  • Loading branch information
serdrdoor committed Nov 3, 2021
1 parent 44588f0 commit 029124e
Show file tree
Hide file tree
Showing 34 changed files with 161 additions and 278 deletions.
25 changes: 5 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
sudo: true
services:
- docker
matrix:
include:
- os: linux
Expand All @@ -13,21 +11,10 @@ matrix:
python: '3.7'
before_install:
- python3 --version
before_install:
# Make sure docker image can be built
- docker build -t dexbot/dexbot .
- docker pull bitshares/bitshares-core:testnet
install:
- python3 -m pip install --upgrade pip
- pip install --upgrade setuptools
- make install
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then python3 -m pip install -r requirements-dev.txt ; fi
before_script:
# PEP8 linting
- make pep-test
- echo "Running mandatory tests..."
# Travis on mac doesn't support docker
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then pytest -m mandatory tests/ &&
python3 -m pip uninstall -y -r requirements-dev.txt; fi
script:
- pip install pyinstaller
- pyinstaller --distpath dist/$TRAVIS_OS_NAME gui.spec
Expand All @@ -39,13 +26,11 @@ before_deploy:
deploy:
- provider: releases
skip_cleanup: true
body: Automated release from Travis CI with added files from AppVeyor build
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=
secure: aVRcq/JDh7HoGcDrjZoKWaGZr1Ie7hxzxzYGNqb8p7F7rWuTSanlEZRQ+4mq2lAFq+ase9lycyZXu1KFKSf7iEGBeqMudMOVVc2j87sQEH7MKKX/bZrapvw4mxvu+kGJQXpNI70tB6hJmVvNtZpleqsiFs0i2R2pAnVvmVajxfxoXrmz68oS172HGdQ2RzuPE7fjvK8JclJ10jd1dfD82XEo6GkX9TqDe2NhaMZvf/ROKhSC35C2DnTKWuSAI7zGcX8GbcSqlskCJYdDv5fgE2banUDuzJuT4TmsEvfIMa7+xnaDStBq7zxEiLPNq0wTZEbrdY9jV/IhWKjOFaI58LGHOedA4dvUKiMuXF4FtBjhUC4UGNwn9g0wZU/q/GtiyRzRXgQ9JYCfM5r1UDkh+4xm2VB7NQ1NoA7ajidamqBamRmHdh0wZI6NwtKYPjGEX1QUBNlt3HXvpLU26j39gjMcduj8kiFh05RlWq41EgbQAPMR1256nw9yGRrnTA7M9QEfmjNvpb4CT1FWmBDtkALzskLSZOts4iZ6vQvWGZkntd7IeZ9Rr4ImX99vZIwYWNL9n6VJW75VlwF/E0Uxqxs8WkYUDFayfySxADpVwkmiR9d3cahzu9UbqVHzH8a0Uvko9TxIHhTjep/ER5dXu2cSObdTqKRp1FRQksI8/Oo=
file: dist/*.tar.gz
file_glob: true
draft: 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=
tags: true
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ WORKDIR $SRC_PATH

# Install dependencies in separate stage to speed up further builds
COPY requirements.txt $SRC_PATH/
RUN python3 -m pip install -U pip
RUN python3 -m pip install --user -r requirements.txt

# Copy project files
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# DEXBot

[![Build Status (master)](https://travis-ci.org/Codaone/DEXBot.svg?branch=master)](https://travis-ci.org/Codaone/DEXBot)
[![Build Status (master)](https://travis-ci.org/graphene-blockchain/DEXBot.svg?branch=graphene)](https://travis-ci.org/graphene-blockchain/DEXBot)
[![Documentation
Status](https://readthedocs.org/projects/dexbot/badge/?version=latest)](https://dexbot.readthedocs.io/en/latest/?badge=latest)

**Download the latest release for Windows, OSX and Linux from [here!](https://github.com/Codaone/DEXBot/releases/latest)**
**Download the latest release for Windows, OSX and Linux from [here!](https://github.com/graphene-blockchain/DEXBot/releases/latest)**

The Dashboard of the GUI version of DEXBot: ![GUI](https://i.imgur.com/rW8XKQ4.png)
The Dashboard of the GUI version of DEXBot: ![GUI](https://i.imgur.com/dc2FYum.png)

The CLI version of DEXBot in configuration dialog: ![CLI](https://i.imgur.com/H1N96nI.png)
The CLI version of DEXBot in configuration dialog: ![CLI](https://i.imgur.com/RUSv92q.png)

A Trading Bot provided with two very flexible Market Making strategies. Works on "vanilla" BitShares and all exchanges built upon it. Can be customized with additional strategies written in Python3.
A Trading Bot provided with two very flexible Market Making strategies. Works on "vanilla" Graphene and all exchanges built upon it. Can be customized with additional strategies written in Python3.

DEXBot was paid for by the BitShares blockchain (by means of a Worker Proposal), and managed by "The Cabinet", consisting of 6 active BitShares community members. All spending was controlled by an account which requires 3/5 approvals (multisig scheme).

DEXBot can be installed from source or by using the excecutable packages for Windows, OSX, and Linux. Packages include the GUI version, but installation from source provides also the CLI version, which can be used on headless servers and Raspberry Pi's.

Expand All @@ -26,7 +25,7 @@ If you properly predict future market conditions, you can manage to make profit.

## Installing and running the software

See instructions in the [Wiki](https://github.com/Codaone/DEXBot/wiki) for [Linux](https://github.com/Codaone/DEXBot/wiki/Setup-Guide-for-Linux), [Windows](https://github.com/Codaone/DEXBot/wiki/Setup-Guide-for-Windows), [OSX](https://github.com/Codaone/DEXBot/wiki/Setup-Guide-for-Mac-OS-X). [Raspberry Pi](https://github.com/Codaone/DEXBot/wiki/Setup-guide-for-Raspberry-Pi). Other users can try downloading the package or following the Linux guide.
See instructions in the [Wiki](https://github.com/graphene-blockchain/DEXBot/wiki) for [Linux](https://github.com/graphene-blockchain/DEXBot/wiki/Setup-Guide-for-Linux), [Windows](https://github.com/graphene-blockchain/DEXBot/wiki/Setup-Guide-for-Windows), [OSX](https://github.com/graphene-blockchain/DEXBot/wiki/Setup-Guide-for-Mac-OS-X). [Raspberry Pi](https://github.com/graphene-blockchain/DEXBot/wiki/Setup-guide-for-Raspberry-Pi). Other users can try downloading the package or following the Linux guide.

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

Expand All @@ -37,26 +36,26 @@ directories inside the container as shown below.

```
mkdir dexbot-data dexbot-config
docker run -it --rm -v `pwd`/dexbot-data:/home/dexbot/.local/share dexbot/dexbot:latest uptick addkey
docker run -it --rm -v `pwd`/dexbot-config:/home/dexbot/.config/dexbot -v `pwd`/dexbot-data:/home/dexbot/.local/share dexbot/dexbot:latest dexbot-cli configure
docker run -it --rm -v `pwd`/dexbot-data:/home/dexbot/.local/share blckchnd/dexbot:latest uptick addkey
docker run -it --rm -v `pwd`/dexbot-config:/home/dexbot/.config/dexbot -v `pwd`/dexbot-data:/home/dexbot/.local/share blckchnd/dexbot:latest dexbot-cli configure
```

To run in unattended mode you need to provide wallet passphrase:

```
docker run -d --name dexbot -e UNLOCK=pass -v `pwd`/dexbot-config:/home/dexbot/.config/dexbot -v `pwd`/dexbot-data:/home/dexbot/.local/share dexbot/dexbot:latest dexbot-cli run
docker run -d --name dexbot -e UNLOCK=pass -v `pwd`/dexbot-config:/home/dexbot/.config/dexbot -v `pwd`/dexbot-data:/home/dexbot/.local/share blckchnd/dexbot:latest dexbot-cli run
```

Assuming you have created a Docker secret named "passphrase" in your swarm, you can also get it from there:

```
printf <pass> | docker secret create passphrase -
docker run -d --name dexbot -e UNLOCK=/run/secrets/passphrase -v `pwd`/dexbot-config:/home/dexbot/.config/dexbot -v `pwd`/dexbot-data:/home/dexbot/.local/share dexbot/dexbot:latest dexbot-cli run
docker run -d --name dexbot -e UNLOCK=/run/secrets/passphrase -v `pwd`/dexbot-config:/home/dexbot/.config/dexbot -v `pwd`/dexbot-data:/home/dexbot/.local/share blckchnd/dexbot:latest dexbot-cli run
```

## Getting help

Join the [Telegram Chat for DEXBot](https://t.me/DEXBOTbts).
Join the [Telegram Chat for DEXBot Graphene](https://t.me/graphene_dex).

## Contributing

Expand All @@ -69,8 +68,8 @@ pip install -r requirements-dev.txt
pre-commit install
```

* [New Contributors Guide](https://github.com/Codaone/DEXBot/wiki/New-Contributors-Guide)
* [Git Workflow](https://github.com/Codaone/DEXBot/wiki/Git-Workflow)
* [New Contributors Guide](https://github.com/graphene-blockchain/DEXBot/wiki/New-Contributors-Guide)
* [Git Workflow](https://github.com/graphene-blockchain/DEXBot/wiki/Git-Workflow)

# IMPORTANT NOTE

Expand Down
19 changes: 10 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ environment:
#---------------------------------#

install:
- ps: Start-FileDownload 'https://www.python.org/ftp/python/3.6.6/python-3.6.6-amd64.exe'
- copy python-3.6.6-amd64.exe installer\windows\bundle\prerequisites\python-3.6.6.exe
- ps: Start-FileDownload 'https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe'
- copy python-3.6.8-amd64.exe installer\windows\bundle\prerequisites\python-3.6.8.exe
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%;C:\MinGW\bin
- copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe
- copy c:\Python36-x64\python.exe c:\Python36-x64\python3.exe
- python --version
- python3 -m pip install --upgrade pip
- make install
- make package
- copy /Y dist\DEXBot-gui.exe installer\windows\msi\DEXBot.exe
Expand Down Expand Up @@ -58,20 +59,20 @@ clone_depth: 1

deploy:
- provider: GitHub
draft: false
draft: true
prerelease: false
force_update: true
auth_token:
secure: 9qvwlVUHFBV4GwMz1Gu2HSnqU8Ex2nv5dsY4mVNCurrb+6ULIoHPgbvJPWTo3qV6
secure: FclZCFdQUXRI1M8zSdKMTaKd45ZsQ8J4NhpYmMGOBG6kZ14init5b1WmyRajBuFD
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'
#notifications:
# - provider: Slack
# auth_token:
# secure: G9OMj9l2s3+lX8cRiNXXhuQJpnnjcBc0cqP8gzkdKVWqGA8vBTOIPGxD/536VKpeBH/5dJFQWT+vmnGS+XciaCg4hh5s6hDpnvePq2+uEYE=
# channel: '#ci'
2 changes: 1 addition & 1 deletion dexbot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_NAME = 'dexbot'
VERSION = '1.0.0'
AUTHOR = 'Codaone Oy'
AUTHOR = 'Graphene'
__version__ = VERSION
14 changes: 7 additions & 7 deletions dexbot/cli_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ def configure_dexbot(config, ctx):
('NEW', 'Create a new worker'),
('EDIT', 'Edit a worker'),
('DEL_WORKER', 'Delete a worker'),
('ADD', 'Add a bitshares account'),
('DEL_ACCOUNT', 'Delete a bitshares account'),
('SHOW', 'Show bitshares accounts'),
('ADD', 'Add a graphene account'),
('DEL_ACCOUNT', 'Delete a graphene account'),
('SHOW', 'Show graphene accounts'),
('NODES', 'Edit Node Selection'),
('ADD_NODE', 'Add Your Node'),
('SORT_NODES', 'By latency (uses default list)'),
Expand Down Expand Up @@ -358,11 +358,11 @@ def configure_dexbot(config, ctx):
elif action == 'SHOW':
account_list = list_accounts(bitshares_instance)
if account_list:
action = whiptail.menu("Bitshares Account List (Name - Type)", account_list)
action = whiptail.menu("Graphene Account List (Name - Type)", account_list)
else:
whiptail.alert('You do not have any bitshares accounts in the wallet')
whiptail.alert('You do not have any graphene accounts in the wallet')
elif action == 'ADD_NODE':
txt = whiptail.prompt("Your name for the new node: e.g. wss://dexnode.net/ws")
txt = whiptail.prompt("Your name for the new node: e.g. wss://node.gph.ai")
# Insert new node on top of the list
config['node'].insert(0, txt)
elif action == 'NODES':
Expand All @@ -387,7 +387,7 @@ def configure_dexbot(config, ctx):
# delete node permanently from config
setup_systemd(whiptail, config)
elif action == 'HELP':
whiptail.alert("Please see https://github.com/Codaone/DEXBot/wiki")
whiptail.alert("Please see https://github.com/graphene-blockchain/DEXBot/wiki")

whiptail.clear()
return config
Expand Down
19 changes: 5 additions & 14 deletions dexbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,9 @@ def tree():
def node_list(self):
"""A pre-defined list of Bitshares nodes."""
return [
"wss://bitshares.openledger.info/ws",
"wss://openledger.hk/ws",
"wss://na.openledger.info/ws",
"wss://ws.gdex.top",
"wss://api.bts.ai",
"wss://api-ru.bts.blckchnd.com",
"wss://bts-seoul.clockwork.gr",
"wss://btsfullnode.bangzi.info/ws",
"wss://api.fr.bitsharesdex.com",
"wss://btsws.roelandp.nl/ws",
"wss://kc-us-dex.xeldal.com/ws",
"wss://dallas.us.api.bitshares.org/ws",
"wss://siliconvalley.us.api.bitshares.org/ws",
"wss://toronto.ca.api.bitshares.org/ws",
"wss://node.gph.ai",
"wss://gph.lexai.host",
"wss://node.graphenelab.io",
"wss://gph-api.xchng.finance",
"wss://node.hk.graphene.fans",
]
Binary file modified dexbot/resources/img/dexbot-icon.ico
Binary file not shown.
Binary file modified dexbot/resources/img/dexbot-icon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dexbot/resources/img/dexbot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 029124e

Please sign in to comment.