The easiest way to run local aftok infrastructure is using Docker and
docker-compose. Several steps are necessary to set up your local environment
for development.
Obtaining Docker Images
-----------------------
The docker-compose setup requires 4 images:
* `aftok/aftok-server:latest`
* `nginx/nginx:latest`
* `postgres/postgres:9.4`
* `electriccoinco/zcashd:v4.0.0`
You can obtain these images by running the following. This assumes the use of
`sudo` under Linux; this may not be necessary on other platforms (e.g. OSX).
~~~bash
make build-image # build the aftok-server image(s)
docker pull nginx/nginx:lates
docker pull postgres/postgres:9.4
docker pull electriccoinco/zcashd:v4.0.0
~~~
If you have problems building the aftok-server image, you can also obtain
a prebuilt image by running
~~~bash
docker pull aftok/aftok-server:latest
~~~
Configuration Files
-------------------
A number of configuration files are required for docker-compose to be able
to run all of the necessary containers successfully. You should create
a `local` directory, which will have the following contents:
~~~
local
├── conf
│ ├── nginx
│ │ ├── mime.types
│ │ └── nginx.conf
│ ├── nginx-certs
│ │ ├── aftok.crt
│ │ └── aftok.key
│ ├── server
│ │ ├── aftok.bip70-chain.cert.pem
│ │ ├── aftok.bip70.key.pem
│ │ ├── aftok.cfg
│ │ ├── aftok-migrations.cfg
│ │ └── snap-site-key
│ └── zcashd
│ ├── zcash-data
│ │ └── zcash.conf
│ └── zcash-params
└── db-dumps
└── aftok.sample.plsql
~~~
Sample default versions of each of these files can be found in the `conf`
directory; you can simply use the following to set up your local environment: