There are several Ethereum test networks like Ropsten, Rinkeby and Kovan that you can use to deploy your contract to have it publicly available without having to use the mainnet and real ETH. In this course you'll deploy to Rinkeby netwok (but, the process is the same for the other networks).
The first step will be update your Metamask Wallet to connect to the Rinkeby network.
Next, you'll need some test/fake Ethere to use for testing the Dapp in the network, for that you'll need to use a faucet like this one. Just visit that faucet and add your wallet address.
You will also deploy your web application to vercel to see your project live on the internet!
Instructor: [0:01] Your application and a smart contract are ready to shine. First, you need to deploy this code to allow other users to use it. First, you need to deploy your smart contract to the blockchain. [0:17] For this, you need your contracts bytecode. This is generated through the compilation process. Eth to pay for the gas, a deployment script or plug-in, an access to an Ethereum node either by running your own, connecting to a public node, or via an API key using a node service like Infura or Alchemy.
[0:44] In this course, you'll use a service, in this case, Alchemy. You'll use a test network. The first step is to connect your MetaMask wallet to the Goerli test network. Do this directly in the MetaMask UI at the top. Select Goerli. After that, be sure that you are using the main account and not the one you imported from the local chain.
[1:16] Since you need to pay gas to be able to deploy, you need funds in your wallet. This is a test network. You don't want to spend real money. You can use a faucet, a service that can transfer a bit of test tokens for your testing purposes.
[1:40] Go ahead to this URL. This faucet requires that you are logged in to the Alchemy service. Since you'll use Alchemy for deployment, go ahead and create an account. Follow the steps. Fill the required data. After that, check your email to confirm the sign-up process. When that is done, you'll be back in the faucet page. Now, you can enter your wallet address and request some ETH.
[2:17] The transaction could take a bit. You can check the status of the transaction by visiting the block explorer. This site shows you the transaction state, the hash identifier of the transaction, and who participate in it. After that is done, check your wallet. You'll see a bit of Goerli ETH available.
[2:43] Next step is to set up the Alchemy account. Go to alchemy.com. Click Get started. Follow the steps. Select Ethereum. Add the name of your team and the application. Be sure to select the Goerli test network. Create the application. You can skip the payment details for now.
[3:09] After you finish filling the process, you'll be redirected to this dashboard where you can see your API key. Copy the HTTPS URL into your env file in a new variable named alchemyUrl. You also need another environment variable to store your account private key. Don't share this with anyone. You can get this key from MetaMask.
[3:41] Go to Account Details. Click on Export Private Key and your MetaMask password. Then, copy the key into the env file. Now, let's update the Hardhat configuration to add a new network. Add a new entry with the name of the network, the URL, and the accounts from the env file.
[4:08] Also, update the package.json file scripts. At the start of the course, you set up a deploy script to use the RInkeby network. Now, that network is marked as deprecated. Let's change that to use Goerli or even better, name the script as testnet.
[4:28] Now, everything is ready to deploy. Open a terminal. Run the deploy script. Wait for that to be done. Then, copy the new contract address. You need to save that for the application deploy.
[4:47] You can see in MetaMask that the amount of ETH is less than before since you just paid the gas for the deployment transaction. In the Alchemy dashboard, you can see that the smart contract was deployed by checking your application dashboard. Now, it's time to deploy the application.
[5:09] In this course, you'll use Vercel. SvelteKit use what is known as an adopter to allow you to deploy to different platforms.
[5:18] The project is ready to deploy to Vercel. Log in to Vercel with your GitHub account. Fill the GitHub information and the two-factor authentication key. After that, you'll be redirected to Vercel setup. From here, look for your repository. You need the project to be in a GitHub repo by the way.
[5:43] After selecting, set up the environment variables by adding the contract address that you just deployed. Add it to the Vercel UI. You're ready to deploy. Click the Deploy button. Wait for the confetti.
[6:02] After all of these steps, your first decentralized application will be deployed, ready to be used. Go to the dashboard. Click Visit. You'll be welcomed with the UI you just built. Now, you can use your SvelteKit application with a real smart contract deployed to the Ethereum Test Network.