Migrating tokens on HTS from testnet to mainnet
Feb 26, 2021
by Cooper Kunz
Developer Evangelist

After four weeks, Hedera21 has officially ended with over 600 participants and 50+ projects submitted. We had 8 challenges from our sponsors Google, eftpos, Bitgo, DLA Piper, BCW, Chopra Foundation, UCL, Armanino — each bringing an exciting opportunity for hackers to build something new with the Hedera Token Service.

A huge congratulations to those that participated and submitted projects. The closing ceremony will be hosted on March 2nd, via livestream, where we will announce the winners.

Migrating to mainnet

Now that you’ve finished your Hedera21 project, here is a step-by-step guide to migrating to the public Hedera mainnet.

1. Get a mainnet account

You can get a Hedera account by signing up at portal.hedera.com and going through an identity verification process. If you’d rather, you can check out one of the 3rd party wallets that enable account creation and allow you to export your keys.

2. Make sure you have HBAR in it!

When using the Hedera mainnet, each transaction and (most) queries will cost you actual real live HBAR, the network’s native cryptocurrency. In order to have a sufficient amount of HBAR in your wallet for your use case, you will need to visit one of the numerous on-ramps that support HBAR. You can purchase HBAR on an on-ramp, and transfer them into your wallet.

3. Change your client configuration

When using the testnet, our SDKs allow you to easily bootstrap a client configuration by doing the following:

Client.forTestnet().setOperator(yourTestnetAccountId, yourTestnetPrivateKey);

Which will allow you to connect your account to one of the testnet nodes at random. By simply changing this configuration to:

Client.forMainnet().setOperator(yourMainnetAccountId, yourMainnetPrivateKey);

It will choose one of the mainnet nodes at random, by default

4. Change any mirror node APIs you’re using

Often, applications building on Hedera needs access to historical data. For this, they would typically use a mirror node. When migrating to the mainnet, be sure that your APIs are also configured for the right network.

For example, if you’re using Kabuto, the REST API should change from: https://api.testnet.kabuto.sh/v1/

To point to their mainnet services: https://api.mainnet.kabuto.sh/v1/

5. Migrate your custom application/infrastructure

After you have completed steps 1-4, the Hedera “side” of your integration should be relatively complete. Other things to consider are API keys, gRPC API subscriptions if you’re using the Hedera Consensus Service, and how frequently you may need to “top up” your wallet with more HBAR to pay for network fees.

For this step, you will also need to migrate any of your other infrastructures, whether it’s your mobile applications or website, to a production environment and follow standard security practices. This step will depend on the technologies you used in your solution and change on a case by case basis.

Once you have done this, your application should be ready for production!

Hedera21 Closing Ceremonies

We couldn't have been more proud to see some of the high-quality projects built using the Hedera Token Service over the past four weeks, and hope you're able to join us on March 2nd to find out the winners!

View the Hedera21 project gallery.

Register for the closing ceremonies livestream.