This repository contains simple example programs and tooling to demonstrate how to build and deploy programs using Valence's suite of tools.
- Astroport Liquidity Deployer: Demonstrates a simple program to provide liquidity to and withdraw liquidity from a pool on Astroport.
You must include .env file in the root of the project with the following variables:
# The mnemonic that will be used by the manager to deploy the program on chains
MANAGER_MNEMONIC=""A template is provided to help you get started, you can clone it and modify it to deploy your program.
Don't forget to rename the new program directory and the Cargo.toml file.
In your new program directory you will find src/program_builder.rs file, this is the file that you will modify to build your program using our rust builder pattern.
Your program might need some parameters that are unique for a specific environment, you can provide these parameters in the program_params/ directory.
You should include a file for each environment, the file name should be the environment name, Example: program_params/local.toml or program_params/mainnet.toml.
Any parameter that is included there will be available in the program builder function, and can be retrieved using the .get(String) function, Example: params.get("my_param").
You can deploy your program using the following command:
cargo run -p *PROGRAM_NAME*Use the name you gave your pgoram in Cargo.toml file.
After running the script, you will find the output in the output/ directory.
Each deployed program will have its own directory with the date and time of the deployment, inside each directory you will find:
instantiated-program-config.json- The instantiated program config which includes all the addresses of the contracts of the deployed programraw-program-config.json- The generated raw program config before instantiation.
By default each deployed program directory is ignored in git, you can remove the ignore rule in the .gitignore file if you want to keep the output in your cloned repository.