Protocol Messages

Cosmos SDK Messages#

Since the Oraichain blockchain is built from the Cosmos network, it also supports all message types of Cosmos SDK so that they can be delivered to all nodes for execution and querying. For simplicity, all message types follow the same protocol, which are described on the Cosmos SDK documentation

Oraichain Messages#

All Oraichain messages use the same protocol as other Cosmos SDK message types. To support validators running Oracle Scripts, AI Data Source, and AI Testcase, there are other message types implemented on Oraichain as follows:

Oraichain Specific Messages#

Apart from the messages that stems from the Cosmos SDK, Oraichain also supports a number of messages native to its a ai data oracle system. These messages' specification is presented below.

MsgCreateAIDataSource#

Deploys and registers a new AI Data Source to Oraichain. Once registered, the Data Source is assigned a Data Source prefix with its unique name as an identifier which can be used to refer to it forever.

message type: set_datasource

MsgEditAIDataSource#

Edits an existing Data Source given the unique identifier

message type: edit_datasource

QueryResAIDataSource#

When querying, the user only needs to type the name of the Data Source, and the system will return three attributes below in JSON format.

query type: datasource

QueryResAIDataSources#

A list of AI Data Sources with its size will be shown after querying.

query type: datasources

QueryResAIDataSourceNames#

A list of AI Data Source unique identifiers will be shown.

query type: dnames

MsgCreateOracleScript#

Deploys a new Oracle Script to Oraichain's network. Once registered, the script is assigned a unique Oracle Script prefix + name identifier which can be used to refer to it forever.

message type: set_oscript

MsgEditOracleScript#

Edits an existing Oracle Script given the unique identifier which is the name. The sender must be the owner of the Oracle Script for the transaction to succeed.

message type: edit_oscript

QueryResOracleScript#

When querying, the user only needs to type the name of the Oracle Script, and the system will return three attributes below in JSON format.

query type: oscript

QueryResOracleScripts#

A list of Oracle Scripts with its size will be shown after querying.

query type: oscripts

QueryResOracleScriptNames#

A list of AI Data Source unique identifiers will be shown.

query type: onames

MsgCreateTestCase#

message type: set_test_case

MsgEditTestCase#

message type: edit_test_case

QueryResTestCase#

When querying, the user only needs to type the name of the Data Source, and the system will return three attributes below in JSON format.

query type: testcase

QueryResTestCases#

A list of Test Cases with its size will be shown after querying.

query type: testcases

QueryResTestCaseNames#

A list of Test Case unique identifiers will be shown.

query type: tcnames

MsgSetAIRequest#

Requests a new data based on an existing Oracle Script. A data request will be assigned a unique identifier with an AI request prefix once the transaction is confirmed. After sufficient validators report successfully. The results of the data requests will be written and stored permanently on Oraichain for future uses.

message type: set_ai_request

QueryResAIRequest#

When querying, the user only needs to type the id of the AI request, and the system will return a few attributes below in JSON format.

query type: aireq

QueryResAIRequestIDs#

A list of AI Request unique identifiers will be shown.

query type: aireqs

QueryResFullRequest#

When querying, the user only needs to type the id of the AI request, and the system will return a few attributes below in JSON format.

query type: fullreq

MsgAddReporter#

MsgAddReporter is a message for adding a new reporter for a validator. Each validator needs to have a reporter to send report transactions to the Oraichain network.

message type: add_reporter

MsgRemoveReporter#

MsgRemoveReporter is a message for removing an existing validator's reporter.

message type: remove_reporter

Last updated