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.

    • Go 1.22.7

    Known Issues

    • Versions of Go 1.23 and above may encounter WASM compilation errors, particularly with certain dependencies.

    Troubleshooting Steps

    If you encounter build issues:

    1. Check your current Go version:

      go version
    2. If you're not using Go 1.22.7, consider downgrading:

      • On macOS with Homebrew:

        brew install go@1.22
        brew unlink go
        brew link go@1.22
      • Add to your PATH:

        echo 'export PATH="/usr/local/opt/go@1.22/bin:$PATH"' >> ~/.zshrc
        source ~/.zshrc
    3. After changing Go versions:

      • Clean your Go module cache:

        go clean -modcache
      • Update your modules:

        go mod tidy
    4. Retry your build process.

    Additional Notes

    • If 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:

git clone https://github.com/LandslideNetwork/landslidevm.git && cd landslidevm

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:

BASEDIR=/tmp/e2e-test-landslide AVALANCHEGO_BUILD_PATH=/tmp/e2e-test-landslide/avalanchego ./scripts/install_avalanchego_release.sh

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:

./scripts/build_wasm.sh /tmp/e2e-test-landslide/avalanchego/plugins/pjSL9ksard4YE96omaiTkGL5H6XX2W5VEo3ZgWC9S2P6gzs9A

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:

cd .. && git clone https://github.com/ConsiderItDone/landslide-runner.git && cd landslide-runner

b. Start the Avalanche node with Landslide L1:

make run-wasm

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:

  1. 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.

  2. Health Check:

    • The system will wait for all nodes to report as healthy.

  3. Subnet Creation:

    • A new subnet will be created (you'll see a subnet ID).

    • The nodes will be added as subnet validators.

  4. Blockchain Creation:

    • A new blockchain for Landslide (referred to as "landslidevm") will be created.

    • You'll see a blockchain ID generated.

  5. Node Restart:

    • The nodes will be restarted to track the new subnet.

  6. Plugin Reload:

    • The system will reload plugin binaries.

  7. Custom Chain Creation:

    • The Landslide blockchain will be created on the subnet.

  8. 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.

  9. Final Setup:

    • The system will register blockchain aliases.

    • A final health check will be performed.

  10. RPC URLs:

    • The system will output RPC and gRPC URLs for each node. These are crucial for interacting with your Landslide network.

  11. 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

Logo

©2024 Gaia Labs LTD