⚠️ This service is currently in /v0. Breaking changes are coming in /v1 (also possible, but not likely, within /v0 releases). Please use with caution.
This is an API aimed at retrieving data from blockchain quickly and conveniently. We support public APIs for:
Visit /docs for Swagger documentation.
It is possible to create your own instance of this service. To do so, follow the guide below.
The service uses following environment variables:
| Env variable | Default | Required | Description |
|---|---|---|---|
PORT | 3000 | NO | HTTP service port |
PGHOST | YES | Postgres host address | |
PGPORT | 5432 | NO | Postgres port |
PGDATABASE | YES | Postgres database name | |
PGUSER | YES | Postgres user name | |
PGPASSWORD | YES | Postgres password | |
PGPOOLSIZE | 20 | NO | Postgres pool size |
LOG_LEVEL | info | NO | Log level ['info','warn','error'] |
PGPOOLSIZE is used by the pg-pool library to determine Postgres connection pool size per NodeJS process instance. A good value depends on your server and db configuration and can be found empirically. You can leave it at the default value to start with.
Set those variables to a variables.env file in the root of the project for convenience. In the next steps we will assume this file exists.
If you would like to use some other way of setting environment variables, just replace relevant commands below with custom alternatives.
docker build -t wavesplatform/data-service .
docker run -p=<port>:3000 --env-file=variables.env wavesplatform/data-service
A server will start at localhost:<port> (used in the docker run command). Logs will be handled by Docker. Use any other Docker options if necessary.
When using the container in production, we recommend establishing a Docker logging and restart policy.
npm install # or `yarn install`, if you prefer
export $(cat variables.env | xargs) && NODE_ENV=production node src/index.js
Server will start at localhost:PORT (defaults to 3000). Logs will be directed to stdout.
If you decide to use NodeJS directly (without Docker), we recommend using a process manager, such as pm2.
To add candles and pairs functionality the following Docker daemons must be used:
docker-compose --scale can help with that, or it can be done manually. A good rule of thumb is to use as many instances as CPU cores available.PGPOOLSIZE also can help performance.Content type
Image
Digest
Size
109.8 MB
Last updated
over 5 years ago
docker pull wavesplatform/data-service