### Setup Python Virtual Environment and Install Dependencies Source: https://docs.oasis.io/build/use-cases/tgbot Commands to set up a Python virtual environment, activate it, and install the 'python-telegram-bot' dependency using a requirements file. ```bash python -m venv my_env source my_env/bin/activate echo python-telegram-bot > requirements.txt pip install -r requirements.txt ``` -------------------------------- ### Install Oasis App on Ledger Nano S Source: https://docs.oasis.io/node/reference/upgrade-logs/mainnet Commands to make the installer script executable and run the installation process on a connected Ledger Nano S device. ```bash chmod +x installer_s.sh ./installer_s.sh load ``` -------------------------------- ### Setup Python Telegram Bot Environment Source: https://context7_llms Steps to set up a Python virtual environment, install the 'python-telegram-bot' library, and create a basic bot script. This script responds to the '/hello' command. ```shell python -m venv my_env source my_env/bin/activate echo python-telegram-bot > requirements.txt pip install -r requirements.txt ``` ```python import os from telegram import Update from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes async def hello(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: await update.message.reply_text(f'Hello {update.effective_user.first_name}') app = ApplicationBuilder().token(os.getenv("TOKEN")).build() app.add_handler(CommandHandler("hello", hello)) app.run_polling() ``` -------------------------------- ### Install Go Client SDK (Go) Source: https://context7_llms Instructions for installing the Go client SDK for Oasis. Requires Go version 1.20.2 or higher. Includes steps to install a specific version if needed. ```bash go get golang.org/dl/go1.20.2 go1.20.5 download ``` -------------------------------- ### Install Protobuf Go Plugin to Specific Directory Source: https://context7_llms Installs the `protoc-gen-go` plugin to `/usr/local/bin` using `sudo`, bypassing the need to add `$GOPATH/bin` to the system's PATH. This is an alternative installation method for the protobuf Go plugin. ```bash sudo GOBIN=/usr/local/bin ${OASIS_GO:-go} install google.golang.org/protobuf/cmd/protoc-gen-go@v1.21.0 ``` -------------------------------- ### Setup Hardhat TypeScript Environment Source: https://docs.oasis.io/build/use-cases/key-generation Commands to initialize a Hardhat project and install necessary dependencies for ROFL client integration and EVM interaction. ```bash npx hardhat init npm i @oasisprotocol/rofl-client ethers dotenv @types/node npm i -D tsx ``` -------------------------------- ### Install Oasis Sapphire with Wagmi and RainbowKit Source: https://docs.oasis.io/build/sapphire/develop/browser Instructions for installing the necessary libraries using npm, pnpm, or Yarn. This includes `@rainbow-me/rainbowkit`, `wagmi`, `viem`, `@tanstack/react-query`, and `@oasisprotocol/sapphire-wagmi-v2`. ```npm npm install @rainbow-me/rainbowkit wagmi@2.x viem@2.x @tanstack/react-query @oasisprotocol/sapphire-wagmi-v2 ``` ```pnpm pnpm add @rainbow-me/rainbowkit wagmi@2.x viem@2.x @tanstack/react-query @oasisprotocol/sapphire-wagmi-v2 ``` ```yarn yarn add @rainbow-me/rainbowkit wagmi@2.x viem@2.x @tanstack/react-query @oasisprotocol/sapphire-wagmi-v2 ``` -------------------------------- ### Oasis CLI Installation Source: https://context7_llms Instructions for installing the Oasis CLI, a tool for interacting with the smart contract. ```APIDOC ## Oasis CLI Installation ### Description Instructions for installing the Oasis CLI, a tool for interacting with the smart contract. ### Installation Options You can use one of the following methods: 1. **Binary Releases**: [Download from releases](https://github.com/oasisprotocol/cli/releases) 2. **Compile from Source**: [Follow instructions](https://github.com/oasisprotocol/cli/blob/master/README.md) ``` -------------------------------- ### Install Sapphire Viem Dependencies Source: https://docs.oasis.io/build/sapphire/develop/browser Commands to install the required Sapphire Viem library and dependencies using various package managers. ```bash npm install @oasisprotocol/sapphire-viem-v2 viem@2.x pnpm add @oasisprotocol/sapphire-viem-v2 viem@2.x yarn add @oasisprotocol/sapphire-viem-v2 viem@2.x ``` -------------------------------- ### Install Viem v2 and @oasisprotocol/sapphire-viem-v2 Source: https://context7_llms Install the required libraries for integrating Viem v2 with Sapphire ParaTime. This includes Viem v2 and the Sapphire wrapper for Viem. ```shell npm install @oasisprotocol/sapphire-viem-v2 viem@2.x ``` ```shell pnpm add @oasisprotocol/sapphire-viem-v2 viem@2.x ``` ```shell yarn add @oasisprotocol/sapphire-viem-v2 viem@2.x ``` -------------------------------- ### Install Specific Go Version Source: https://docs.oasis.io/core/development-setup/prerequisites Commands to install and download a specific version of Go using the official Go distribution tool. ```bash go install golang.org/dl/go1.25.5@latest go1.25.5 download ``` -------------------------------- ### Go: Initialize Project and Client Source: https://docs.oasis.io/build/tools/build-paratime/minimal-runtime Sets up a new Go module for a client interacting with an Oasis runtime. It includes initializing the module and tidying dependencies. ```bash go mod init example.com/oasisprotocol/minimal-runtime-client go mod tidy ``` -------------------------------- ### Pruning Log Output Example Source: https://docs.oasis.io/core/oasis-node/cli This is an example of the log output generated when the 'prune-experimental' command starts the consensus database pruning process. It indicates the start of a potentially time-consuming operation. ```json {"caller":"storage.go:433","level":"info","module":"cmd/storage", "msg":"Starting consensus databases pruning. This may take a while...", "ts":"2025-10-23T11:02:11.129822974Z"} ``` -------------------------------- ### Go: Minimal Runtime Client Example Source: https://docs.oasis.io/build/tools/build-paratime/minimal-runtime A Go program demonstrating how to connect to a local Oasis node, query account balances, and perform token transfers using the Oasis SDK client library. It requires specific runtime and node configurations. ```go // Package main provides a test for token transfers. package main import ( "context" "fmt" "os" "time" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" "github.com/oasisprotocol/oasis-core/go/common" cmnGrpc "github.com/oasisprotocol/oasis-core/go/common/grpc" "github.com/oasisprotocol/oasis-core/go/common/logging" "github.com/oasisprotocol/oasis-core/go/common/quantity" "github.com/oasisprotocol/oasis-sdk/client-sdk/go/client" "github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/accounts" "github.com/oasisprotocol/oasis-sdk/client-sdk/go/testing" "github.com/oasisprotocol/oasis-sdk/client-sdk/go/types" ) // In reality these would come from command-line arguments, the environment // or a configuration file. const ( // This is the default runtime ID as used in oasis-net-runner. It can // be changed by using its --fixture.default.runtime.id argument. runtimeIDHex = "8000000000000000000000000000000000000000000000000000000000000000" // This is the default client node address as set in oasis-net-runner. nodeAddress = "unix:/tmp/minimal-runtime-test/net-runner/network/client-0/internal.sock" ) // The global logger. var logger = logging.GetLogger("minimal-runtime-client") // Client contains the client helpers for communicating with the runtime. This is a simple wrapper // used for convenience. type Client struct { client.RuntimeClient // Accounts are the accounts module helpers. Accounts accounts.V1 } // showBalances is a simple helper for displaying account balances. func showBalances(ctx context.Context, rc *Client, address types.Address) error { // Query the runtime, specifically the accounts module, for the given address' balances. rsp, err := rc.Accounts.Balances(ctx, client.RoundLatest, address) if err != nil { return fmt.Errorf("failed to fetch account balances: %w", err) } fmt.Printf("=== Balances for %s ===\n", address) for denom, balance := range rsp.Balances { fmt.Printf("%s: %s\n", denom, balance) } fmt.Printf("\n") return nil } func tokenTransfer() error { // Initialize logging. if err := logging.Initialize(os.Stdout, logging.FmtLogfmt, logging.LevelDebug, nil); err != nil { return fmt.Errorf("unable to initialize logging: %w", err) } // Decode hex runtime ID into something we can use. var runtimeID common.Namespace if err := runtimeID.UnmarshalHex(runtimeIDHex); err != nil { return fmt.Errorf("malformed runtime ID: %w", err) } // Establish a gRPC connection with the client node. logger.Info("connecting to local node") conn, err := cmnGrpc.Dial(nodeAddress, grpc. ``` -------------------------------- ### Configure and Start Runtime Node Source: https://docs.oasis.io/core/development-setup/deploying-a-runtime Sets up the necessary environment variables and executes the oasis-node binary to start a compute and storage node. This process includes configuring paths, logging, and consensus parameters for a development environment. ```bash export RUNTIME_BINARY=/workdir/target/default/release/simple-keyvalue export SEED_NODE_ADDRESS=@127.0.0.1:20000 mkdir -m 0700 /tmp/runtime-example/runtime-node oasis-node --datadir /tmp/runtime-example/runtime-node --log.level debug --log.format json --log.file /tmp/runtime-example/runtime-node/node.log --grpc.log.debug --worker.registration.entity $ENTITY_DIR/entity.json --genesis.file $GENESIS_JSON --worker.storage.enabled --worker.compute.enabled --runtime.provisioner unconfined --runtime.supported $RUNTIME_ID --runtime.paths $RUNTIME_ID=$RUNTIME_BINARY --consensus.cometbft.debug.addr_book_lenient --consensus.cometbft.debug.allow_duplicate_ip --consensus.cometbft.p2p.seed $SEED_NODE_ADDRESS --debug.dont_blame_oasis --debug.allow_test_keys ``` -------------------------------- ### Run Playwright Tests Source: https://context7_llms Executes the Playwright end-to-end tests after installation and setup. This command will run all tests defined in your project. ```shell npx playwright test ``` -------------------------------- ### Build and Deploy ROFL Application Source: https://docs.oasis.io/build/rofl/quickstart Commands to create the application on-chain, build the bundle, and deploy to a provider. ```bash oasis rofl create --network testnet oasis rofl build oasis rofl deploy ``` -------------------------------- ### Create and Configure Eliza Agent Project Source: https://docs.oasis.io/build/use-cases/trustless-agent Initializes a new Eliza agent project configured for ROFL. This includes selecting a database type (Pqlite) and configuring OpenAI model and API key. It also demonstrates how to start the agent locally for testing. ```bash # Create and configure the agent elizaos create -t project rofl-eliza # 1) Select Pqlite database # 2) Select the OpenAI model and enter your OpenAI key # Test the agent locally cd rofl-elizaelizaos start # Visiting http://localhost:3000 with your browser should open Eliza UI ``` -------------------------------- ### Example of podman-compose 'depends_on' Ignored (YAML) Source: https://context7_llms This YAML snippet illustrates a scenario where the 'depends_on' directive in podman-compose is ignored, causing services to start in parallel. The 'oracle' service is intended to start after 'contracts' completes, but due to the bug, they run concurrently. ```yaml services: contracts: image: "ghcr.io/foundry-rs/foundry:latest" platform: linux/amd64 volumes: - ./contracts:/contracts entrypoint: /bin/sh -c 'cd contracts && forge create' oracle: platform: linux/amd64 entrypoint: /bin/sh -c 'python main.py' restart: on-failure depends_on: contracts: condition: service_completed_successfully ``` -------------------------------- ### Get Replica Metadata Response (JSON) Source: https://context7_llms Example JSON response when retrieving ROFL replica metadata. It includes a key fingerprint and the version of the metadata. ```json { "key_fingerprint": "a54027bff15a8726", "version": "1.0.0" } ``` -------------------------------- ### Dockerfile for Oracle Worker Container (Dockerfile) Source: https://context7_llms A Dockerfile that sets up an Alpine Linux environment, installs necessary dependencies like curl and jq, copies the shell script into the container, and sets it as the entrypoint. This allows the script to run automatically when the container starts. ```dockerfile FROM docker.io/alpine:3.21.2 # Add some dependencies. RUN apk add --no-cache curl jq # The entire application is defined as a shell script. ADD app.sh /app.sh ENTRYPOINT ["/app.sh"] ``` -------------------------------- ### Install ElizaOS CLI and Create Agent Source: https://context7_llms Installs the Bun runtime and ElizaOS CLI, then creates and configures a new Eliza agent project for ROFL. It includes steps for selecting a database and OpenAI model, and testing the agent locally. ```shell # Install bun and ElizaOS CLI bun --version || curl -fsSL https://bun.sh/install | bash bun install -g @elizaos/cli # Create and configure the agent elizaos create -t project rofl-eliza # 1) Select Pqlite database # 2) Select the OpenAI model and enter your OpenAI key # Test the agent locally cd rofl-eliza elizaos start # Visiting http://localhost:3000 with your browser should open Eliza UI ``` -------------------------------- ### Provision Validator Node Network with oasis-net-runner Source: https://context7_llms Provisions a validator node network using the `oasis-net-runner` command. It sets up a temporary directory, specifies the node binary, disables runtime setup, and configures deterministic entities with initial funding. It requires the `oasis-net-runner` tool to be installed and accessible. ```bash mkdir /tmp/runtime-example oasis-net-runner \ --basedir.no_temp_dir \ --basedir /tmp/runtime-example \ --fixture.default.node.binary go/oasis-node/oasis-node \ --fixture.default.setup_runtimes=false \ --fixture.default.deterministic_entities \ --fixture.default.fund_entities \ --fixture.default.num_entities 2 ``` -------------------------------- ### Initialize Node Directories with Secure Permissions Source: https://docs.oasis.io/node/run-your-node/troubleshooting Sets up the required entity and node directories with restricted read, write, and execute permissions (700) to ensure security. ```bash mkdir --mode 700 --parents {entity,node} chmod 700 /node/data chmod 700 /node/etc ``` -------------------------------- ### Troubleshoot QGS Daemon Error: No certificate data for this platform Source: https://context7_llms This error message from the QGS daemon indicates a failure to retrieve certificate data, often occurring on multi-CPU systems where MPA (Multi-Processor Area) is not installed or configured. The solution is to correctly configure the TEE by following the 'Set up TEE - Multi-socket system' guide. ```text May 09 13:24:16 oasis-node-1 qgsd[6732]: call tee_att_init_quote May 09 13:24:16 oasis-node-1 qgsd[6732]: [QPL] No certificate data for this platform. May 09 13:24:16 oasis-node-1 qgsd[6732]: [get_platform_quote_cert_data ../td_ql_logic.cpp:302] Error returned from the p_sgx_get_quote_config API. 0xe011 May 09 13:24:16 oasis-node-1 qgsd[6732]: tee_att_init_quote return 0x11001 May 09 13:24:16 oasis-node-1 qgsd[6732]: tee_att_get_quote_size return 0x1100f ``` -------------------------------- ### Install Oasis CLI using Homebrew on Linux Source: https://context7_llms This snippet shows how to install the Oasis CLI using the Homebrew package manager on Linux systems. It requires Homebrew to be installed first. After installation, the `oasis --version` command can be used to verify the installation. ```shell brew install oasis ``` ```shell oasis --version ``` -------------------------------- ### Verify Oasis CLI Installation Source: https://context7_llms Command to verify that the Oasis CLI has been installed correctly by checking its version. This command should be run after completing the installation steps for any operating system. ```shell oasis --version ``` -------------------------------- ### Build and Run Go Client Source: https://context7_llms Shell commands to fetch dependencies, build the Go client, and execute it to interact with the minimal runtime. ```shell go get go build ./minimal-runtime-client ``` -------------------------------- ### Make Installer Executable (Bash) Source: https://context7_llms This command makes the downloaded Oasis App installer script executable. This is a necessary step before running the installation script on a Ledger Nano S device. ```bash chmod +x installer_s.sh ``` -------------------------------- ### Install Oasis CLI on macOS with Homebrew Source: https://context7_llms The recommended method for installing the Oasis CLI on macOS using the Homebrew package manager. This simplifies the installation process to a single command. ```shell brew install oasis ``` -------------------------------- ### Create Runtime Binary Entry Point in Rust Source: https://docs.oasis.io/build/tools/build-paratime/minimal-runtime This Rust code provides the main entry point for the runtime binary. It uses the 'start' function from the Oasis Runtime SDK to initialize and run the defined runtime. ```rust use oasis_runtime_sdk::Runtime; fn main() { minimal_runtime::Runtime::start(); } ``` -------------------------------- ### Initialize and Configure ROFL Project Source: https://docs.oasis.io/build/rofl/quickstart Initialize a new ROFL project and define resource requirements in the rofl.yaml manifest. ```bash oasis rofl init ``` ```yaml name: my-app version: 0.1.0 tee: tdx kind: container resources: memory: 512 cpus: 1 storage: kind: disk-persistent size: 512 artifacts: firmware: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.6.2/ovmf.tdx.fd#db47100a7d6a0c1f6983be224137c3f8d7cb09b63bb1c7a5ee7829d8e994a42f kernel: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.6.2/stage1.bin#e5d4d654ca1fa2c388bf64b23fc6e67815893fc7cb8b7cfee253d87963f54973 stage2: https://github.com/oasisprotocol/oasis-boot/releases/download/v0.6.2/stage2-podman.tar.bz2#b2ea2a0ca769b6b2d64e3f0c577ee9c08f0bb81a6e33ed5b15b2a7e50ef9a09f container: runtime: https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.8.0/rofl-containers#08eb5bbe5df26af276d9a72e9fd7353b3a90b7d27e1cf33e276a82dfd551eec6 compose: compose.yaml ``` -------------------------------- ### Install ROFL Client and Ethers Dependencies Source: https://context7_llms Installs necessary npm packages for interacting with the ROFL client, Ethereum, and environment variables. It also installs tsx for running TypeScript files. ```shell npm i @oasisprotocol/rofl-client ethers dotenv @types/node npm i -D tsx ``` -------------------------------- ### Install Rust using rustup Source: https://docs.oasis.io/build/tools/build-paratime/prerequisites Installs the latest stable version of Rust and the rustup toolchain manager. This is the recommended method for managing Rust versions for Oasis SDK development. Ensure no distribution-packaged Rust is present before installation. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Start Simple Oasis Network (SGX) Source: https://context7_llms Launches a basic Oasis network with the `simple-keyvalue` test runtime in an SGX environment. This command differs from the non-SGX version by specifying `tee_hardware intel-sgx` and using SGX-compiled runtime and keymanager binaries. ```bash ./go/oasis-net-runner/oasis-net-runner \ --fixture.default.tee_hardware intel-sgx \ --fixture.default.node.binary go/oasis-node/oasis-node \ --fixture.default.runtime.binary target/sgx/x86_64-fortanix-unknown-sgx/release/simple-keyvalue.sgxs \ --fixture.default.runtime.loader target/default/release/oasis-core-runtime-loader \ --fixture.default.keymanager.binary target/sgx/x86_64-fortanix-unknown-sgx/release/simple-keymanager.sgxs ``` -------------------------------- ### Oasis Unmnemonic Tool Interactive Prompt Example Source: https://context7_llms This is an example of the interactive prompt for the Oasis unmnemonic tool, demonstrating the process of converting a BitPie mnemonic to an Oasis private key. It includes selecting the algorithm, entering mnemonic words, specifying the wallet index, confirming to write keys to disk, and setting the output directory. ```shell unmnemonic - Recover Oasis Network signing keys from mnemonics ? Which algorithm does your wallet use Bitpie ? How many words is your mnemonic 12 ? Enter word 1 ***** ? Enter word 2 ***** ? Enter word 3 ***** ? Enter word 4 ***** ? Enter word 5 ***** ? Enter word 6 ***** ? Enter word 7 ***** ? Enter word 8 **** ? Enter word 9 ***** ? Enter word 10 ***** ? Enter word 11 ***** ? Enter word 12 ***** ? Wallet index(es) (comma separated) 0 Index[0]: oasis1qp8d9kuduq0zutuatjsgltpugxvl38cuaq3gzkmn ? Write the keys to disk Yes ? Output directory /home/user/unmnemonic/wallet-export-2023-05-01 Index[0]: oasis1qp8d9kuduq0zutuatjsgltpugxvl38cuaq3gzkmn.private.pem - done Done writing wallet keys to disk, goodbye. ``` -------------------------------- ### Install Release Tooling with Pip Source: https://context7_llms Installs or upgrades Oasis' towncrier fork and Punch.py to specified versions using pip. It's recommended to use a Python virtual environment or user install for isolation. ```bash pip3 install --upgrade \ https://github.com/oasisprotocol/towncrier/archive/oasis-master.tar.gz \ punch.py~=2.0.0 ``` -------------------------------- ### Build and Install Bubblewrap from Source Source: https://context7_llms Compiles and installs Bubblewrap from its source tarball. This process involves extracting the archive, configuring the build, compiling the code, and installing it to the system. Assumes necessary build dependencies are met. ```bash tar -xf bubblewrap-0.4.1.tar.xz cd bubblewrap-0.4.1 ./configure --prefix=/usr make sudo make install ``` -------------------------------- ### Install Protobuf Go Plugin Source: https://context7_llms Installs the `protoc-gen-go` plugin, which is used for generating Go code from Protocol Buffers definitions. This is an optional dependency required if you modify Go protobuf files. ```bash ${OASIS_GO:-go} install google.golang.org/protobuf/cmd/protoc-gen-go@v1.21.0 ``` -------------------------------- ### Install jemalloc (Shell) Source: https://context7_llms Installs jemalloc version 5.2.1 with specific configurations for reproducible builds and a custom prefix. This process involves downloading the source, verifying its checksum, configuring the build, and installing it to the default /usr/local prefix. ```shell JEMALLOC_VERSION=5.2.1 JEMALLOC_CHECKSUM=34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6 JEMALLOC_GITHUB=https://github.com/jemalloc/jemalloc/releases/download/ pushd $(mktemp -d) wget \ -O jemalloc.tar.bz2 \ "${JEMALLOC_GITHUB}/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2" # Ensure checksum matches. echo "${JEMALLOC_CHECKSUM} jemalloc.tar.bz2" | sha256sum -c tar -xf jemalloc.tar.bz2 cd jemalloc-${JEMALLOC_VERSION} # Ensure reproducible jemalloc build. # https://reproducible-builds.org/docs/build-path/ EXTRA_CXXFLAGS=-ffile-prefix-map=$(pwd -L)=. \ EXTRA_CFLAGS=-ffile-prefix-map=$(pwd -L)=. \ ./configure \ --with-jemalloc-prefix='je_' \ --with-malloc-conf='background_thread:true,metadata_thp:auto' make sudo make install popd ``` -------------------------------- ### Initialize and Register ROFL Provider Source: https://docs.oasis.io/node/run-your-node/rofl-node Commands to initialize the provider configuration file and register the provider on-chain. ```bash oasis rofl provider init oasis rofl provider create ``` -------------------------------- ### Deploy ROFL App with Specific Arguments Source: https://context7_llms Deploys a ROFL application to a rented machine, allowing specification of provider, offer, and rental duration. This command initiates the process of renting a machine from the ROFL marketplace and deploying the application. Ensure you have the necessary arguments like `--provider`, `--offer`, `--term`, and `--term-count`. ```shell oasis rofl deploy --deployment mainnet --provider oasis1qzc8pldvm8vm3duvdrj63wgvkw34y9ucfcxzetqr --offer small --term hour --term-count 24 ```