Before jumping into the Dapp code you need to setup an Ethereum wallet. There are bunch of wallet applications and types outher, but for this project we're going to use Metamask.
A wallet is an application that let's you interact with your Ethereum account. You're wallet is the one that works as a gate between the Dapp and your data, through it the applications can read your balance, send transactions, etc.
You can swap wallet providers at any time or manage multiple accounts in one application. This is because the wallet are non-custodial, meaning that they don't hold your assets, you do.
Just to set some concepts down:
There are different types of Wallets:
Instructor: [0:00] Before jumping into the decentralized application or dApp code, you need to set up an Ethereum wallet. There are multiple wallet applications available out there. For this project, you'll use MetaMask. [0:18] Just to set some concepts down, a wallet is an application that lets you interact with the blockchain. Your wallet is the one that works as a gate between the dApp and the blockchain data. Through it, the applications can perform read and write actions into the blockchain.
[0:41] The wallet manage your account. An account is an entity that can send transactions and store some assets. This entity lives inside the blockchain. The account has a unique address that can be used to send or receive tokens. This address fully identify the account entity. Enough concepts for now. You can continue reading further on the companion documentation for this course.
[1:15] Back to MetaMask. MetaMask will help you to handle the accounts and connect your current user to the blockchain. Go ahead and download the browser extension from here. Set up your account. To do this, click the Get Started button. Now, the Create a Wallet button. Agree with the terms.
[1:40] Create a strong password. This will be your master password to unlock the wallet UI. Agree with the terms and conditions. Click Create. Here, you can watch a quick video about how to secure your wallet. I encourage you to watch it. Copy the secret phrase and store it somewhere safe like a password manager or maybe a piece of paper that you can save away.
[2:09] You're done. Your wallet is ready to be used. Let's change the name of the account so you can quickly identify it. You'll interact with your local network first. For that, your account need some funds.
[2:27] To accomplish this, you can import the accounts generated by the local network script and use the fake tokens associated with them. To do so, first, open MetaMask and enable the use of test networks. This will update a wallet UI and will allow you to choose localhost as a network to connect. Now, you can change the network by choosing the localhost entry in the menu.
[2:56] It's time to import some accounts. Go to the menu and choose import account. There, you can copy and paste one of the private keys that are displayed in the console that is running the local network. You'll import two accounts.
[3:16] The first one will be the owner one. This is represented by the first private key that you can find in the terminal. This will be the owner of the contract. Any other account can be used to represent a user that interacts with it. Rename this account and let's name it tip jar owner. Let's import the second account, copy the private key.
[3:46] Now, you have another account use with the application. Let's rename this account as fake user. The eth balance on this account will be used to deploy the contract in the case of the owner and to interact with the contract for the other user. OK. Now, your wallet and accounts are ready to use.
[4:08] It's time for some svelte.