This repository hosts the source code of ForkDelta backend. The backend provides off-chain orderbook functionality and an API to get a filtered view of Ethereum blockchain events on an EtherDelta-like contract.
Best way to learn about a system is to read the source code. Start with a look at docker-compose.yml.
Requirements:
- Some sort of shell environment
- A reasonably recent version of Docker (>= 17.06, ideally 17.12)
- docker-compose (= 1.18)
- Basic familiarity with Docker keywords: image, container (https://docs.docker.com/get-started/#docker-concepts)
Setup:
- Clone the repo (git clone https://github.com/forkdelta/backend-replacement.git)
- Navigate to the root of the working copy, where the README file is.
- Rename/copy
default.env
file to.env
in root. - Uncomment the
COMPOSE_FILE=
line in.env
to enable mounting of working copy code into the containers. - Build a Docker image containing our backend code:
docker-compose build contract_observer
- Create the database and migrate it to the latest schema:
docker-compose run contract_observer alembic upgrade head
- Run the backend systems:
docker-compose up
. You can shut everything down with Ctrl+C at any time.
Tips:
- There are multiple containers running our backend code:
contract_observer
,etherdelta_observer
,websocket_server
. - Running
docker-compose build <service-name>
for any of the above builds the same image. docker-compose build contract_observer
builds an image, copying the code and installing Python libraries in our dependencies. You have to rebuild any time the dependencies change; however, in development, code in the working copy is mounted into the container, so it's enough to restart the container (withdocker-compose restart <service-name>
) to apply changes for a given service.- You can inspect the list of currently running containers with
docker-compose ps
.
Copyright (C) 2018, Arseniy Ivanov and ForkDelta Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
See the full license.