Skip to content

Commit

Permalink
Delete old PHP codebase, make room for new Angular web frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz committed Sep 23, 2020
1 parent bb7accb commit 4451789
Show file tree
Hide file tree
Showing 53 changed files with 859 additions and 5,873 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
bitsquare_files/
settings.json
14 changes: 0 additions & 14 deletions 404.html

This file was deleted.

77 changes: 13 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,25 @@
# Bisq Markets Website+API
A simple web interface to view Bisq markets.
# Bisq Markets API+Website

This is a bare-bones implementation that reads the JSON files created by Bisq
and publishes an API for web clients to access them.
A website to visualize and explore Bisq Markets data, powered by the Mempool backend which can serve Bisq Markets API data.

# Performance, or lack thereof.
Bisq Markets API documentation: https://bisq.markets/api

At present, no database is used and backend operations are very inefficient.
## API Backend

This is OK for the moment as there is little Bisq data, but the implementation
will need to be optimized when Bisq volume picks up.
First, build [Bisq](https://github.com/bisq-network/bisq) from source as normal, and run the `./bisq-statsnode` entrypoint with `--dumpStatistics=true --dumpBlockchainData=true` - after it finishes syncing the Bisq data, it should create some JSON files in your `./btc_mainnet/db/json/` folder such as `trade_statistics.json`.

I have separated the data access classes such that it should be simple to plugin
more efficient strategies.
Then, install the [Mempool Explorer](https://github.com/mempool/mempool)'s production configuration as normal, and assuming your Bisq home directory is `/bisq`, enable the Bisq Markets API in your backend `mempool-config.json` as follows:

# Requirements

* Ubuntu 18.04 LTS

# Installation

First, [setup your Bisq Seednode](https://github.com/bisq-network/bisq/tree/master/seednode#bisq-seed-node) so you have Bisq running and fully synced. Then, run the intallation script from this repo to install Bisq Markets API into the Apache webroot.

```bash
curl -s https://raw.githubusercontent.com/bisq-network/bisq-markets/master/install_bisq_markets_debian.sh | sudo bash
```
Navigate in your browser to your webserver docroot.

# Let's Encrypt

You'll need to open ports 80 and 443 on your firewall for HTTP and HTTPS
```bash
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
```

Request an SSL certificate for your server's hostname using certbot
```bash
sudo apt-get install -y python-certbot-apache
sudo certbot --apache -d markets.example.com
```

# CORS headers (optional)

If necessary, add this to your apache2.conf in the `<VirtualHost>` section:
```
Header always set Access-Control-Allow-Origin "*"
```

If not already enabled, you will need to enable the Headers module by doing
```
ln -s /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled/
"BISQ_ENABLED": true,
"BISQ_BLOCKS_DATA_PATH": "/bisq/statsnode-data/btc_mainnet/db/json",
"BISQ_MARKET_ENABLED": true,
"BISQ_MARKETS_DATA_PATH": "/bisq/statsnode-data",
```

# Tweaks for scaling (optional)
Mempool will get the Bisq Markets data from your bisq-statsnode in the JSON files and serve it over the API. You should be able to access `/api/offers?market=bsq_btc` or other Bisq Market APIs.

Recommended to set in /etc/php/7.2/apache2/php.ini
```
memory_limit = 512M
```

Recommended to set in /etc/apache2/mods-available/mpm_prefork.conf
```
<IfModule mpm_prefork_module>
StartServers 20
MinSpareServers 10
MaxSpareServers 20
MaxRequestWorkers 30
MaxConnectionsPerChild 0
</IfModule>
```
## Angular web frontend

# API
TBD as part of https://github.com/bisq-network/projects/issues/41

For now, just check out the API subdirectory. docs are todo.
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

27 changes: 0 additions & 27 deletions api/.htaccess

This file was deleted.

94 changes: 0 additions & 94 deletions api/README.md

This file was deleted.

1 change: 0 additions & 1 deletion api/VERSION

This file was deleted.

50 changes: 0 additions & 50 deletions api/currencies/apidoc.php

This file was deleted.

34 changes: 0 additions & 34 deletions api/currencies/index.php

This file was deleted.

47 changes: 0 additions & 47 deletions api/depth/apidoc.php

This file was deleted.

Loading

0 comments on commit 4451789

Please sign in to comment.