This sample code illustrates how to interact with the exchange rate canister on the Internet Computer.
Note that dfx and npm need to be installed first.
Clone the repository, get the node dependencies, and build the canisters.
git clone [email protected]:THLO/xrc_demo.git
cd xrc_demo/
npm install
dfx buildIf you want to test the demo locally, you can use the following commands:
# Starts the replica, running in the background.
dfx start --background
# Deploys the canisters to the replica and generates the candid interface.
dfx deploy --with-cycles 10000000000000Note that the --with-cycles parameter is required because cycles must be sent
with every request to the exchange rate canister.
Open the link for the xrc_demo to get to the Candid interface.