This boilerplate is designed to easily build ExpressJS applications usin ckBTC (a Bitcoin pair) on ICP.
- Build REST API on chain
- Work with SQL databases
- Persist database on chain
- Make ckBTC transactions
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
Run the following command:
# only for mac
codesign -s - .bitcoin/bin/bitcoin-cli
npm run btc:mint --address=$ADDRESS
After minting, call the endpoint PUT /users/:userId/balance
to update the account balance.
Then, you can verify the account balance in this endpoint: GET /users/:userId/balance