Deploying a BVS
Last updated
Was this helpful?
Last updated
Was this helpful?
This section guides you through the steps needed to deploy your custom Hello World BVS from scratch, including setting up the required environment, building your contract, and utilizing CLI commands efficiently to modify and inspect your BVS deployment.
At a minimum, you'll need four wallets, which we will name: bvs-owner
, bvs-operator
, bvs-aggregator
.
The easiest way to create these wallets is through the babylon command. Please refer to our for installation details.
To create the wallets, run the following commands in a terminal:
Optionally, you can create a bvs-user
wallet if desired.
Next, fund each account with tokens to cover gas and fees in the later steps.
NOTICE: Ensure that your keys have enough tokens to send transactions and register the BVS/Operator.
Rust: Ensure you've installed Rust in your computer.
Docker: Docker is used to compile CosmWasm contract. You should install it in your computer.
Babylond: Ensure you've installed babylond
command line tool
Satlayer CLI: Ensure you've installed satlayer-cli
Here are the steps to clone the repository, compile the contract, and run tests:
The compiled WASM file will be found at:
The checksums.txt
file contains the SHA256 hash of the WASM file.
It's recommended to have both versions of Rust:
The version provided in Docker have optimizations to help CosmWasm reduce it's size and gas cost.
The version installed on your system, which is easier to use during coding and testing.
Step 6: Run Tests
Execute all tests in the contract by running the following command outside of Docker:
Make sure all tests pass before proceeding with the next steps.
The following is an example output of the command.
code_id
can be acquired from the explorer by scrolling near the end of the JSON section. Next, find "attributes". In this case, our code_id
is 44.
Alternatively, you can use the following command to query and extract code_id
directly from the node.
For example:
The contract address can be acquired by an API call to the node.
For example:
Alternatively, you can use the following command:
For example, the 40ec465b57ea30cbf7045f423731830f31d7aa56bf9fa6e4b20cae11309b3d18
is our BVS hash.
The approver has no active role in the operation of a BVS (but in accepting stakes from stakers). Approver address is optional, if you don't it, don't need to write it.
If you'd like to delve into the specifics of the BVS, here are instructions for manually interacting with it through the command line. However, we DO NOT anticipate that most users will require this.
Execute the contract
Query the contract data
Upgrade the contract
You should do the following steps:
Upload a new contract to testnet
Get the code id
Execute the following commands:
In addition, you should set --admin
when you execute first instantiate
command. This helps upgrade the contract without changing contract address.
With the BVS contract uploaded and instantiated, you can now modify the Hello World BVS to point at your contracts and aggregator.
Point the bvsHash
to the BVS hash you get from the above contract deployment step. Please make sure to change the owner settings to use the bvs-aggregator
key you have created earlier.
The same change is needed for bvs_offchain/env.toml
. But this time point it towards the operator.
Now, modify task/env.toml
to point it to the bvs-user
account (or use the operator account if you decided to skip that).
You should firstly edit go.mod
in devnet-hello-world-bvs
to your cloned satlayer-api
lib path:
First, start Redis
and the aggregator.
Next, run the off chain compute process.
Afterwards, start the task caller to start the BVS.
You should start seeing tasks and results appearing after a few seconds. Congratulations, you've successfully deployed your own BVS!
Install Rust by .
Read this to install CosmWasm.
CosmWasm: Read the to set up the environment.
See
See our
For this tutorial, you will need to install since we use it to extract information from the JSON responses returned by Babylon nodes.
On success, no error message should show up and txHash
printed. This transaction hash can be used on to view details about the transaction. (For instance: )
You can click this link to view the in our blockchain explorer.
This command will return 3 txHash, use the to get bvs_hash
in tx_repsonse/events/wasm
field as follows:
In actual, you don't need to manual to respond to task, because it's called by aggregator program automatically. You can view the and tx information in our blockchain explorer.
CosmWasm supports contract upgrade by via the migrate command. You should add migrate
function in your contract like .
The same approach outlined in the documentation can be applied to launch the newly configured BVS. Here, we'll present a streamlined version.