This is an automation platform for Cardano to trigger various action based on detecting payment to a wallet address.
This is an automation platform for Cardano to trigger various action based on detecting payment to a wallet address.
It does not require a full Cardano node and relies on Blockfrost to query & submit transactions.
Works perfectly well on Cardano testnet
as well as mainnet
(quite easy to switch between the two).
Currently, this system lets you create wallets and view contents of each wallet, and it can handle two types of jobs via the api & queue system:
When a payment detected in a wallet, it can trigger a webhook callback.
Example api request:
curl --insecure --location --request POST 'https://localhost:8006/api/v1/job/create' \
--header 'api-access-token: YOUR_API_ACCESS_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "TrackPaymentAndCallback",
"payment_wallet_name": "MyAwesomeWallet",
"expected_lovelace": 1513147,
"callback": {
"request_url": "https://your-callback-site.com/webhook/endpoint",
"request_type": "post",
"request_params": {
"session_id": "asdasdsads",
"profile_id": "a1sdads"
}
}
}
'
When a payment detected in a wallet, it can drop a native asset to a receiver's wallet address.
Example api request:
curl --insecure --location --request POST 'https://localhost:8006/api/v1/job/create' \
--header 'api-access-token: YOUR_API_ACCESS_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "TrackPaymentAndDropAsset",
"payment_wallet_name": "Gifts",
"drop_wallet_name": "MyDrops",
"expected_lovelace": 2716755,
"drop": {
"policy_id": "dcc407a706ed1fbcbc2304b340b65c970371d41c135f0bc75b2ec562",
"asset_name": "LatheesanTestCoin",
"quantity": 20,
"receiver_address": "addr_test1qp2t365a9pz4vcper0rr43vrxzeyky96rmgpxkeertyp6gt6jeraypygwzs8ymmcvgvx8cphjlwp0w2xguarthk5ta6sey2d75"
}
}
'
Example success response:
{
"code": 201,
"status": "Created",
"data": {
"message": "Job successfully created & scheduled",
"job_id": 11
}
}
Example error response:
{
"code": 400,
"status": "Bad Request",
"data": "Insufficient asset quantity \"dcc407a706ed1fbcbc2304b340b65c970371d41c135f0bc75b2ec562.LatheesanTestCoin\" in the drop wallet, cannot drop 2000000 because there are only 99950 left"
}
Tested well on latest Ubuntu operating system, using 1 GB RAM and 2 GB SWAP
git clone https://github.com/adosia/Heidrun.git && cd Heidrun
make self-signed-ssl
env/mysql.example
as env/mysql
and env/web.example
as env/web
and modify the values as requiredmake build
make
Commandsbuild
Rebuild all docker containersup
Restart all docker containersdown
Shutdown all docker containerscomposer-install
Run composer installdb-migrate
Run database migration(s)db-refresh
Drop all database tables, re-run the migration(s) with seedsadmin-account
Create a new Heidrun admin accountstatus
View the status of all running containerslogs
View the logs out of all running containersshell
Drop into an interactive shell inside heidrun-web containerstats
View the resource usage of all running containersartisan
Execute Laravel artisan
command inside heidrun-web containerself-signed-ssl
Generates new apache compatible self-signed SSL certificatestestnet
and mainnet
env/web
and update CARDANO_NETWORK
environment variable
Possible values are
testnet
ormainnet
make up
to restart the containers with new environmentenv/mysql
and update MYSQL_ROOT_PASSWORD
and MYSQL_PASSWORD
environment variablesIf you change
MYSQL_PASSWORD
don't forget to updateenv/web
and changeDB_PASSWORD
to match this
make down
to shut down all containersdocker volume prune
and select yes
to delete all volumesmake up
to start the containers up againNote: Sometimes laravel caches application config, so changing the env/web
and restarting the container isn't enough.
I recommend running php artisan config:clear
inside the web container using make shell
command.
make shell
and type php artisan key:generate --show
commandenv/web
and change APP_KEY
environment variablephp arisan migrate:fresh --seed
(inside the web container) to drop the database and re-run the migrations and re-seed the admin accountDrop
wallet in a single transaction, the system is not cleaver enough (yet) to deal with multiple native assets on a single UTXODrop
wallet🗹 Authentication
🗹 Manage Wallets
🗹 Manage API Access Token (via Settings)
🗹 Track Payment And Callback
🗹 Track Payment And Drop Asset
☐ Manage Admins
☐ Manage Queue
☐ Migrate some of the constants as configurabe settings on the GUI
☐ Handle multiple native assets in a single utxo