Step 9: Deploying to the Internet Computer Mainnet
In this step, we’ll deploy our project to the Internet Computer mainnet. This involves a few key steps:
Topping Up Your Wallet with Cycles
Before deploying to the mainnet, you’ll need to ensure that your wallet has enough cycles.
-
Quickstart: Run
dfx quickstart
in your terminal and follow the process to top up your wallet. -
Faucet Cycles: Alternatively, you can get some free cycles from the DFINITY cycles faucet.
Deploying the Canister
Run the following command to deploy your canister to the mainnet:
yarn deploy --network=ic
Alternatively, you can choose to deploy only the backend to the mainnet and run the frontend locally. To deploy just the backend, use:
yarn deploy hello --network=ic
To run the frontend locally, execute:
yarn dev
Upon successful deployment of the backend, you should see output similar to this in your terminal:
Testing on Mainnet
-
Open the Frontend: If you’ve deployed the frontend to the mainnet, navigate to the frontend URL provided in the terminal. If you’re running the frontend locally, you can access it via
http://localhost:3000
or the URL provided in your local development server. -
Initiate a Transaction: Initiate a deposit transaction and confirm it.
-
Check Alchemy Logs: Open your Alchemy dashboard to check the logs. You should see 13 different calls to the JSON-RPC, which collect consensus on the result and then send it to your canister. This ensures that you can trust the whole process as a successful payment.
Here’s what you should see: