- Upload this program to the Vara Test Network using
https://idea.gear-tech.io
- Develop a backend service with the following functionality
- Send
Ping
message to the uploaded program on request and save the sent message with its id to the database - Receive a response from the program and save it to the database
- On request, give statistics on the number of messages sent,
Pong
message received from the program and error messages received from the program.
- Send
@gear-js/api
- library for working with blockchain
@polkadot/api
- library necessary for @gear-js/api
work.
How to send a message to a program
How to calculate gas to send a message
How to listen to blockchain events
To receive response from the program you need to listen to UserMessageSent
event
How to create a keyring to sign a transaction
How to get metadata of a program
Metadata is necessary for encoding and decoding messages sent/received to/from the program
test_task.opt.wasm
- code of the program
test_task.meta.txt
- metadata of the program
Types of the program messages:
String
- type of the message to be sent to the program
Result<String, u16>
- type of the message that program sends in response