Chapter 3
Estimated time: 26 mins
In order to deploy or edit an oracle script, either our online IDE: Band Builder or our SDK's pyband and bandchain.js can be used.
In order to deploy an oracle script, we need to create MsgCreateOracleScript
message and broadcast the message to BandChain.
MsgCreateOracleScript
contains 7 parameters:
Parameter | Type | Description |
---|---|---|
Name | string | The name of the oracle script to be deployed |
Description | string | A description of the oracle script |
Schema | bytes | The oracle script's OBI schema |
Source Code URL | string | An optional absolute URI to the oracle script's source code |
Code | string | The oracle script's WebAssembly binary code. Can be raw or gzip compressed |
Owner | string | The address of owner for the oracle script to be deployed |
Sender | string | The address of the message sender |
After an oracle script is deployed, its parameters can be updated if need be. To update an oracle script, we can broadcast a MsgEditOracleScript
message to BandChain.
MsgEditOracleScript
contains 8 parameter:
Parameter | Type | Description string |
---|---|---|
OracleScriptID | int64 | The data source identifier |
Name | string | The name of the oracle script to be deployed |
Description | string | A description of the oracle script |
Schema | bytes | The oracle script's OBI schema |
Source Code URL | string | An optional absolute URI to the oracle script's source code |
Code | string | The oracle script's WebAssembly binary code. Can be raw or gzip compressed |
Owner | string | The address of owner for the oracle script to be deployed |
Sender | string | The address of the message sender |
where the following field can be set as ["do-not-modify]
in their respective types if no changes are required from the current value:
name
: "[do-not-modify]"
description
: "[do-not-modify"]"
schema
: "[stringot-modify]"
source_code_url
: "[do-not-modify]"
code
: b"[do-not-modify]"
In order to broadcast these messages, our online IDE, Band Builder can be used to both write the data source and deploy it. Alternatively, our SDK's bandchain.js and pyband can also be used.
Examples on how to form a transaction to send messages on pyband can be found here and an example for bandchain.js can be found here.