### Project Setup - package.json Configuration Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/js-client-guide.md Example of a package.json file with the necessary 'type': 'module' setting for ES module support and the installed dependency. ```json { "name": "my-hyperbeam-project", "version": "1.0.0", "main": "index.js", "type": "module", "dependencies": { "@permaweb/aoconnect": "^0.0.77" } } ``` -------------------------------- ### Project Setup - Bash Commands Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/js-client-guide.md Commands to create a new Node.js project, initialize npm, and install the HyperBEAM client dependency. ```bash mkdir my-hyperbeam-project cd my-hyperbeam-project npm init -y npm install @permaweb/aoconnect ``` -------------------------------- ### Run HyperBEAM Shell Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Starts the HyperBEAM interactive shell using Rebar3, which preloads devices and sets up default stores. Configuration can be overridden via config.flat. ```bash rebar3 shell ``` -------------------------------- ### Configure HyperBEAM Release Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Example configuration for the `config.flat` file used when running HyperBEAM as a release. Specifies port and private key location. ```bash port: 10001 priv_key_location: /path/to/your/wallet.json # Add other configurations as needed ``` -------------------------------- ### Run HyperBEAM Release Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Starts the HyperBEAM node from a built release package. Can be run in the console or background. ```bash cd _build/default/rel/hb ./bin/hb console # Or to start in background: ./bin/hb start ``` -------------------------------- ### Start HyperBEAM with Build Profiles Source: https://github.com/permaweb/hyperbeam/blob/main/README.md Examples of starting a HyperBEAM shell with specific build profiles like 'rocksdb' or multiple profiles. ```bash # Single profile rebar3 as rocksdb shell # Multiple profiles rebar3 as rocksdb, genesis_wasm shell ``` -------------------------------- ### Install aos CLI Source: https://github.com/permaweb/hyperbeam/blob/main/docs/build/get-started-building-on-ao-core.md Install the `aos` command-line interface and development environment using npm, bun, or pnpm. This tool is essential for interacting with the AO network and developing processes. ```bash npm i -g https://get_ao.arweave.net ``` ```bash bun install -g https://get_ao.arweave.net ``` ```bash pnpm add -g https://get_ao.arweave.net ``` -------------------------------- ### Start HyperBEAM Erlang Shell Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Starts the HyperBEAM application within an interactive Erlang shell using Rebar3. ```bash rebar3 shell ``` -------------------------------- ### Local Development Environment Setup and Testing Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/contributing-docs.md This snippet details the steps to set up a local environment for testing MkDocs documentation changes. It includes creating a virtual environment, installing dependencies, building the documentation, and starting a local web server. ```bash # Create and activate a virtual environment python3 -m venv venv source venv/bin/activate # (macOS/Linux) On Windows use `venv\Scripts\activate` # Install required packages pip3 install mkdocs mkdocs-material # Run the build script ./docs/build-all.sh # Start a local server cd mkdocs-site python3 -m http.server 8000 ``` -------------------------------- ### Clone and Navigate HyperBEAM Repository Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Steps to fork the HyperBEAM repository from GitHub and clone it to your local machine, followed by navigating into the project directory. ```bash git clone https://github.com/YOUR-USERNAME/HyperBEAM.git cd HyperBEAM ``` -------------------------------- ### Clone HyperBEAM Repository Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Clones the HyperBEAM project from GitHub and navigates into the project directory. ```bash git clone https://github.com/permaweb/HyperBEAM cd HyperBEAM ``` -------------------------------- ### Install Erlang Dependencies with Rebar3 Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Installs the necessary Erlang dependencies for the HyperBEAM core components using the Rebar3 build tool. ```bash # Install Erlang dependencies rebar3 compile ``` -------------------------------- ### Start aos Interactive Environment Source: https://github.com/permaweb/hyperbeam/blob/main/docs/build/get-started-building-on-ao-core.md Launch the `aos` command-line interface to connect to an interactive Lua environment. This environment allows you to interact with the AO network, manage your wallet, and develop new AO processes. ```bash aos ``` -------------------------------- ### Build HyperBEAM Release Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Builds a standard HyperBEAM release package using Rebar3. Optional profiles like 'rocksdb' can be included. ```bash rebar3 release # Or with a profile: rebar3 as rocksdb release ``` -------------------------------- ### Start HyperBEAM Application in Erlang Shell Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Manually starts the HyperBEAM application once inside the interactive Erlang shell. ```erlang application:ensure_all_started(hyperbeam). ``` -------------------------------- ### Compile HyperBEAM with Rebar3 Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Compiles the HyperBEAM project using the Rebar3 build tool. ```bash rebar3 compile ``` -------------------------------- ### Start Compute Unit Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/components-compute-unit/setup.md Commands to start the Compute Unit, including a version with hot-reloading for development. ```bash npm start # For development with hot-reloading: npm run dev ``` -------------------------------- ### Setup Test Environment Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/source-code/dev_cache.md Creates a test environment by starting the required application, configuring a file-system store, resetting the store, creating a wallet, and starting a node with cache writer configurations. ```erlang setup_test_env() -> any() Create a test environment with a local store and node. Ensures that the required application is started, configures a local file-system store, resets the store for a clean state, creates a wallet for signing requests, and starts a node with the store and trusted cache writer configuration. ``` -------------------------------- ### Run Erlang Unit Tests Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Executes the unit tests for the Erlang components of HyperBEAM using Rebar3 to verify the development setup. ```bash # Run Erlang tests rebar3 eunit ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/components-compute-unit/setup.md Steps to clone the local-cu repository and install its Node.js dependencies. ```bash git clone https://github.com/permaweb/local-cu cd local-cu npm i ``` -------------------------------- ### Installation Process Overview Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/overview/index.md The HyperBEAM installation involves checking system requirements, installing system dependencies, setting up and configuring HyperBEAM itself, and optionally setting up the Compute Unit. Administrative privileges and a stable internet connection are recommended. ```Shell # 1. Check System Requirements # Ensure your hardware and operating system meet the minimum requirements. # 2. Install System Dependencies # Set up the necessary system packages. # 3. Setup & Configure HyperBEAM # Clone, Compile, Configure, and Run HyperBEAM. # 4. Setup & Configure the Compute Unit # Clone, Compile, Configure, and Run the Local Compute Unit. # 5. (Optional) Verify Installation # Follow guides to ensure everything is working. ``` -------------------------------- ### Local Development Environment Setup Source: https://github.com/permaweb/hyperbeam/blob/main/docs/README.md Sets up a local development environment for contributing to the documentation, including creating a virtual environment, activating it, and installing required packages. ```bash python3 -m venv venv source venv/bin/activate pip3 install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin ``` -------------------------------- ### HyperBEAM JavaScript Client Guide Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/index.md This guide explains how to interact with HyperBEAM nodes using a JavaScript client library. It covers the basic functionalities and provides examples for common operations. ```javascript // Example usage of the HyperBEAM JavaScript client // Import the HyperBEAM client library // import HyperbeamClient from 'hyperbeam-client'; // // Initialize the client // const client = new HyperbeamClient('YOUR_NODE_ADDRESS'); // // Example: Sending a message to a HyperBEAM node // async function sendMessage() { // try { // const response = await client.sendMessage('Hello HyperBEAM!'); // console.log('Received response:', response); // } catch (error) { // console.error('Error sending message:', error); // } // } // sendMessage(); ``` -------------------------------- ### Process Definition Example Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/setting-up-selecting-devices.md Defines a process with scheduler, execution, and persistence devices, including cron frequency and PoDA configuration. ```erlang Device: Process/1.0 Scheduler-Device: Scheduler/1.0 Execution-Device: Stack/1.0 Execution-Stack: "Scheduler/1.0", "Cron/1.0", "WASM/1.0", "PoDA/1.0" Cron-Frequency: 10-Minutes WASM-Image: WASMImageID PoDA: Device: PoDA/1.0 Authority: A Authority: B Authority: C Quorum: 2 ``` -------------------------------- ### Erlang API Configuration Example Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/configuration/index.md Demonstrates how to start HyperBEAM using the Erlang API with a complex configuration, including nested options for HTTP. This is the recommended approach for production deployments due to its flexibility with data types and structures. ```bash rebar3 shell --eval "hb:start_mainnet(#{ port => 10001, priv_key_location => <<\"./wallet.json\">>, mode => debug, http_extra_opts => #{ force_message => true, store => {hb_store_fs, #{ prefix => \"local-storage\" }} cache_control => [<<\"always\">>] } })." ``` -------------------------------- ### Example Usage: Getting Node Information Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/api.md A bash command example demonstrating how to retrieve node information from the HyperBEAM API using curl. ```bash curl http://localhost:10000/~meta@1.0/info ``` -------------------------------- ### Erlang Debugging with Event Macro Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Demonstrates how to use the Erlang event macro for debugging, including basic variable logging and more context-specific logging. ```erlang ?event({debug, Variable}). % or for more context: ?event(module_name, {debug_label, Variable}). % for more detailed output with explicit information: ?event(module_name, {debug_label, {explicit, Variable}}). ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/components-compute-unit/setup.md Example of a .env file for minimal CU configuration, including UNIT_MODE, HB_URL, PORT, and WALLET_FILE. ```bash UNIT_MODE=hbu HB_URL=http://localhost:10000 PORT=6363 WALLET_FILE=./wallet.json NODE_CONFIG_ENV="development" ``` -------------------------------- ### Start HyperBEAM Node with Mainnet Configuration Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/setting-up-selecting-devices.md Initializes a HyperBEAM node for mainnet operation, specifying the port and the location of the Arweave wallet key file. This is a fundamental step for setting up any HyperBEAM node. ```bash rebar3 shell --eval "hb:start_mainnet(#{ port => 9001, key_location => 'path/to/my/wallet.key' })." ``` -------------------------------- ### Start As With Parameters Test Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Tests starting a process or entity as a specific type with parameters. ```erlang start_as_with_parameters_test(Opts) -> any(). ``` -------------------------------- ### Getting Help and Support Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Directs users to resources for obtaining help with HyperBEAM, including troubleshooting guides, GitHub issues, and community Discord channels. ```text Check the [Troubleshooting](troubleshooting.md) guide Search or ask questions on [GitHub Issues](https://github.com/permaweb/HyperBEAM/issues) Join the community on [Discord](https://discord.gg/V3yjzrBxPM) ``` -------------------------------- ### Starting a Basic HyperBEAM Node Source: https://github.com/permaweb/hyperbeam/blob/main/docs/run/running-a-hyperbeam-node.md Starts a HyperBEAM node using rebar3 for development or testing. This loads all modules, initializes with default settings, starts the HTTP server, and provides an interactive Erlang shell. ```bash rebar3 shell ``` -------------------------------- ### Start Function Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/source-code/hb_http.md Initializes or starts a process. ```erlang start() -> any() ``` -------------------------------- ### Start Simple Pay Server Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Starts a server configured with a `simple-pay@1.0` pre-processor. ```erlang start_simple_pay() -> any() start_simple_pay(Opts) -> any() start_simple_pay(Arg1, Arg2) -> any() ``` -------------------------------- ### Start Simple Pay Server Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/source-code/hb.md Starts a server configured with a `simple-pay@1.0` pre-processor. ```erlang start_simple_pay() -> any() start_simple_pay(Opts) -> any() start_simple_pay(Arg1, Arg2) -> any() ``` -------------------------------- ### Start Process Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Starts a process with given arguments. ```erlang start(Args) -> any() ``` -------------------------------- ### Start a Basic HyperBEAM Node Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Starts a HyperBEAM node in an interactive Erlang shell using Rebar3. This command compiles the project, initializes the node with default settings, and starts the default HTTP server. ```bash rebar3 shell ``` -------------------------------- ### Start Environment Helper Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt A helper function to ensure the environment is properly started. ```erlang start(Env) -> any() ``` -------------------------------- ### Build and Serve HyperBEAM Documentation Locally Source: https://github.com/permaweb/hyperbeam/blob/main/README.md Instructions to set up the environment, build, and serve the HyperBEAM documentation locally. This involves creating a virtual environment, installing dependencies like MkDocs and Material for MkDocs, building the documentation, and serving it via a local HTTP server. ```bash # Create and activate a virtual environment (optional but recommended) python3 -m venv venv source venv/bin/activate # (macOS/Linux) On Windows use `venv\Scripts\activate` # Install required packages pip3 install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin # Build the docs ./docs/build-all.sh # Serve the docs cd mkdocs-site python3 -m http.server 8000 # Then open http://127.0.0.1:8000/ in your browser ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/reference/troubleshooting.md Installs all the necessary dependencies for a Node.js project, typically defined in the `package.json` file. This is a common step to resolve issues when the Compute Unit fails to start. ```javascript npm i ``` -------------------------------- ### Stop HyperBEAM Release Node Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Commands to stop a HyperBEAM node that was started from a release package. ```bash # If started with ./bin/hb start: ./bin/hb stop # If started with ./bin/hb console: Ctrl+C in the terminal ``` -------------------------------- ### Start Link to RocksDB Store Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Starts the RocksDB store process and links it to the caller. ```erlang start_link(Args) -> any() ``` -------------------------------- ### Complete Mainnet Configuration with start_mainnet Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/configuration/configuration-examples.md A comprehensive configuration for mainnet deployment using the `hb:start_mainnet/1` function in Erlang. It includes port, mode, private key location, and detailed HTTP extra options for storage and caching. ```bash rebar3 shell --eval " hb:start_mainnet(#{ port => 10001, mode => debug, priv_key_location => <<\"./wallet.json\">>, http_extra_opts => #{ force_message => true, store => [{hb_store_fs, #{ prefix => \"local-cache\" }}, {hb_store_gateway, #{}}], cache_control => [<<\"always\">>] } }). " ``` -------------------------------- ### Assign a Variable in aos Source: https://github.com/permaweb/hyperbeam/blob/main/docs/build/get-started-building-on-ao-core.md Demonstrates how to assign a string variable within the `aos` interactive Lua environment. This is a basic example of interacting with the process's Lua state. ```lua [aos]> myVariable = "Hello from aos!" -- This assigns the string "Hello from aos!" to the variable 'myVariable' -- within the current process's Lua environment. [aos]> myVariable -- Displays the content of 'myVariable' Hello from aos! ``` -------------------------------- ### ~relay@1.0 Device Communication Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/setting-up-selecting-devices.md Demonstrates how to interact with the ~relay@1.0 device to relay messages. It shows an example of using 'call' mode to get a response from a remote peer via HTTP. ```APIDOC curl /~relay@.1.0/call?method=GET?0.path=https://www.arweave.net/ ~relay@1.0 Device: - Purpose: Relays messages between nodes and HTTP(S) endpoints. - Modes: - Call mode: Returns a response from the remote peer. - Cast mode: Returns immediately while the message is relayed asynchronously. - Parameters for call mode: - method: The HTTP method (e.g., GET). - path: The URL path to the resource. ``` -------------------------------- ### Starter - Initialize HyperBEAM Client Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/js-client-guide.md Initializes the HyperBEAM client with node URL and wallet key path, then calls the initialize method. ```javascript import { HyperBEAMClient } from './hyperbeam-client.js'; // Create a client instance const client = new HyperBEAMClient({ nodeUrl: 'http://localhost:10000', // HyperBEAM node URL keyPath: 'wallet.json' // Path to your wallet key file }); // Initialize the client await client.initialize(); // Your Code Here ``` -------------------------------- ### Hyperbeam Node and Development Guide Source: https://github.com/permaweb/hyperbeam/blob/main/docs/theme/templates/base.html Guides users on how to run their own Hyperbeam node and provides resources for developers looking to build on the Hyperbeam platform. ```html [Start to learn about AO-Core, HyperBEAM and the Permaweb](/introduction/what-is-ao-core.html) [Power onchain compute, enable token activity, and earn fees.](/run/running-a-hyperbeam-node.html) [Real use-case walkthroughs for leveraging HyperBEAM in your applications.](/build/get-started-building-on-ao-core.html) ``` -------------------------------- ### Basic Development Configuration (config.flat) Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/configuration/configuration-examples.md A simple configuration for local development using a config.flat file. It specifies the port, mode, and private key location. ```yaml port: 10000 mode: debug priv_key_location: ./wallet.json ``` -------------------------------- ### Get Request - Fetch Info Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/js-client-guide.md Demonstrates making an unauthenticated GET request to the '/~meta@1.0/info' endpoint with debug logging enabled. ```javascript // Make an unauthenticated GET request const response = await client.get('/~meta@1.0/info', { debug: true }); console.log(response); ``` -------------------------------- ### HyperBEAM Command Line Configuration Example Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/configuration/configuration-methods.md Provides an example of passing configuration options directly via the command line using `rebar3 shell --eval`. This method is suitable for simpler configurations or when overriding file/environment settings. ```bash rebar3 shell --eval "hb:start_mainnet(#{ port => 10001, priv_key_location => <<\"path/to/wallet.json\">> })." ``` -------------------------------- ### Serve Built Documentation Locally Source: https://github.com/permaweb/hyperbeam/blob/main/docs/README.md Starts a simple HTTP server in the `mkdocs-site` directory to view the locally built documentation. Requires Python 3. ```bash # Navigate to the site directory: cd mkdocs-site # Start a simple Python HTTP server: python3 -m http.server 8000 # Open your web browser and go to http://127.0.0.1:8000/ ``` -------------------------------- ### Check Node.js Version Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/reference/troubleshooting.md Displays the installed Node.js version. Ensuring Node.js is correctly installed and at a compatible version is essential for running the Compute Unit. ```javascript node -v ``` -------------------------------- ### Verify Erlang Installation Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/reference/troubleshooting.md Checks if Erlang is correctly installed and reports the OTP release version. This is a crucial step for debugging Rebar3 bootstrap failures. ```erlang erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' ``` -------------------------------- ### Start HyperBEAM Node Source: https://github.com/permaweb/hyperbeam/blob/main/README.md Command to start a HyperBEAM node using Rebar3, loading default configurations. ```bash rebar3 shell ``` -------------------------------- ### Install Erlang Dependencies Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/reference/troubleshooting.md Installs essential dependencies required for Erlang compilation on Debian-based systems. These include SSL libraries, ncurses for terminal interaction, and build tools like make, cmake, gcc, and g++. ```bash sudo apt-get install -y libssl-dev ncurses-dev make cmake gcc g++ ``` -------------------------------- ### Process Definition Example Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Illustrates a conceptual process definition message, specifying devices, execution stack components, and configuration parameters. ```text Device: process@1.0 Scheduler-Device: [`scheduler@1.0`](../resources/source-code/dev_scheduler.md) Execution-Device: [`stack@1.0`](../resources/source-code/dev_stack.md) Execution-Stack: "[`scheduler@1.0`](../resources/source-code/dev_scheduler.md)", "[`cron@1.0`](../resources/source-code/dev_cron.md)", "[`wasm64@1.0`](../resources/source-code/dev_wasm.md)", "[`PoDA@1.0`](../resources/source-code/dev_poda.md)" Cron-Frequency: 10-Minutes WASM-Image: PoDA: Device: [`PoDA/1.0`](../resources/source-code/dev_poda.md) Authority: Authority: Quorum: 2 ``` -------------------------------- ### Example .env File for Compute Unit Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/components-compute-unit/configuration.md A sample `.env` file demonstrating a minimal configuration for the Compute Unit (CU) to operate in HyperBEAM mode. ```bash UNIT_MODE=hbu HB_URL=http://localhost:10000 PORT=6363 WALLET_FILE=./wallet.json NODE_CONFIG_ENV="development" ``` -------------------------------- ### Example Usage: Creating a Process Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/api.md A bash command example illustrating how to create a new AO process via the HyperBEAM API using curl, including setting the Content-Type and providing a JSON payload. ```bash curl -X POST http://localhost:10000/~process@1.0/create \ -H "Content-Type: application/json" \ -d '{"module": "module-id", "scheduler": "scheduler-id"}' ``` -------------------------------- ### Verify HyperBEAM Node Status Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Checks if a HyperBEAM node is running by querying its meta device info endpoint. ```bash curl http://localhost:10000/~meta@1.0/info ``` -------------------------------- ### Verify HyperBEAM Release Node Status Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/setup.md Checks the status of a running HyperBEAM release node using its configured port. ```bash curl http://localhost:10001/~meta@1.0/info ``` -------------------------------- ### Example Process Definition Snippet Source: https://github.com/permaweb/hyperbeam/blob/main/docs/devices/lua-at-5-3a.md Illustrates how to configure a process to use the Lua device within an execution stack. ```text # Example Process Definition Snippet Execution-Device: stack@1.0 Execution-Stack: scheduler@1.0, lua@5.3a Script: Sandbox: true ``` -------------------------------- ### Permaweb Path Resolution Example Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/ao-core-protocol.md Illustrates how paths are constructed and resolved in the Permaweb system, starting from an initial message and applying subsequent messages. ```APIDOC /StartingID/Input1ID/Input2ID/Input3ID => /{AO-Core.apply(StartingMsg, Input1)}/Input2ID/Input3ID => /OutputID1/Input2ID/Input3ID => ... /Output3ID ``` -------------------------------- ### Example Device for Stack Test Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Provides an example device configuration for stack testing. No specific parameters or return types are detailed. ```erlang example_device_for_stack_test() -> any() ``` -------------------------------- ### Fix Permission Issues Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md A command to resolve potential permission issues by changing the ownership of the current directory and its contents to the current user. ```bash sudo chown -R $(whoami) . ``` -------------------------------- ### start/1 Function Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/source-code/hb_http_server.md Starts the HTTP server with provided `Opts` for configuration. ```erlang start(Opts) -> any() ``` -------------------------------- ### Example Device for Stack Test Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/source-code/dev_stack.md Provides an example device configuration for stack testing. No specific parameters or return types are detailed. ```erlang example_device_for_stack_test() -> any() ``` -------------------------------- ### Initial State Sync Example (Lua) Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Shows how to sync initial process state (e.g., Balances, TotalSupply) using the patch device when a process loads. It includes a mechanism to prevent re-syncing. ```lua -- Initialize the sync flag if it doesn't exist InitialSync = InitialSync or 'INCOMPLETE' -- Sync state on spawn/load if not already done if InitialSync == 'INCOMPLETE' then -- Send the relevant state variables to the patch device Send({ device = 'patch@1.0', cache = { balances = Balances, totalsupply = TotalSupply } }) -- Update the flag to prevent re-syncing on subsequent executions InitialSync = 'COMPLETE' print("Initial state sync complete. Balances and TotalSupply patched.") end ``` -------------------------------- ### Update Local Fork with Upstream Changes Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Fetches the latest changes from the upstream repository and merges them into your local main branch to keep your fork up-to-date. ```bash git fetch upstream git checkout main git merge upstream/main ``` -------------------------------- ### Load Handler into AOS Source: https://github.com/permaweb/hyperbeam/blob/main/docs/build/get-started-building-on-ao-core.md Demonstrates the AOS command to load a local Lua file into the running AO process. This makes the defined handlers available for execution. ```aos [aos]> .load main.lua ``` -------------------------------- ### Setting Up a Personal Node Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/setting-up-selecting-devices.md Configures a node for personal use with 'friends and family' pricing and a specific allow-list. ```bash rebar3 shell --eval "hb:start_mainnet(#{ port => 9001, key_location => 'path/to/my/wallet.key', p4_pricing-device => '~faff@1.0', p4_ledger-device => '~faff@1.0', faff_allow_list => ['my-wallet-address'] })." ``` -------------------------------- ### Create a New Feature or Fix Branch Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Creates a new Git branch for developing a specific feature or fixing a bug, following a standard naming convention. ```bash git checkout -b feature/your-feature-name # or git checkout -b fix/bug-you-are-fixing ``` -------------------------------- ### Setting Up a Public Computation Node Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/setting-up-selecting-devices.md Configures a node to offer computation services with simple, flat-fee pricing. ```bash rebar3 shell --eval "hb:start_mainnet(#{ port => 9001, key_location => 'path/to/my/wallet.key', p4_pricing-device => '~simple-pay@1.0', p4_ledger-device => '~simple-pay@1.0', simple_pay_price => 0.01, preloaded_devices => ['~wasm64@1.0', '~process@1.0', 'dev_stack', 'dev_scheduler'] })." ``` -------------------------------- ### Inspect Reply Message Data Source: https://github.com/permaweb/hyperbeam/blob/main/docs/build/get-started-building-on-ao-core.md Retrieves and displays the 'Data' field from the most recent message in the AO process's inbox, which corresponds to the reply sent by the 'HelloWorld' handler. ```aos [aos]> Inbox[#Inbox].Data ``` -------------------------------- ### Add Upstream Remote for Synchronization Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/community/setup.md Adds the original HyperBEAM repository as an 'upstream' remote, enabling you to fetch updates and keep your local fork synchronized with the main project. ```bash git remote add upstream https://github.com/permaweb/HyperBEAM.git ``` -------------------------------- ### Timestamp Management Functions Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Handles caching and retrieval of timestamps from Arweave. It includes functions to start, get, cache, and refresh timestamps, managing a server process for this purpose. ```erlang cache(Current) -> any() -- Cache the current timestamp from Arweave. get() -> any() -- Get the current timestamp from the server, starting the server if it -- isn't already running. refresher(TSServer) -> any() -- Refresh the timestamp cache periodically. spawn_server() -> any() -- Spawn a new server and its refresher. start() -> any() -- Check if the server is already running, and if not, start it. ``` -------------------------------- ### HyperBEAM Complex Configuration via Command Line Source: https://github.com/permaweb/hyperbeam/blob/main/docs/misc/installation-core/hyperbeam-setup-config/configuration/configuration-methods.md Shows the recommended method for complex HyperBEAM configurations using the `hb:start_mainnet/1` function with a map of options. This approach supports full Erlang data types and complex structures, offering direct validation and runtime flexibility. ```erlang hb:start_mainnet( #{ port => 10001, http_extra_opts => #{ force_message => true, store => [{hb_store_fs, #{ prefix => "local-cache" }}, {hb_store_gateway, #{}}], cache_control => [<<"always">>] } } ). ``` -------------------------------- ### Check Compute Unit Status Source: https://github.com/permaweb/hyperbeam/blob/main/docs/resources/reference/troubleshooting.md Verifies if the Compute Unit is running by sending an HTTP GET request to its default port (6363). A successful response indicates the CU is active and listening. ```http curl http://localhost:6363 ``` -------------------------------- ### Example config.flat File Source: https://github.com/permaweb/hyperbeam/blob/main/docs/run/configuring-your-machine.md An example of a `config.flat` file for HyperBEAM node configuration. This file uses a simple `Key = Value.` format and supports basic data types. ```erlang % Set the HTTP port port = 8080. % Specify the Arweave key file priv_key_location = "/path/to/your/wallet.json". % Set the data store directory % Note: Storage configuration can be complex. See below. % store = [{local, [{root, <<"./node_data_mainnet">>}]}]. % Example of complex config, not for config.flat % Enable verbose logging for specific modules % debug_print = [hb_http, dev_router]. % Example of complex config, not for config.flat ``` -------------------------------- ### Trigger the Handler Source: https://github.com/permaweb/hyperbeam/blob/main/docs/build/get-started-building-on-ao-core.md Shows how to send a message to the current AO process to trigger the previously loaded 'HelloWorld' handler. The message specifies the target process ID (ao.id) and the action ('HelloWorld'). ```aos [aos]> Send({ Target = ao.id, Action = "HelloWorld" }) ``` -------------------------------- ### relay_with_payments_test Example Source: https://github.com/permaweb/hyperbeam/blob/main/docs/llms-full.txt Starts a node with a simple pay meta device to relay a message for a client. It verifies scenarios involving client balance, operator top-ups, and message signing. ```erlang relay_with_payments_test() -> any() ```