Ecency vision – API
- node ^12.0.0
- yarn
$ git clone https://github.com/ecency/vision-api
$ cd vision-api
$ yarn
$ nano src/config.ts
PRIVATE_API_ADDR- private api endpointPRIVATE_API_AUTH- private api authHIVESIGNER_SECRET- hivesigner client secretSEARCH_API_ADDR- hivesearcher api endpointSEARCH_API_SECRET- hivesearcher api auth tokenCHAINSTACK_API_KEY- Chainstack API key used to enumerate nodes and request balances directly from each network-specific endpoint.CHAINZ_API_KEY- Chainz API key used to perform balance lookups when the Chainz provider is requested.BLOCKSTREAM_CLIENT_ID- OAuth client identifier used to request temporary access tokens for the Blockstream Explorer Enterprise API fallback.BLOCKSTREAM_CLIENT_SECRET- OAuth client secret paired with the client identifier for generating Blockstream access tokens.
$ yarn start
- Make sure to branch off your changes from
mainbranch. - Make sure to run
yarn testand add tests to your changes. - Code on!
You can use official ecency/api:latest image to run Vision locally, deploy it to staging or even production environment. The simplest way is to run it with following command:
docker run -it --rm -p 3000:3000 ecency/vision:latestConfigure the instance using following environment variables:
PRIVATE_API_ADDRPRIVATE_API_AUTHHIVESIGNER_SECRETSEARCH_API_ADDRSEARCH_API_SECRETCHAINSTACK_API_KEYCHAINZ_API_KEYBLOCKSTREAM_CLIENT_IDBLOCKSTREAM_CLIENT_SECRET
docker run -it --rm -p 3000:3000 -e PRIVATE_API_ADDR=https://api.example.com -e PRIVATE_API_AUTH=verysecretpassword ecency/api:latestYou can easily deploy a set of vision instances to your production environment, using example docker-compose.yml file. Docker Swarm will automatically keep it alive and load balance incoming traffic between the containers:
docker stack deploy -c docker-compose.yml vision-apiTo report a non-critical issue, please file an issue on this GitHub project.
If you find a security issue please report details to: [email protected]
We will evaluate the risk and make a patch available before filing the issue.