The purpose of this api backend is to provide a single API for the Provenance Blockchain Explorer frontend, aggregate and cache information needed by the front end (e.g. simplify multiple block/transaction calls into a single call), and provide Provenance Blockchain specific endpoints.
Necessary tools
- Git
- GO lang
- comes with Make
- LevelDB
- NPM
- Docker
- Docker-compose
- Clone provenance public repo -> https://github.com/provenance-io/provenance
- Navigate to the repo folder
- Run
make clean ; make build; make localnet-start
- This allows you to stand up 4 nodes in a local cluster
- This allows you to stand up 4 nodes in a local cluster
- If you want to enable the swagger
- go to
build/node0/config/app.toml
- edit the file at
# Swagger defines if swagger documentation should automatically be registered. swagger = false <- set to true
- run
make localnet-start
- go to
- To stop the cluster, run
make localnet-stop
- Run
git fetch --all; git checkout {tag_you_want}; make clean install;
- TODO: Fill in the rest
- Clone explorer-service public repo -> https://github.com/provenance-io/explorer-service
- Navigate to the repo folder
- Run
./scripts/dc.sh up
- To get an existing database up again, run
./scripts/dc.sh up-cached
- To get an existing database up again, run
- Go to
service/src/main/resources/application.properties
- Make sure the following properties are as follows:
explorer.mainnet=false explorer.pb-url=http://localhost:9090
- Run from command line
sh ./gradlew -------------> Installs the gradlew stuff ./gradlew clean ./gradlew build ./gradlew bootRun -Dspring.profiles.active=development
- Clone explorer-frontend public repo -> https://github.com/provenance-io/explorer-frontend
- Navigate to the repo folder
- Run
npm install
- Run
npm run local
- Navigate to http://localhost:3000/explorer
- Run
docker-compose -f docker/docker-compose.yml up
- This stands up dockers for database, service and frontend.
Useful to hit the respective APIs directly
Swagger for Explorer : http://localhost:8612/swagger-ui/index.html
Swagger for Testnet: http://localhost:1317/swagger/
We use Ktlint for our linting use -> https://pinterest.github.io/ktlint/rules/standard/
Currently on version 0.47.1
To install the Kotlin linter run:
brew install ktlint
In order to automatically lint/check for things that can't be autocorrected run:
ktlint -F "**/*.kt" --disabled_rules=filename,chain-wrapping,enum-entry-name-case,multiline-if-else
This will also correct linting issues, and you can add and commit the updates.
There is a GHA that checks for linting issues, and produces a report on the associated PR.