CKB Cache Layer is used as the cache layer of Synapse extension, it caches cell and block data from CKB blockchain and providing query service.
If you want to use it for local development with Synapse extension.
- Start ckb node and miner
https://docs.nervos.org/docs/basics/guides/devchain
- Start ckb-cache-layer (this project)
git clone [email protected]:rebase-network/ckb-cache-layer.git
yarn
cp .env.example .env
yarn pretypeorm
docker-compose up -d
yarn db:mig:g
yarn db:mig:r
yarn start:dev
You will see the following logs if you are running successfully:
updateBlockInfo: 37.671ms
****************** End block 1 ******************
updateBlockInfo: 26.848ms
****************** End block 2 ******************
cp .env.example .env
yarn pretypeorm
docker-compose up -d
yarn db:mig:g
yarn db:mig:r
yarn build
yarn start:prod
Go to /api
to test api with swagger UI
# unit tests
yarn test
# e2e tests
yarn test:e2e
# test coverage
yarn test:cov