honorableCon / azle-api-rest-icp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Azle REST API with ckBTC Integration

Run Locally

Clone the project

  git clone https://github.com/adrian-d-hidalgo/azle-api-rest-ckbtc

Go to the project directory

  cd azle-api-rest-ckbtc

Install dependencies

  npm install
# only for mac
codesign -s - .bitcoin/bin/bitcoind
npm run btc:start

In another terminal run:

npm run icp:start

Open another terminal and run:

npm run icp:deploy:local

How to mint ckBTC

Run the following command:

# only for mac
codesign -s - .bitcoin/bin/bitcoin-cli
# Run three times this command, but wait 1 second between each exacution
npm run btc:mint --address=$ADDRESS

Wait for 5 around seconds and make a request to POST /users/:userId/balance

Then, you can verify the user balance in this endpoint:

GET /users/:userId/balance

About


Languages

Language:TypeScript 66.6%Language:Shell 33.4%