Building a Cross-Chain ETH Payment and E-Commerce Platform on the Internet Computer: A Step-by-Step Tutorial

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.

  1. Quickstart: Run dfx quickstart in your terminal and follow the process to top up your wallet.

  2. 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

  1. 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.

  2. Initiate a Transaction: Initiate a deposit transaction and confirm it.

  3. 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:

3 Likes