Upload the program to the blockchain
In this lesson, you'll learn how to upload a program using the "Upload program" option in the Gear Idea portal.
To begin, create an account and connect to Gear Idea.
Next, choose the network where you want to upload the program.
After selecting the testnet node, follow these steps to upload the program:
- Select the file you'd like to upload.
- Add a *.meta.txt file.
- Set the program's name and greeting message.
- Confirm the upload.
Once the upload is successful, you'll interact with your program by sending messages and accessing its current state, including the greeting message you set during initialization.
The easiest way to upload the program is to use the "Upload program" option in the Gear Idea portal: https://idea.gear-tech.io.
First, you need to create an account and connect to Gear Idea. Follow the instructions provided at https://wiki.gear-tech.io/docs/idea/account/create-account to create your account.
After logging in, you can choose the network where you wish to upload the program. Click the gear icon located in the bottom-left corner of the screen.
To access the Gear Academy, opt for the Vara Stable Testnet node (wss://testnet.vara.rs
) and click the Switch button.
Select the workshop node and click on the Switch button:
Get the test balance by clicking on the button in the top right corner:
Select Programs in the left column and click on the Upload program button:
Choose the file hello_world.opt.wasm
located in the target/wasm32-unknown-unknown/release
folder:
Then add the hello_world.meta.txt
file located in the project root:
Enter the name for your program (for example, Hello_World
) and set the greeting message:
If the program uploads successfully, you'll see it in the programs section.
You can now send messages to your program:
You can also read the program state (click on the Read full state button):
It's the greeting string set during the program initialization.