PolkAuction core is an HTTP API exposing a set of endpoints providing data from Polkadot and Kusama relay-chains. Those data are focused on comprehensive parachain, crowdloan and auction information for any app, user, client to use. The data provided by the API are both from on-chain and off-chain.
- Kotlin
- Ktor
- Koin
- Exposed
- MySQL
- Docker (version 19.03+)
- Java (version 17+)
- Kotlin (1.6+)
- Maven (3.8+ recommended)
We are open to contributions, ideas, issues, etc. Feel free to open a PR or an issue.
For both the issue and the PR, a context is necessary.
In order to run Polk-auction-core, a few things need to be running before:
-
Create the network if it does not exist already :
docker network create polkadot
Note: You can use the sidecar API with either your own node or with a node with a public endpoint. Nodes that are running from a new volume will need quite some time to update the blockchain until its current head block. This is why public nodes are used in the configuration. For testing and quick usage we recommend using the public node (see here). If you wish to use the sidecar API with your own node instead, refer to this section.
-
Update and run the container
docker-compose -f "docker/polkadot/docker-compose.yml" up -d --build sidecar
-
Create the volume if it does not exist already :
docker volume create polkadot-node
-
Change the value of the
SAS_SUBSTRATE_WS_URL
environment variable tows://polkadot-node:9944
(located here) -
Update and run the containers
docker-compose -f "docker/polkadot/docker-compose.yml" up -d --build
-
Create the network if it does not exist already :
docker network create kusama
Note: You can use the sidecar API with either your own node or with a node with a public endpoint. Nodes that are running from a new volume will need quite some time to update the blockchain until its current head block. This is why public nodes are used in the configuration. For testing and quick usage we recommend using the public node (see here). If you wish to use the sidecar API with your own node instead, refer to this section.
-
Update and run the containers
docker-compose -f "docker/kusama/docker-compose.yml" up -d --build sidecar
-
Create the volume if it does not exist already :
docker volume create kusama-node
-
Change the value of the
SAS_SUBSTRATE_WS_URL
environment variable tows://kusama-node:9944
(located here) -
Update and run the containers
docker-compose -f "docker/kusama/docker-compose.yml" up -d --build
-
Create the network if it does not exist already :
docker network create database
-
Update and run the containers
docker-compose -f "docker/database/docker-compose.yml" up -d --build
Before running locally, you will need to generate an SSL certificate. With the current configuration you can run the following command to generate a self-signed certificate :
keytool -keystore keystore.jks -alias polkauctionStore -keypass foobar -storepass foobar -genkeypair -keyalg RSA -keysize 4096 -validity 36500 -dname 'CN=localhost, OU=ktor, O=ktor, L=Unspecified, ST=Unspecified, C=US'
docker build -t polk-auction-core .
docker-compose -f "docker/polkauction-core/docker-compose.yml" up -d --build
mvn clean install
To run the test, run the following command :
mvn test
Once everything is running fine, you can access the API using the following url : http://localhost:8080 (if running locally or on docker - can be changed in the application configuration or using an environment variable). Refer to the documentation for the available endpoints.