- node.js 16.x
- npm v7 and above
You will need a PostgreSQL connection string with full permissions.
Create a file named database.json
at the project root with the following contents:
{
"dev": {
"driver": "pg",
"user": "<user>",
"password": "<password>",
"host": "<host>",
"database": "<database>",
"ssl": true
}
}
See db-migrate
docs for more information.
Note that this database can take some time to update the first time, so feel free to use one of the dumps to get started.
Create a .env
file with the following contents:
ENDPOINT=<comma-separated list of endpoint names>
DB_CONNECTION=<comma-separated list of indexer connection strings>
PORT=<optional, default 3000>
CACHE_DB_CONNECTION=<cache connection string>
REDIS_URL=<redis connection string>
# Don't run cache updates, optional
# NO_UPDATE_CACHE=1
For example:
ENDPOINT=mainnet,testnet
DB_CONNECTION=postgres://user:pass@mainnet_host/db_name,postgres://user:pass@testnet_host/db_name
CACHE_DB_CONNECTION=postgres://user:pass@cache_host/db_name
REDIS_URL=redis://host:port
NO_UPDATE_CACHE=1
You can use the public indexer endpoints found here.
Node:
$ npm run start
Docker:
$ docker-compose up