Skip to content

Commit

Permalink
Merge pull request #20 from wiz/replace-php-with-cloud-cdn
Browse files Browse the repository at this point in the history
Re-implement Markets API service with pre-caching proxy + risq backend
  • Loading branch information
wiz authored Nov 12, 2019
2 parents a9d7e78 + 474f21b commit bcbd4b6
Show file tree
Hide file tree
Showing 67 changed files with 5,599 additions and 6,078 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bitsquare_files/
settings.json
target/
.DS_Store
14 changes: 0 additions & 14 deletions 404.html

This file was deleted.

816 changes: 656 additions & 160 deletions LICENSE

Large diffs are not rendered by default.

69 changes: 27 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,28 @@
# Bisq Markets Website+API
A simple web interface to view Bisq markets.
# Bisq Markets API

Visit https://markets.bisq.network/api for the current API documentation.

## Architecture

This new architecture replaces the previous Bisq node -> JSON file -> PHP frontend. We now use Risq behind a caching reverse-proxy on Google Appengine to serve Bisq Markets data.

## Proxy Caching Scheme

HTTP cache = 60 seconds
memcache = 60 seconds
datastore = forever
```
if (full query URL key exists in memcache)
return response
else
if (query live node succeeds)
insert into memcache + datastore
return response
else // query failed
if (full query URL key exists in datastore)
return response
else // not in datastore
return 502
```
## Demo

This is a bare-bones implementation that reads the JSON files created by Bisq
and publishes an API for web clients to access them.

# Performance, or lack thereof.

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

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.

I have separated the data access classes such that it should be simple to plugin
more efficient strategies.

# Requirements

* Apache or other webserver with php 5.5+
* opcache extension. ( for data caching. will run without, but much slower. )

# Installation

On ubuntu apcu can be installed with:

apt-get install php5-apcu

The website code can then be installed by:

1. git clone this repository to your docroot or somewhere beneath it.
2. cp settings.json.example settings.json
3. edit settings.json and edit the value of "data_dir" to reflect the location of
the Bisq data files on your system.
4. Make sure that Bisq is running with flag --dumpStatistics true

Navigate in your browser to your webserver docroot.

That's it!


# API

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 bcbd4b6

Please sign in to comment.