TITLE: Installing the Walrus Site Builder DESCRIPTION: This section guides users through the installation process of the Walrus site builder tool. It provides step-by-step instructions for setting up the builder to create and manage Walrus Sites.
SOURCE: https://docs.wal.app/dev-guide/sui-struct
LANGUAGE: bash CODE:
# Example installation command (placeholder)
npm install -g @walrus/site-builder
TITLE: Clone Example Walrus Sites Repository DESCRIPTION: This command clones the example-walrus-sites repository from GitHub and changes the current directory to the cloned repository. This is the first step to get sample sites for publishing.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
git clone https://github.com/MystenLabs/example-walrus-sites.git && cd example-walrus-sites
TITLE: Publish a Walrus Site DESCRIPTION: This section guides users through publishing a Walrus Site and adding a SuiNS name for easier access. It covers the initial setup and deployment process.
SOURCE: https://docs.wal.app/walrus-sites/tutorial
LANGUAGE: Rust CODE:
// Example Rust code for publishing a Walrus Site
fn publish_walrus_site() {
println!("Publishing Walrus Site...");
// Add site publishing logic here
}
fn add_sui_ns_name() {
println!("Adding SuiNS name...");
// Add SuiNS name registration logic here
}
TITLE: Walrus Sites Linking Examples DESCRIPTION: Demonstrates how to create portal-independent links for Walrus Sites resources using SuiNS names or blob IDs.
SOURCE: https://docs.wal.app/walrus-sites/linking
LANGUAGE: plaintext CODE:
https://gallery.suiobj/walrus_arctic.webp
https://abcd123….suiobj/walrus_arctic.webp
https://blobid.walrus/qwer5678…
TITLE: Walrus Site Builder Configuration Example
DESCRIPTION: An example sites-config.yaml file showing configurations for 'testnet' and 'mainnet' contexts, including package IDs and general settings.
SOURCE: https://docs.wal.app/print
LANGUAGE: yaml CODE:
contexts:
testnet:
# module: site
# portal: wal.app
package: 0xf99aee9f21493e1590e7e5a9aea6f343a1f381031a04a732724871fc294be799
staking_object: 0xbe46180321c30aab2f8b3501e24048377287fa708018a5b7c2792b35fe339ee3
general:
wallet_env: testnet
walrus_context: testnet # Assumes a Walrus CLI setup with a multi-config containing the "testnet" context.
walrus_package: 0xd84704c17fc870b8764832c535aa6b11f21a95cd6f5bb38a9b07d2cf42220c66
# wallet_address: 0x1234...
# rpc_url: https://fullnode.testnet.sui.io:443
# wallet: /path/to/.sui/sui_config/client.yaml
# walrus_binary: /path/to/walrus
# walrus_config: /path/to/testnet/client_config.yaml
# gas_budget: 500000000
mainnet:
# module: site
# portal: wal.app
package: 0x26eb7ee8688da02c5f671679524e379f0b837a12f1d1d799f255b7eea260ad27
staking_object: 0x10b9d30c28448939ce6c4d6c6e0ffce4a7f8a4ada8248bdad09ef8b70e4a3904
general:
wallet_env: mainnet
walrus_context: mainnet # Assumes a Walrus CLI setup with a multi-config containing the "mainnet" context.
walrus_package: 0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77
# wallet_address: 0x1234...
# rpc_url: https://fullnode.mainnet.sui.io:443
# wallet: /path/to/.sui/sui_config/client.yaml
# walrus_binary: /path/to/walrus
# walrus_config: /path/to/mainnet/client_config.yaml
# gas_budget: 500000000
default_context: mainnet
TITLE: Copy Environment Example (Bash) DESCRIPTION: Copies the testnet environment example file to a local environment file for customization. This is the initial step for configuring the portal's behavior.
SOURCE: https://docs.wal.app/walrus-sites/portal
LANGUAGE: bash CODE:
cp ./portal/worker/.env.testnet.example ./portal/worker/.env.local
TITLE: Copy Testnet Server Portal Environment Variables DESCRIPTION: This command copies the example environment variables for the testnet server portal to a local .env file, enabling the setup of a testnet instance.
SOURCE: https://docs.wal.app/walrus-sites/portal
LANGUAGE: bash CODE:
cp ./portal/server/.env.testnet.example ./portal/server/.env.local
TITLE: Install Dependencies with Bun (Bash) DESCRIPTION: Navigates to the portal directory and installs project dependencies using Bun. This command is essential before running the portal locally.
SOURCE: https://docs.wal.app/walrus-sites/portal
LANGUAGE: bash CODE:
cd portal
bun install
TITLE: Install Walrus Client via Script (Mainnet)
DESCRIPTION: Downloads and installs the latest Mainnet version of the Walrus client to the $HOME/.local/bin directory using a curl script. Ensure $HOME/.local/bin is in your PATH.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: bash CODE:
curl -sSf https://install.wal.app | sh
TITLE: CI/CD Setup for GitHub DESCRIPTION: Guidance on setting up Continuous Integration and Continuous Deployment pipelines for Walrus Sites using GitHub, including secrets and workflow creation.
SOURCE: https://docs.wal.app/operator-guide/operator-guide
LANGUAGE: Rust CODE:
// Placeholder for Rust code related to GitHub CI/CD setup for Walrus Sites
TITLE: Install Walrus CLI via suiup
DESCRIPTION: Installs specific versions of the Walrus CLI using the suiup tool. This allows for managing different Walrus releases for testnet or mainnet.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: bash CODE:
suiup install walrus@testnet # install the latest testnet release
suiup install walrus@mainnet # install the latest mainnet release
suiup install walrus@testnet-v1.27.1 # install a specific release
TITLE: Install Portal Dependencies with Bun DESCRIPTION: Installs project dependencies for the portal using Bun. This command should be run after navigating to the portal directory.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
cd portal
bun install
TITLE: Install Bun (Shell) DESCRIPTION: Installs the Bun JavaScript runtime using a curl command to download and execute the installation script. This is necessary if Bun is not already installed.
SOURCE: https://docs.wal.app/walrus-sites/portal
LANGUAGE: shell CODE:
curl -fsSL https://bun.sh/install | bash
TITLE: Install Walrus CLI via suiup DESCRIPTION: Installs specific versions of the Walrus CLI using the 'suiup' tool. Examples include installing the latest testnet, mainnet, or a specific tagged release.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
suiup install walrus@testnet # install the latest testnet release
LANGUAGE: shell CODE:
suiup install walrus@mainnet # install the latest mainnet release
LANGUAGE: shell CODE:
suiup install walrus@testnet-v1.27.1 # install a specific release
TITLE: Walrus SDK Usage Example (Rust) DESCRIPTION: This example demonstrates how to use the Walrus SDK in Rust to upload and download data. It highlights the core functionalities provided by the SDK.
SOURCE: https://docs.wal.app/blog/01_announcing_walrus
LANGUAGE: Rust CODE:
use walrus_sdk::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut client = Client::new("http://localhost:8080").await?;
// Upload a file
let file_path = "./my_data.txt";
let object_id = client.upload(file_path).await?;
println!("Uploaded file with ID: {}", object_id);
// Download the file
let download_path = "./downloaded_data.txt";
client.download(&object_id, download_path).await?;
println!("Downloaded file to: {}", download_path);
Ok(())
}
TITLE: Install Walrus Site Builder CLI (Mainnet) DESCRIPTION: This snippet shows how to download and make executable the Walrus site builder CLI for the mainnet. It requires setting a system variable to specify the target OS and architecture.
SOURCE: https://docs.wal.app/walrus-sites/tutorial-install
LANGUAGE: bash CODE:
SYSTEM= # set this to your system: ubuntu-x86_64, ubuntu-x86_64-generic, macos-x86_64, macos-arm64, windows-x86_64.exe
curl https://storage.googleapis.com/mysten-walrus-binaries/site-builder-mainnet-latest-$SYSTEM -o site-builder
chmod +x site-builder
TITLE: CI/CD Setup for Walrus Sites with GitHub DESCRIPTION: This section provides guidance on setting up Continuous Integration and Continuous Deployment (CI/CD) pipelines for Walrus Sites using GitHub Actions.
SOURCE: https://docs.wal.app/design/operations-sui
LANGUAGE: YAML CODE:
name: Deploy Walrus Site
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
run: walrus-site build --output ./dist
- name: Deploy to Walrus Storage
# Add deployment steps here
TITLE: Walrus CLI Interaction Example DESCRIPTION: This snippet demonstrates how to interact with the Walrus client using its command-line interface (CLI). It's a basic example showing a common operation.
SOURCE: https://docs.wal.app/blog/01_announcing_walrus
LANGUAGE: Shell CODE:
walrus client --help
walrus client upload <file_path>
walrus client download <object_id>
TITLE: Install Walrus Client via Script (Testnet) DESCRIPTION: Downloads and installs the latest Testnet version of the Walrus client using a curl script. This command specifies the testnet network.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: bash CODE:
curl -sSf https://install.wal.app | sh -s -- -n testnet
TITLE: Install Walrus Site Builder
DESCRIPTION: Downloads and makes the Walrus site-builder executable. The SYSTEM variable should be set to your operating system and architecture (e.g., ubuntu-x86_64).
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
SYSTEM= # set this to your system: ubuntu-x86_64, ubuntu-x86_64-generic, macos-x86_64, macos-arm64, windows-x86_64.exe
curl https://storage.googleapis.com/mysten-walrus-binaries/site-builder-testnet-latest-$SYSTEM -o site-builder
chmod +x site-builder
TITLE: Build and Publish a Walrus Site DESCRIPTION: This section guides users through the process of building and publishing a Walrus Site using the site builder. It covers installation, publishing, and setting up SuiNS names.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
site-builder install
site-builder publish <site_directory>
sui-ns set <site_name>.sui
TITLE: Install Bun DESCRIPTION: Installs the Bun JavaScript runtime using a curl command. This is necessary if Bun is not already installed.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
curl -fsSL https://bun.sh/install | bash
TITLE: Example walrus-upload-relay Configuration DESCRIPTION: This YAML snippet shows an example configuration for the walrus-upload-relay, including tip configuration with an address and kind, and transaction freshness thresholds.
SOURCE: https://docs.wal.app/print
LANGUAGE: yaml CODE:
tip_config: !send_tip
address: 0x2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
kind: !const 42
tx_freshness_threshold_secs: 36000
tx_max_future_threshold:
secs: 30
nanos: 0
TITLE: CI Workflow for Publishing Walrus Sites with GitHub Actions DESCRIPTION: This example details the CI workflow used to publish the Walrus documentation site itself, demonstrating how to build a static website and store it as a Walrus Site using GitHub Actions. It highlights the practical application of Walrus in website deployment pipelines.
SOURCE: https://docs.wal.app/usage/examples
LANGUAGE: YAML CODE:
# CI workflow example for publishing Walrus Sites using GitHub Actions
TITLE: Build and Publish a Walrus Site DESCRIPTION: This section guides users through the process of building and publishing a Walrus Site using the site builder. It covers installation, publishing, and setting up SuiNS names.
SOURCE: https://docs.wal.app/index
LANGUAGE: bash CODE:
site-builder install
site-builder publish <site_directory>
sui-ns set <site_name>.sui
TITLE: Install Walrus CLI via Cargo DESCRIPTION: Installs the Walrus CLI using Cargo, specifying the Git repository and branch for the Mainnet version. Supports installation via tags or commits as alternatives.
SOURCE: https://docs.wal.app/print
LANGUAGE: rust CODE:
cargo install --git https://github.com/MystenLabs/walrus --branch mainnet walrus-service --locked
TITLE: Verify Walrus CLI Installation DESCRIPTION: Checks the installed Walrus CLI version and displays usage instructions. This command should be executable after a successful installation and PATH configuration.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
$ walrus --help
Walrus client
Usage: walrus [OPTIONS] <COMMAND>
Commands:
⋮
TITLE: Creating GitHub Workflow for Walrus Sites DESCRIPTION: This section provides an example of a GitHub Actions workflow file to automate the building and deployment of Walrus Sites. It outlines the steps involved in the CI/CD process.
SOURCE: https://docs.wal.app/legal/walrus_general_tos
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
run: walrus-site build --directory ./my-site
- name: Deploy Walrus Site
run: walrus-site publish --directory ./my-site --target production
TITLE: Configure Mainnet Server Portal Environment DESCRIPTION: Copies the example environment file for the mainnet server portal to create a local configuration file. This sets up the necessary environment variables for running the mainnet server portal.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
cp ./portal/server/.env.mainnet.example ./portal/server/.env.local
TITLE: Operating a Walrus Aggregator or Publisher DESCRIPTION: This section provides guidance on operating an aggregator or publisher node within the Walrus network. It covers the responsibilities, setup, and management of these roles, including authentication.
SOURCE: https://docs.wal.app/dev-guide/sui-struct
LANGUAGE: text CODE:
Publisher Authentication:
- API Key Management
- Secure connection protocols
TITLE: Install Walrus Client on Windows
DESCRIPTION: Downloads the latest Windows 64-bit Testnet version of the Walrus client using PowerShell. The downloaded file will be named walrus.exe.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: powershell CODE:
(New-Object System.Net.WebClient).DownloadFile(
"https://storage.googleapis.com/mysten-walrus-binaries/walrus-testnet-latest-windows-x86_64.exe",
"walrus.exe"
)
TITLE: Configure Testnet Server Portal Environment DESCRIPTION: Copies the example environment file for the testnet server portal to create a local configuration file. This sets up the necessary environment variables for running the testnet server portal.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
cp ./portal/server/.env.testnet.example ./portal/server/.env.local
TITLE: Build and Publish a Walrus Site DESCRIPTION: This section guides users through the process of building and publishing a Walrus Site. It includes instructions on using the site builder and setting up necessary configurations for deployment.
SOURCE: https://docs.wal.app/usage/started
LANGUAGE: Rust CODE:
// Command to build a Walrus Site
walrus-site build
// Command to publish a Walrus Site
walrus-site publish
TITLE: Creating GitHub Workflow for Walrus Sites DESCRIPTION: This section provides an example of a GitHub Actions workflow file to automate the building and deployment of Walrus Sites. It outlines the steps involved in the CI/CD process.
SOURCE: https://docs.wal.app/design/architecture
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
run: walrus-site build --directory ./my-site
- name: Deploy Walrus Site
run: walrus-site publish --directory ./my-site --target production
TITLE: Walrus Site Builder Command Example DESCRIPTION: This snippet shows a command for the Walrus site builder, likely used for managing or publishing Walrus Sites.
SOURCE: https://docs.wal.app/blog/01_announcing_walrus
LANGUAGE: Shell CODE:
walrus-site-builder publish --source ./my-site --destination <sui_object_id>
TITLE: Start Local Sui Network DESCRIPTION: Command to start a local Sui network with faucet enabled and force regenesis. This is a prerequisite for running the Walrus testbed fully locally.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
sui start --with-faucet --force-regenesis
TITLE: Python Examples for Walrus HTTP and JSON APIs DESCRIPTION: This snippet covers Python examples demonstrating how to interact with Walrus using both its HTTP and JSON APIs. It includes functionalities for storing and reading blobs, checking blob availability, and tracking Walrus-related events. The examples illustrate reading Blob Sui objects for certification.
SOURCE: https://docs.wal.app/usage/examples
LANGUAGE: Python CODE:
# Example for HTTP API to store and read a blob
# Example for JSON API to store, read, and check availability
# Example for tracking Walrus related Events
TITLE: Creating GitHub Workflow for Walrus Sites DESCRIPTION: This section provides an example of a GitHub Actions workflow file to automate the building and deployment of Walrus Sites. It outlines the steps involved in the CI/CD process.
SOURCE: https://docs.wal.app/blog/03_whitepaper
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
run: walrus-site build --directory ./my-site
- name: Deploy Walrus Site
run: walrus-site publish --directory ./my-site --target production
TITLE: Start Walrus Node and Monitor Logs (Bash)
DESCRIPTION: This command starts the Walrus storage node service after a restore operation. It also includes instructions to monitor the startup logs using journalctl to track the node's progress and transition to an active state.
SOURCE: https://docs.wal.app/operator-guide/backup-restore-guide
LANGUAGE: bash CODE:
sudo systemctl start walrus-node.service
# Monitor startup logs
sudo journalctl -u walrus-node.service -f
TITLE: Install Walrus CLI via Script (Mainnet) DESCRIPTION: Installs the latest Mainnet version of the Walrus CLI by downloading and executing a script from the official wal.app URL. Ensure your PATH includes '$HOME/.local/bin'.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
curl -sSf https://install.wal.app | sh
TITLE: Creating GitHub Workflow for Walrus Sites DESCRIPTION: This section provides an example of a GitHub Actions workflow file to automate the building and deployment of Walrus Sites. It outlines the steps involved in the CI/CD process.
SOURCE: https://docs.wal.app/glossary
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
run: walrus-site build --directory ./my-site
- name: Deploy Walrus Site
run: walrus-site publish --directory ./my-site --target production
TITLE: Create GitHub Workflow for Walrus Site CI/CD DESCRIPTION: This section provides an example of a GitHub Actions workflow file used to automate the build, test, and deployment process for Walrus Sites. It outlines the steps and commands executed in the CI/CD pipeline.
SOURCE: https://docs.wal.app/usage/started
LANGUAGE: Rust CODE:
name: Deploy Walrus Site
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Deploy Walrus Site
run: |
walrus-site build
walrus-site publish --target production
TITLE: Walrus Upload Relay Configuration Example DESCRIPTION: An example configuration file for the walrus-upload-relay. It includes settings for sending tips, such as the recipient address and the type of tip (constant or linear), as well as transaction freshness thresholds.
SOURCE: https://docs.wal.app/operator-guide/upload-relay
LANGUAGE: yaml CODE:
tip_config: !send_tip
address: 0x2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a
kind: !const 42
tx_freshness_threshold_secs: 36000
tx_max_future_threshold:
secs: 30
nanos: 0
TITLE: Install Walrus Service via Cargo DESCRIPTION: Installs the latest Mainnet version of the Walrus service using Cargo. Supports specifying branches, tags, or commits for different versions.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: bash CODE:
cargo install --git https://github.com/MystenLabs/walrus --branch mainnet walrus-service --locked
TITLE: Deploy Walrus Site GitHub Action Workflow DESCRIPTION: Example of a GitHub Actions workflow file demonstrating how to use the 'Deploy Walrus Site' action. It includes setting up permissions, defining environment variables, and calling the action with necessary inputs.
SOURCE: https://docs.wal.app/walrus-sites/ci-cd-gh-workflow
LANGUAGE: YAML CODE:
name: Deploy Walrus Site
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
# Add your site build steps here (e.g., npm run build, yarn build)
run: echo "Building site..."
- name: Deploy to Walrus
uses: MystenLabs/walrus-sites/.github/actions/deploy
with:
SUI_ADDRESS: ${{ secrets.SUI_ADDRESS }}
SUI_KEYSTORE: ${{ secrets.SUI_KEYSTORE }}
DIST: "./build" # Path to your built site directory
SUI_NETWORK: "testnet" # Optional: mainnet or testnet
EPOCHS: "10" # Optional: number of epochs to keep the site stored
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
TITLE: Creating GitHub Workflow for Walrus Sites DESCRIPTION: This section provides an example of a GitHub Actions workflow file to automate the building and deployment of Walrus Sites. It outlines the steps involved in the CI/CD process.
SOURCE: https://docs.wal.app/design/encoding
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
run: walrus-site build --directory ./my-site
- name: Deploy Walrus Site
run: walrus-site publish --directory ./my-site --target production
TITLE: Start Walrus Aggregator DESCRIPTION: Starts a local Walrus aggregator service that provides an HTTP interface for reading blobs. It requires specifying the bind address for the listener.
SOURCE: https://docs.wal.app/operator-guide/aggregator
LANGUAGE: bash CODE:
walrus aggregator --bind-address "127.0.0.1:31415"
TITLE: Start Local Grafana Instance
DESCRIPTION: Command to spin up a local Grafana instance for visualizing metrics from Walrus storage nodes. This is done by navigating to the Grafana Docker directory and running docker compose up.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
cd docker/grafana-local; docker compose up
TITLE: Start Walrus Publisher with Sub-wallets DESCRIPTION: Starts a local Walrus publisher service for storing blobs, including on-chain operations. It configures a directory for sub-wallets and sets the number of clients for parallel operations.
SOURCE: https://docs.wal.app/operator-guide/aggregator
LANGUAGE: bash CODE:
PUBLISHER_WALLETS_DIR=~/.config/walrus/publisher-wallets
mkdir -p "$PUBLISHER_WALLETS_DIR"
walrus publisher \
--bind-address "127.0.0.1:31416" \
--sub-wallets-dir "$PUBLISHER_WALLETS_DIR" \
--n-clients 1
TITLE: Start Local Sui Network DESCRIPTION: Initiates a local Sui network with faucet enabled and forces genesis regeneration. This is a prerequisite for running the Walrus testbed fully locally. Requires Sui version 1.28.0 or higher.
SOURCE: https://docs.wal.app/usage/networks
LANGUAGE: bash CODE:
sui start --with-faucet --force-regenesis
TITLE: Check Bun Installation DESCRIPTION: Checks if the Bun JavaScript runtime is installed on the system. Bun is required for local development.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
bun --version
TITLE: Install Walrus CLI via Script (Testnet) DESCRIPTION: Installs the latest Testnet version of the Walrus CLI using a script from wal.app, specifying the 'testnet' flag. Ensure your PATH includes '$HOME/.local/bin'.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
curl -sSf https://install.wal.app | sh -s -- -n testnet
TITLE: Update Walrus Client via Script DESCRIPTION: Updates an existing installation of the Walrus client to the latest version by re-running the installation script with the force flag.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: bash CODE:
curl -sSf https://install.wal.app | sh -s -- -f
TITLE: Upload Relay Tip Configuration Example DESCRIPTION: An example JSON structure for the tip configuration endpoint of the upload relay. It specifies the address to send tips to and the tipping mechanism, which can be a constant amount or linear with data size.
SOURCE: https://docs.wal.app/operator-guide/upload-relay
LANGUAGE: json CODE:
{
"send_tip": {
"address": "0x1234...",
"kind": {
"const": 105
}
}
}
TITLE: Run Server-Side Portal with Bun DESCRIPTION: Starts the server-side portal using the Bun runtime. This command executes the 'server' script defined in the project's package.json.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
bun run server
TITLE: Walrus Site CI/CD GitHub Workflow DESCRIPTION: This section provides an example of setting up a GitHub Actions workflow for Continuous Integration and Continuous Deployment (CI/CD) of Walrus Sites.
SOURCE: https://docs.wal.app/walrus-sites/advanced
LANGUAGE: YAML CODE:
name: Deploy Walrus Site
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Walrus Site
run: walrus-site build --output ./dist
- name: Deploy to Walrus
env:
WALRUS_API_KEY: ${{ secrets.WALRUS_API_KEY }}
run: walrus-site deploy --source ./dist --target production
TITLE: Creating a GitHub Workflow for Walrus Sites DESCRIPTION: This section provides instructions and examples for creating a GitHub Actions workflow file to automate the build and deployment process for Walrus Sites.
SOURCE: https://docs.wal.app/operator-guide/upload-relay
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Dependencies
run: npm install
- name: Build Site
run: npm run build
- name: Deploy to Walrus
run: walrus-site publish ./build
TITLE: JavaScript Example for Walrus HTTP API Blob Upload/Download DESCRIPTION: A JavaScript example is provided to showcase uploading and downloading blobs using the Walrus HTTP API through a web form. This demonstrates client-side interaction with Walrus for basic data transfer operations.
SOURCE: https://docs.wal.app/usage/examples
LANGUAGE: JavaScript CODE:
// Example showing how to upload and download a blob via HTTP API using a web form
TITLE: Start Walrus Aggregator Daemon DESCRIPTION: Starts a local Walrus aggregator daemon that provides an HTTP interface to read blobs from Walrus. It requires specifying the bind address.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
walrus aggregator --bind-address "127.0.0.1:31415"
TITLE: CI/CD Setup for Walrus Sites with GitHub DESCRIPTION: This section details how to set up Continuous Integration and Continuous Deployment (CI/CD) pipelines for Walrus Sites using GitHub Actions. It covers configuring GitHub secrets and creating workflow files.
SOURCE: https://docs.wal.app/dev-guide/sui-struct
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Deploy Site
run: |
npm install -g @walrus/site-builder
walrus-site publish --target staging
TITLE: Build Walrus from Source using Cargo DESCRIPTION: This snippet shows how to build and install the Walrus client from its Rust source code using the cargo package manager. This is an alternative to using the pre-compiled binary.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: Rust CODE:
cargo install walrus
TITLE: Download and Execute Walrus Site Builder DESCRIPTION: This snippet shows how to download the Walrus site builder binary for your system using curl and make it executable. It also explains how to place the binary in your system's PATH for easy access.
SOURCE: https://docs.wal.app/walrus-sites/tutorial-install
LANGUAGE: shell CODE:
SYSTEM= # set this to your system: ubuntu-x86_64, ubuntu-x86_64-generic, macos-x86_64, macos-arm64, windows-x86_64.exe
curl https://storage.googleapis.com/mysten-walrus-binaries/site-builder-testnet-latest-$SYSTEM -o site-builder
chmod +x site-builder
TITLE: GitHub Workflow for Walrus Sites CI/CD DESCRIPTION: This section provides an example of a GitHub Actions workflow for Continuous Integration and Continuous Deployment (CI/CD) of Walrus Sites. It demonstrates how to automate the build and deployment process.
SOURCE: https://docs.wal.app/design/objectives_use_cases
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Walrus Site Builder
uses: ./actions/setup-site-builder # Assuming a custom action
- name: Build and Deploy Site
run: site-builder publish --site-path ./my-site --target-url https://my-walrus-site.com
TITLE: Minimal Site Builder Configuration File
DESCRIPTION: This example shows a minimal configuration file (./sites-config.yaml) for the site builder, specifying the essential package ID for Walrus Sites on Sui. The tool can also be pointed to a different config file using the --config flag.
SOURCE: https://docs.wal.app/print
LANGUAGE: yaml CODE:
package: "<sui_package_object_id>"
TITLE: GitHub Workflow for Walrus Site CI/CD DESCRIPTION: This example illustrates a GitHub Actions workflow for Continuous Integration and Continuous Deployment (CI/CD) of a Walrus Site. It automates the publishing process.
SOURCE: https://docs.wal.app/blog/01_announcing_walrus
LANGUAGE: YAML CODE:
name: Deploy Walrus Site
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Dependencies
run: npm install
- name: Build Walrus Site
run: npm run build
- name: Deploy to Walrus
env:
SUI_KEYSTORE_PATH: ${{ secrets.SUI_KEYSTORE_PATH }}
SUI_ADDRESS: ${{ secrets.SUI_ADDRESS }}
run: |
walrus-site-builder publish --source ./dist --destination <your_sui_object_id>
TITLE: Display Walrus Client Help Information DESCRIPTION: Shows the usage instructions and available commands for the Walrus CLI client. This is helpful for understanding the client's capabilities.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: bash CODE:
$ walrus --help
TITLE: Copy Mainnet Server Portal Environment Variables DESCRIPTION: This command copies the example environment variables for the mainnet server portal to a local .env file, which is required for basic functionality.
SOURCE: https://docs.wal.app/walrus-sites/portal
LANGUAGE: bash CODE:
cp ./portal/server/.env.mainnet.example ./portal/server/.env.local
TITLE: Generate Sui Wallet with Walrus
DESCRIPTION: Generates a new Sui wallet for Walrus using the walrus generate-sui-wallet command. This is a quick setup option that does not require the Sui CLI.
SOURCE: https://docs.wal.app/usage/setup
LANGUAGE: bash CODE:
walrus generate-sui-wallet --network mainnet
TITLE: Run Server-Side Portal with Bun (Bash) DESCRIPTION: Starts the server-side version of the Walrus portal using the Bun runtime. This command executes the server script defined in the project's package.json.
SOURCE: https://docs.wal.app/walrus-sites/portal
LANGUAGE: bash CODE:
bun run server
TITLE: Publish Walrus Site with Site Builder DESCRIPTION: This section details how to publish a Walrus Site using the site-builder CLI. It explains that the site-builder uploads a directory of files, including an index.html, to Walrus and adds metadata to Sui. An example repository is provided for reference.
SOURCE: https://docs.wal.app/walrus-sites/tutorial-publish
LANGUAGE: Git CODE:
git clone https://github.com/MystenLabs/example-walrus-sites.git && cd example-walrus-sites
TITLE: Site Builder Commands DESCRIPTION: Documentation for commands used with the Walrus Site builder, enabling customization and deployment of sites.
SOURCE: https://docs.wal.app/operator-guide/operator-guide
LANGUAGE: Rust CODE:
// Placeholder for Rust code related to Walrus Site builder commands
TITLE: Start Walrus Node Service and Monitor Logs DESCRIPTION: Starts the Walrus node service after a restore operation and monitors its startup logs. The node will begin downloading and replaying events, which may take time to reach an 'Active' state.
SOURCE: https://docs.wal.app/print
LANGUAGE: shell CODE:
sudo systemctl start walrus-node.service
# Monitor startup logs
sudo journalctl -u walrus-node.service -f
TITLE: Example Wrapped Blob Smart Contract (Move) DESCRIPTION: This snippet provides an example of a Move smart contract that implements a wrapped blob for use with the Walrus system. It demonstrates how to interact with Walrus objects within your own Sui smart contracts.
SOURCE: https://docs.wal.app/print
LANGUAGE: Move CODE:
module examples::wrapped_blob {
use sui::object::{Self, UID};
use walrus::blob::{Self, Blob};
struct WrappedBlob has key {
id: UID,
blob: Blob
}
public entry fun create_wrapped_blob(blob: Blob, காயின்: &mut Wallet) {
let wrapped_blob = WrappedBlob {
id: object::new( காயின்),
blob: blob
};
sui::object::share_object(wrapped_blob);
}
}
TITLE: Move Contracts and Example for Walrus On-Chain Interaction DESCRIPTION: This snippet focuses on interacting with Walrus on-chain objects using the Move programming language. It includes the currently deployed Walrus contracts and a simple example contract that utilizes these Walrus objects for more complex application development.
SOURCE: https://docs.wal.app/usage/examples
LANGUAGE: Move CODE:
// Deployed Walrus contracts
// Simple example contract importing and using Walrus objects
TITLE: Rust Example: Walrus Protocol Interaction DESCRIPTION: This Rust code snippet demonstrates a basic interaction with the Walrus protocol, potentially involving publishing or retrieving data. It serves as an example for developers integrating Walrus into Rust applications.
SOURCE: https://docs.wal.app/blog/06_mainnet
LANGUAGE: Rust CODE:
use walrus_client::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new("http://localhost:8080");
let file_content = std::fs::read("my_file.txt")?;
let blob_id = client.publish(file_content).await?;
println!("Published blob with ID: {}", blob_id);
Ok(())
}
TITLE: Setting up GitHub Secrets and Vars for CI/CD DESCRIPTION: This section guides on setting up GitHub secrets and variables for Continuous Integration and Continuous Deployment (CI/CD) pipelines for Walrus Sites. It ensures secure handling of credentials and configurations.
SOURCE: https://docs.wal.app/glossary
LANGUAGE: bash CODE:
# Example of setting a GitHub secret (conceptual)
git config --local user.name "Your Name"
git config --local user.email "you@example.com"
TITLE: Configure GitHub Workflow for Walrus Sites CI/CD DESCRIPTION: This section details how to set up a GitHub workflow for Continuous Integration and Continuous Deployment (CI/CD) of Walrus Sites. It includes examples of workflow files and configurations.
SOURCE: https://docs.wal.app/dev-guide/costs
LANGUAGE: yaml CODE:
name: Deploy Walrus Site
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Deploy Site
run: |
# Commands to build and deploy your Walrus Site
walrus-site build ./my-site
walrus-site publish ./my-site --target-env production
TITLE: Update Walrus CLI via Script DESCRIPTION: Updates an existing Walrus CLI installation to the latest version by re-running the installation script with the '-f' flag, overwriting the prior version.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
curl -sSf https://install.wal.app | sh -s -- -f
TITLE: Download and Install Walrus Site Builder (Mainnet) DESCRIPTION: This snippet shows how to download the Walrus site-builder binary for the mainnet using curl. It requires setting the SYSTEM environment variable to your specific operating system and architecture. After downloading, the script makes the binary executable.
SOURCE: https://docs.wal.app/print
LANGUAGE: Shell CODE:
SYSTEM= # set this to your system: ubuntu-x86_64, ubuntu-x86_64-generic, macos-x86_64, macos-arm64, windows-x86_64.exe
curl https://storage.googleapis.com/mysten-walrus-binaries/site-builder-mainnet-latest-$SYSTEM -o site-builder
chmod +x site-builder
TITLE: Configure Mainnet Service Worker Portal Environment DESCRIPTION: Copies the example environment file for the mainnet service worker portal to create a local configuration file. This sets up the necessary environment variables for running the mainnet service worker portal.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
cp ./portal/worker/.env.mainnet.example ./portal/worker/.env.local
TITLE: Run walrus-upload-relay with Docker DESCRIPTION: This command runs the walrus-upload-relay Docker image and displays its help information. It's a basic command to verify the Docker setup.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
docker run -it --rm mysten/walrus-upload-relay --help
TITLE: Store Quilt API Response Example DESCRIPTION: An example JSON response from the store quilt API, detailing the result of storing a quilt. It includes information about newly created blobs, their IDs, storage details, costs, and identifiers for individual blobs within the quilt.
SOURCE: https://docs.wal.app/usage/web-api
LANGUAGE: json CODE:
{
"blobStoreResult": {
"newlyCreated": {
"blobObject": {
"id": "0xe6ac1e1ac08a603aef73a34328b0b623ffba6be6586e159a1d79c5ef0357bc02",
"registeredEpoch": 103,
"blobId": "6XUOE-Q5-nAXHRifN6n9nomVDtHZQbGuAkW3PjlBuKo",
"size": 1782224,
"encodingType": "RS2",
"certifiedEpoch": null,
"storage": {
"id": "0xbc8ff9b4071927689d59468f887f94a4a503d9c6c5ef4c4d97fcb475a257758f",
"startEpoch": 103,
"endEpoch": 104,
"storageSize": 72040000
},
"deletable": false
},
"resourceOperation": {
"registerFromScratch": {
"encodedLength": 72040000,
"epochsAhead": 1
}
},
"cost": 12075000
}
},
"storedQuiltBlobs": [
{
"identifier": "another_walrus.jpg",
"quiltPatchId": "6XUOE-Q5-nAXHRifN6n9nomVDtHZQbGuAkW3PjlBuKoBAQDQAA"
},
{
"identifier": "walrus.jpg",
"quiltPatchId": "6XUOE-Q5-nAXHRifN6n9nomVDtHZQbGuAkW3PjlBuKoB0AB7Ag"
}
]
}
TITLE: Install Walrus CLI on Windows DESCRIPTION: Downloads the latest Testnet version of the Walrus CLI executable for Windows using PowerShell. The downloaded file will be named 'walrus.exe'.
SOURCE: https://docs.wal.app/print
LANGUAGE: powershell CODE:
(New-Object System.Net.WebClient).DownloadFile(
"https://storage.googleapis.com/mysten-walrus-binaries/walrus-testnet-latest-windows-x86_64.exe",
"walrus.exe"
)
TITLE: Authenticated Publisher Setup for Walrus DESCRIPTION: This section describes the setup for an authenticated publisher in Walrus, which requires JWT authentication for HTTP requests to store blobs. It outlines the steps for the publisher operator to configure JWT authentication, including setting the algorithm, expiration time, and secret. It also details the client's role in obtaining and using JWT tokens for authorized storage operations.
SOURCE: https://docs.wal.app/operator-guide/auth-publisher
LANGUAGE: http CODE:
PUT /<blob_path> HTTP/1.1
Host: <publisher_host>
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/octet-stream
<blob_data>
TITLE: Configure Testnet Service Worker Portal Environment DESCRIPTION: Copies the example environment file for the testnet service worker portal to create a local configuration file. This sets up the necessary environment variables for running the testnet service worker portal.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
cp ./portal/worker/.env.testnet.example ./portal/worker/.env.local
TITLE: Setting up GitHub Secrets and Vars for CI/CD DESCRIPTION: This section guides on setting up GitHub secrets and variables for Continuous Integration and Continuous Deployment (CI/CD) pipelines for Walrus Sites. It ensures secure handling of credentials and configurations.
SOURCE: https://docs.wal.app/design/architecture
LANGUAGE: bash CODE:
# Example of setting a GitHub secret (conceptual)
git config --local user.name "Your Name"
git config --local user.email "you@example.com"
TITLE: Publishing a Walrus Site DESCRIPTION: Instructions for publishing a Walrus Site, likely involving CLI commands or API interactions.
SOURCE: https://docs.wal.app/operator-guide/operator-guide
LANGUAGE: Rust CODE:
// Placeholder for Rust code related to publishing a Walrus Site
TITLE: Setting up GitHub Secrets and Vars for CI/CD DESCRIPTION: This section guides on setting up GitHub secrets and variables for Continuous Integration and Continuous Deployment (CI/CD) pipelines for Walrus Sites. It ensures secure handling of credentials and configurations.
SOURCE: https://docs.wal.app/legal/walrus_general_tos
LANGUAGE: bash CODE:
# Example of setting a GitHub secret (conceptual)
git config --local user.name "Your Name"
git config --local user.email "you@example.com"
TITLE: Aggregator HTTP GET Endpoint DESCRIPTION: The aggregator service exposes a simple HTTP GET endpoint for users to retrieve reconstructed blobs. This functionality is central to how users interact with the data stored on Walrus.
SOURCE: https://docs.wal.app/glossary
LANGUAGE: HTTP CODE:
HTTP GET
TITLE: Site Builder Commands DESCRIPTION: This section details the commands available for the Walrus Site builder, enabling users to manage and deploy their websites. It covers essential functionalities for site creation and management.
SOURCE: https://docs.wal.app/walrus-sites/tutorial
LANGUAGE: Light CODE:
# Example Light commands for Walrus Site builder
walrus-cli build
walrus-cli deploy --target production
walrus-cli config set api_key "YOUR_API_KEY"
TITLE: Setting up GitHub Secrets and Variables for CI/CD DESCRIPTION: This guide explains how to configure GitHub secrets and variables, essential for setting up a Continuous Integration and Continuous Deployment (CI/CD) pipeline for Walrus Sites.
SOURCE: https://docs.wal.app/operator-guide/upload-relay
LANGUAGE: bash CODE:
# Example: Setting a GitHub secret
git config --local user.name "Your Name"
git config --local user.email "you@example.com"
TITLE: Check Docker Version (Shell) DESCRIPTION: Verifies if Docker is installed on the system by checking its version. This is a prerequisite for deploying the portal using Docker.
SOURCE: https://docs.wal.app/walrus-sites/portal
LANGUAGE: shell CODE:
docker --version
TITLE: View Sui Client Environments DESCRIPTION: This command displays all configured Sui client environments, indicating their aliases, RPC URLs, and which environment is currently active. It's useful for verifying the current setup.
SOURCE: https://docs.wal.app/print
LANGUAGE: bash CODE:
$ sui client envs
╭──────────┬─────────────────────────────────────┬────────╮
│ alias │ url │ active │
├──────────┼─────────────────────────────────────┼────────┤
│ devnet │ https://fullnode.devnet.sui.io:443 │ │
│ localnet │ http://127.0.0.1:9000 │ │
│ testnet │ https://fullnode.testnet.sui.io:443 │ * │
│ mainnet │ https://fullnode.mainnet.sui.io:443 │ │
╰──────────┴─────────────────────────────────────┴────────╯