This is Hotel Reservation DApp, that allows users to be able to make reservations to nice hotels for their trips. Users pay the booking price for the hotel room and the amount is usually calculated by the number of nights the user wishes to stay in the hotel. For testing purposes a night is equivalent to 60 seconds. User's also have to pay a reservation holding fee which is then refunded back to the user after the user ends the reservation, a form of incentive to make users not hold down rooms after their reservation has ended.
-
Start the Local Internet Computer
dfx start --background --clean
-
Deploy the Ledger Canister
npm run deploy-ledger
-
Deploy the Internet Identity Canister
npm run deploy-identity
-
Deploy the Backend Canister
# run with dfx and set the registrationFee in e8s dfx deploy dfinity_js_backend --argument '(record {registrationFee <amount in e8s> })' # or run using npm with preset values # registraionFee = 2_0000_0000 i.e 2 ICP tokens npm run deploy-backend
-
Deploy the Frontend Canister
npm run deploy-frontend
-
Run Frontend Locally
npm run start
This next step shows how to mint icp tokens from the locally deployed Ledger canister.
-
Copy your dfx address from the wallet on the doc reg frontend.
-
Run the mint script.
# npm run mint:tokens <amount in e8s> <dfx address> npm run mint:tokens 5000_0000_0000 4eecc7740bf73f27f68c9f9703adbee7dc41dd1e1a5e316bbff039806550bd79 # N/B: This mints 5000 ICP tokens from the locally deployed ledger to the address.