Use Dubhe to develop a contract
Let’s develop one of the simplest examples, called Distributed Messaging, or dms for short. The contract will have a schema called message, which will have a field called content, which will store the message content. The contract will have a method called send, which will take a string as a parameter and store it in the content field of the mailbox schema. The contract will also have an event called MessageSent, which will be triggered when a message is sent. Dubhe generates some code based on the dubhe.config.ts configuration, so we just need to focus on this file.- name: The name of the contract project.
- description: The description of the contract project.
- schemas: The schema of the contract project. Refer to the Schemas section for details of schema.
StorageValue, which is used to store String.
Now we need to generate the contract frame content using Dubhe’s most powerful feature.
Hello World!.