Course Content

Chapter 0: Introduction




Chapter 3: How to deploy and edit a data source



Chapter 3

How to deploy and edit a data source

Estimated time: 37 mins


When interacting with BandChain, we need to send instructions to BandChain to tell it what to do. The method in which we use to send instructions is by creating messages and broadcasting them to BandChain.

Broadcasting Messages

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.

Message Definitions

There are two messages used to deploy and edit a data source, MsgCreateDataSource and MsgEditDataSource

MsgCreateDataSource

MsgCreateDataSource is used to create a data source on BandChain and contains the following parameters:

ParameterTypeDescription
NamestringThe name of the data source to be deployed
DescriptionstringA description of the data source
ExecutablebytesThe content of the data source executable
FeeCoinThe fee to be paid per-query when this data source is used
TreasurystringThe treasury address of which the fee is paid too
OwnerstringThe address of owner for the data source to be deployed
SenderstringThe address of the message sender
MsgEditDataSource

MsgEditDataSource is used to modify the parameters of an existing data source on BandChain and contains the following parameters:

ParameterTypeDescription
DataSourceIDint64The data source identifier
NamestringThe name of the data source to be deployed
DescriptionstringA description of the data source
ExecutablebytesThe content of the data source executable
FeeCoinThe fee to be paid per-query when this data source is used
TreasurystringThe treasury address of which the fee is paid too
OwnerstringThe address of owner for the data source to be deployed
SenderstringThe 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 existing values on BandChain:

  • name: "[do-not-modify]"
  • description: "[do-not-modify"]"
  • executable: b"[do-not-modify]"

Quiz

What message needs to be sent to initialize a data source on BandChain?

Previous Chapter

How to create a data source