Alzymologist / Kalatori-backend

Kalatori daemon to handle chain-to-webstore interaction
GNU General Public License v3.0
0 stars 6 forks source link
backend blockchain commerce daemon polkadot substrate webstore

A gateway daemon for Kalatori

Download

Compiled binaries for Linux x86-64 can be found in the "Releases" section.

Compile from the source

To compile the daemon, the latest stable Rust compiler version is required. Then run the following command:

cargo b -r --workspace

Compiled binaries can be found in the target/release path.

Structure & settings

The daemon for Kalatori consists of 2 variants:

Both variants have almost the same startup environment variables:

Examples

A tipical command to run kalatori for the Polkadot chain may look like this:

KALATORI_HOST="127.0.0.1:16726" \
KALATORI_SEED="bottom drive obey lake curtain smoke basket hold race lonely fit walk" \
KALATORI_DATABASE="database.redb" \
KALATORI_RPC="wss://rpc.polkadot.io" \
KALATORI_DECIMALS="12" \
KALATORI_DESTINATION="0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" \
kalatori

And a command to run kalatori-ahfor the Polkadot AssetHub chain may look like this:

KALATORI_HOST="127.0.0.1:16726" \
KALATORI_SEED="bottom drive obey lake curtain smoke basket hold race lonely fit walk" \
KALATORI_DATABASE="database-ah-usdc.redb" \
KALATORI_RPC="wss://polkadot-asset-hub-rpc.polkadot.io" \
KALATORI_DESTINATION="0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" \
KALATORI_USD_ASSET="USDC"
kalatori-ah

Testing

Chopsticks can be used to test the daemon out on a copy of a real network. This repository contains 2 config examples for testing:

- Polkadot

Use the following command inside this repository root directory to run Chopstick with the Polkadot config example:

npx @acala-network/chopsticks@latest -c chopsticks/pd.yml

Then run kalatori with KALATORI_RPC set on the Chopsticks default server:

KALATORI_HOST="127.0.0.1:16726" \
KALATORI_SEED="bottom drive obey lake curtain smoke basket hold race lonely fit walk" \
KALATORI_RPC="ws://localhost:8000" \
KALATORI_DECIMALS="12" \
KALATORI_DESTINATION="0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" \
kalatori

- Polkadot Asset Hub

Use the following command inside this repository root directory to run Chopstick with the Polkadot Asset Hub config example:

npx @acala-network/chopsticks@latest -c chopsticks/pd-ah.yml

Then run kalatori-ah with KALATORI_RPC set on the Chopsticks default server, and KALATORI_USD_ASSET set on the USD asset being tested:

KALATORI_HOST="127.0.0.1:16726" \
KALATORI_SEED="bottom drive obey lake curtain smoke basket hold race lonely fit walk" \
KALATORI_RPC="ws://localhost:8000" \
KALATORI_DESTINATION="0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d" \
KALATORI_USD_ASSET="USDC"
kalatori-ah