Skip to content

Commit

Permalink
Merge pull request #8 from BlockchainCommons/development-signed
Browse files Browse the repository at this point in the history
Development signed
  • Loading branch information
ChristopherA authored Aug 7, 2020
2 parents 6d45d27 + e109f20 commit 100d0b6
Show file tree
Hide file tree
Showing 6 changed files with 468 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Created by https://www.gitignore.io/api/macos

### Config files, database files, logs###
.config
.conf
.db
.log
.onion

### macOS ###
# General
.DS_Store
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ All of these Python libraries can be installed via pip.
Spotbit aims to provide an easy option for aggregating exchange data that does not require the use of a third party data website like Coinmarketcap. These data can be used inside of other apps or for personal use / analysis. Acquiring data across many exchanges can be a pain because normally one would need write slightly different code in order to interact with each API. Additionally, the use of local storage means that data can always be served quickly even while new data are being downloaded. Spotbit runs two separate threads - one with the Flask webserver, and another that makes API requests to exchanges to update the local database.

### Derived from…

This Spotbit project is inspired by the need of Fully Noded 2 to display realtime price info in-app:

This Spotbit project is either derived from or was inspired by the need of Fully Noded 2 to display realtime price info in-app::
This Spotbit project is either derived from or was inspired by the need of Fully Noded 2 to display realtime price info in-app:

- [FullyNoded 2](https://github.com/BlockchainCommons/FullyNoded-2) — The mobile app for managing a BTC node via Tor, by [Fonta1n3](https://github.com/Fonta1n3).

Expand Down
70 changes: 70 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

# Install script for Spotbit
# By Christian Murray
# Blockchain Commons
# To run this script, make it executable using `chmod +x install.sh` then `./install.sh`
# This script is intended for debian based systems with bash as the default shell

# Check if the user running the script is root - taken from bitcoin standup
if ! [ "$(id -u)" = 0 ]
then
echo "$0 - You need to be logged in as root!"
exit 1

fi

# install python dependencies
# need to force python3.8 as well
pip install -r requirements.txt

################################################################################################################################
#install tor - Below lines taken from Bitcoin standup
# To use source lines with https:// in /etc/apt/sources.list the apt-transport-https package is required. Install it with:
sudo apt install apt-transport-https
# We need to set up our package repository before you can fetch Tor. First, you need to figure out the name of your distribution:
DEBIAN_VERSION=$(lsb_release -c | awk '{ print $2 }')
# You need to add the following entries to /etc/apt/sources.list:
#cat >> /etc/apt/sources.list << EOF
#deb https://deb.torproject.org/torproject.org $DEBIAN_VERSION main
#deb-src https://deb.torproject.org/torproject.org $DEBIAN_VERSION main
#EOF
# Then add the gpg key used to sign the packages by running:
#sudo apt-key adv --recv-keys --keyserver keys.gnupg.net 74A941BA219EC810
#sudo wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import
#sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
# Update system, install and run tor as a service
#sudo apt update
#sudo apt install tor deb.torproject.org-keyring
################################################################################################################################
# TODO support btc standup by not wiping out that config if it is already there, use an if statement (the lmsith version)
mkdir /var/lib/tor/Spotbit
chown -R debian-tor:debian-tor /var/lib/tor/Spotbit
chmod 700 /var/lib/tor/Spotbit
echo '# setup for Spotbit service' >> /etc/tor/torrc
echo 'HiddenServiceDir /var/lib/tor/Spotbit' >> /etc/tor/torrc
echo 'HiddenServicePort 80 127.0.0.1:5000' >> /etc/tor/torrc
echo 'HiddenServiceVersion 3' >> /etc/tor/torrc

# start the tor service after we're done
echo "starting tor"
systemctl daemon-reload
service tor stop
service tor start

################################################################################################################################
# Copy the default config to file
if test -f "~/.spotbit/spotbit.config"; then
echo "configs already configured"
else
mkdir ~/.spotbit
touch ~/.spotbit/spotbit.config
cat spotbit_example.config >> ~/.spotbit/spotbit.config
fi

# show the URL of the hidden service
echo "waiting 2 minutes for tor to finish bootstrapping."
sleep 2m
echo "hidden service onion address (located at /var/lib/tor/Spotbit):"
cat /var/lib/tor/Spotbit/hostname

5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Requirements for running Spotbit ##
celery
flask
sqlite
ccxt
Loading

0 comments on commit 100d0b6

Please sign in to comment.