Bitacle is a ICP Canister(which is not online right now), which made for Dacade's Course.
This contract is used to get the 1 ICP -> BTC currency exchange rate.
- Ic0
- Azle
- @dfinity
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm use 18
DFX_VERSION=0.14.1 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
echo 'export PATH="$PATH:$HOME/bin"' >> "$HOME/.bashrc"
then reload your terminal.
-
Clone the repository:
git clone https://github.com/iamknownasfesal/bitacle.git
-
Install dependencies:
DO NOT USE "npm install" or "pnpm i", ONLY USE "yarn".
cd bitacle-contract yarn cd bitacle-service yarn
-
Start the Internet Computer emulator:
dfx start --clean --background
-
Deploy the canisters:
cd bitacle-contract dfx deploy
click the link on the terminal, should look like this:
bitacle: http://127.0.0.1:4943/?canisterId=bd3sg-teaaa-aaaaa-qaaba-cai&id=bkyz2-fmaaa-aaaaa-qaaaq-cai
-
Create a .env file in bitacle-service like .env.example:
cd bitacle-service touch test vim test
get your canister id from the given link, it should be on top, and create your .env based on .env.example
-
Run the service:
npm run start
-
There you go!
Console can logs errors from canister, if it is "Not Found" errors you shouldn't care about these.
-
You can check rounds from the given dashboard link, look at the section 2
In dashboard, click to query in bottom of getLatestRound, you should be able to get the latest exchange rate, when it got updated and roundId to query next.
- If you encounter any issues with the Internet Computer emulator or DFX, refer to the official documentation.
- If you encounter any issues with the TypeScript code or tests, refer to the source code and the official TypeScript documentation.
That's it! Let me know if you have any questions or need further assistance.