How to setup Slide SDK locally
Slide SDK (currently known as LandslideVM, changing shortly) is a powerful toolkit for building and deploying CosmWasm applications on the Avalanche network.
Dependencies
1. Go Installation
Download and install Go version go1.22 or later from the official Go website.
Go Version Compatability Note
IMPORTANT: This project has been tested and confirmed to work with Go 1.22.7. If you encounter build issues, especially related to WebAssembly (WASM) compilation, please ensure you are using a compatible Go version.
Recommended Go VersionGo 1.22.7
Known IssuesVersions of Go 1.23 and above may encounter WASM compilation errors, particularly with certain dependencies.
Troubleshooting StepsIf you encounter build issues:
Check your current Go version:
If you're not using Go 1.22.7, consider downgrading:
On macOS with Homebrew:
Add to your PATH:
After changing Go versions:
Clean your Go module cache:
Update your modules:
Retry your build process.
Additional NotesIf you need to manage multiple Go versions across different projects, consider using a Go version manager like
gvm
.Always refer to the project's
go.mod
file for the most up-to-date Go version and dependency requirements.
If you continue to experience issues after following these steps, please contact the development team or open an issue in the project repository.
2. AvalancheGo Installation
AvalancheGo is the official Go implementation of an Avalanche node. Follow these steps to install it:
a. Clone Slide SDK repository:
This command clones the Slide SDK repository and navigates into the newly created directory.
b. Download and install AvalancheGo:
Run the following command from inside the landslidevm
repository to download AvalancheGo:
This command:
Sets up environment variables for the installation paths.
Runs a script that downloads and installs a compatible version of AvalancheGo.
The installed AvalancheGo will be located in
/tmp/e2e-test-landslide/avalanchego
.
Run a CosmWasm Application
1. Build CosmWasm Plugin
CosmWasm is a smart contracting platform built for the Cosmos ecosystem. We need to build a plugin to enable CosmWasm support in Avalanche.
Run this command from the landslidevm
directory:
This script:
Compiles the CosmWasm plugin.
Places the compiled plugin in the AvalancheGo plugins directory.
The long string in the path is a unique identifier for the plugin.
2. Run a Wasm L1
Now we'll set up and run a Wasm L1 (Layer 1) on an Avalanche node using the Landslide Runner.
This clones the Landslide Runner repository and navigates into it.
a. Clone landslide-runner repository:
b. Start the Avalanche node with Landslide L1:
This command:
Builds and configures the Landslide L1.
Starts an Avalanche node with the Landslide L1 deployed.
You should see logs indicating that the node is running and syncing with the network.
Expected Outputs
When you run make run-wasm
, you should expect to see output similar to the following:
Network Creation:
The system will create a network with 5 nodes.
You'll see log entries for each node being added, with details like node name, directory, and ports.
Health Check:
The system will wait for all nodes to report as healthy.
Subnet Creation:
A new subnet will be created (you'll see a subnet ID).
The nodes will be added as subnet validators.
Blockchain Creation:
A new blockchain for Landslide (referred to as "landslidevm") will be created.
You'll see a blockchain ID generated.
Node Restart:
The nodes will be restarted to track the new subnet.
Plugin Reload:
The system will reload plugin binaries.
Custom Chain Creation:
The Landslide blockchain will be created on the subnet.
Health Check for Custom Chains:
The system will wait for the custom chain (Landslide) to report as healthy on all nodes.
You'll see log entries checking for log files on each node.
Final Setup:
The system will register blockchain aliases.
A final health check will be performed.
RPC URLs:
The system will output RPC and gRPC URLs for each node. These are crucial for interacting with your Landslide network.
Network Running:
You'll see a message: "Network will run until you CTRL + C to exit..."
Key Information to Note:
Subnet ID: e.g., "2c1CbR7FGYdeFPB4WaeWphHZrChLH7TQ92FRW6U4mCWTnaxVsB"
Blockchain-ID: e.g., "WKQC4prgnS66BYgQw8ZBdjgYtPhKaRmDEqB5iXKG55Wj13gHu"
RPC URLs: e.g., "http://127.0.0.1:9750/ext/bc/WKQC4prgnS66BYgQw8ZBdjgYtPhKaRmDEqB5iXKG55Wj13gHu/rpc"
gRPC URLs: e.g., "http://127.0.0.1:9090"
If you see this output, your Landslide network is up and running successfully. You can interact with your network using the provided RPC and gRPC URLs. Remember that you can stop the network by pressing CTRL + C.
Next Steps
Congratulations! You now have a running Avalanche node with Landslide L1 and CosmWasm support. You can start developing and deploying CosmWasm smart contracts on this infrastructure.
To interact with your node or deploy contracts, you'll need to use appropriate tools and APIs. Refer to the Avalanche and CosmWasm documentation for more information on interacting with the network and writing smart contracts.
Troubleshooting
If you encounter issues:
Ensure all dependencies are correctly installed, and versions are compatible.
Check that you have the necessary permissions to execute scripts and create directories.
Review console output for error messages.
Consult our FAQ or community forums for common issues and solutions.
For further assistance, reach out to our support team or community channels.
Last updated