Skip to content

Small DAPP creating a token and a faucet with React and Motoko

Notifications You must be signed in to change notification settings

Gabo-Tech/Web3-Token-and-Faucet

Repository files navigation

DGABO TOKEN

Web Mockup

Getting Started

Hi everyone! This is my personal cryptotoken it's real, though it's not deployed and publicly available due to expensive blockchain fees. You can claim your free tokens by just pressing a button.

You want to own this website?

On the other hand if you'd like to host this website on your local machine just clone this repository with git clone https://github.com/Gabo-Tech/Web3-Token-and-Faucet.git. just copy and paste that command on your terminal and keep scrolling to see how to set up the DFINITY enviorment.

Deployment

Even though this is been develop to run in the cheapest blockchain (The Internet Computer), it's still quite expensive for me to deploy this into the real blockachian, but you can download it and run the emulator, keep scrolling to see the instructions.

Built With

  • JavaScript - The web programming languaje
  • Motoko - Let's code smart contracts!
  • HTML - Your favourite Markup Languaje
  • CSS - Used to stylize this awesome website
  • React - The "reactive" library

Contributing

Like, share, subscribe, follow and join my Patreon! Just kidding this is totally for free.

Authors

  • Gabriel Clemente, aka Gabo, your favourite web developer. - Initial work - Gabo

License

This project is licensed under the Creative Commons Public Domain License - Feel free to copy the code, I did it too.


Creative Commons Public Domain License

This meme represents you


Acknowledgments

  • Thanks to Angela Yu, it's been the best teacher I ever had, I learn most of the things I know with her.

Intruction to create the enviorment to run this DAPP

In this link

Check your Balance

  1. Find out your principal id:
dfx identity get-principal
  1. Save it somewhere.

e.g. My principal id is: gwtbp-s23g7-ymbe4-6qdr7-ft2wt-gmv57-ixsas-evm7o-q2jae-uxyht-fae

  1. Format and store it in a command line variable:
OWNER_PUBLIC_KEY="principal \"$( \dfx identity get-principal )\""
  1. Check that step 3 worked by printing it out:
echo $OWNER_PUBLIC_KEY
  1. Check the owner's balance:
dfx canister call token balanceOf "( $OWNER_PUBLIC_KEY )"

Charge the Canister

  1. Check canister ID:
dfx canister id token
  1. Save canister ID into a command line variable:
CANISTER_PUBLIC_KEY="principal \"$( \dfx canister id token )\""
  1. Check canister ID has been successfully saved:
echo $CANISTER_PUBLIC_KEY
  1. Transfer half a billion tokens to the canister Principal ID:
dfx canister call token transfer "($CANISTER_PUBLIC_KEY, 1_000_000_000_000_000)"

Deploy the Project to the Live IC Network

  1. Create and deploy canisters:
dfx deploy --network ic
  1. Check the live canister ID:
dfx canister --network ic id token
  1. Save the live canister ID to a command line variable:
LIVE_CANISTER_KEY="principal \"$( \dfx canister --network ic id token )\""
  1. Check that it worked:
echo $LIVE_CANISTER_KEY
  1. Transfer some tokens to the live canister:
dfx canister --network ic call token transfer "($LIVE_CANISTER_KEY, 50_000_000)"
  1. Get live canister front-end id:
dfx canister --network ic id token_assets
  1. Copy the id from step 6 and add .raw.ic0.app to the end to form a URL. e.g. zdv65-7qaaa-aaaai-qibdq-cai.raw.ic0.app