go-openaudio

module
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0

README

Open Audio Protocol

license Docs releases Dockerhub

A golang implementation of the Open Audio Protocol.

Quickstart

docker run --rm -it \
  -p 80:80 \
  -p 443:443 \
  -p 26656:26656 \
  -e OPENAUDIO_TLS_SELF_SIGNED=true \
  -e OPENAUDIO_STORAGE_ENABLED=false \
  openaudio/go-openaudio:stable

# in another terminal session
open https://localhost/console/overview

To run a validator and secure the network, visit docs.openaudio.org.

Local Development

Prerequisites

Ensure the following are installed:

  • Docker
  • Docker Compose
  • Go v1.25

The remaining dependencies can then be automatically installed with make:

make install-deps
Running local devnet

You can simulate an openaudio network by running multiple nodes on your machine. This makes developing certain features fast and easy.

Setup

Add the following hosts to your /etc/hosts file:

echo "127.0.0.1       node1.oap.devnet node2.oap.devnet node3.oap.devnet node4.oap.devnet" | sudo tee -a /etc/hosts

Then add the local dev x509 cert to your keychain so you will have green ssl in your browser.

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dev/tls/cert.pem
Run

Build and run a local devnet with 4 nodes.

make up

Access the dev nodes

# add -k if you don't have the cert in your keychain
curl https://node1.oap.devnet/health-check
curl https://node2.oap.devnet/health-check
curl https://node3.oap.devnet/health-check
curl https://node4.oap.devnet/health-check

# view in browser (quit and re-open if you added the cert and still get browser warnings)
open https://node1.oap.devnet/console
open https://node2.oap.devnet/console
open https://node3.oap.devnet/console
open https://node4.oap.devnet/console

Smoke test

# after 5-10s there should be 4 nodes registered
# this validates that the registry bridge is working,
# as only nodes 1 and 2 are defined in the genesis file as validators

$ curl -s https://node1.oap.devnet/core/nodes | jq .
{
  "data": [
    "https://node2.oap.devnet",
    "https://node1.oap.devnet",
    "https://node3.oap.devnet",
    "https://node4.oap.devnet"
  ]
}

# or in the UI
open https://node1.oap.devnet/console/nodes

# view uptime across the network
open https://node1.oap.devnet/console/uptime

Note: By default, hot reloading is only enabled on node1.oap.devnet to conserve system resources. To enable on other nodes, update the corresponding env file in dev/env.

Develop against stage or prod

Build a local docker image

make docker-dev

Peer with mainnet

docker run --rm -it -p 80:80 -p 443:443 -e NETWORK=prod openaudio/go-openaudio:dev
Run tests

Run all tests

make test

Run only storage service tests

make test-mediorum

Run only unittests

make test-unit

Run only integration tests

make test-integration
ETL

The ETL service indexes blockchain data into the postgres database, enabling faster queries for certain views.

OPENAUDIO_ETL_ENABLED=true
Explorer

The Explorer provides a web-based interface to browse blocks, transactions, validators, and other data. If enabled, the explorer runs at the site root, e.g. https://node1.oap.devnet/. Explorer requires ETL.

OPENAUDIO_ETL_ENABLED=true
OPENAUDIO_EXPLORER_ENABLED=true

# View explorer in browser
open https://node1.oap.devnet/

Directories

Path Synopsis
cmd
openaudio command
examples
block-stream command
indexer command
rewards command
upload command
pkg
common
anything related to accounts like signing, wallets, and serialization used by config, server, and sdk
anything related to accounts like signing, wallets, and serialization used by config, server, and sdk
console/templates
templ: version: v0.3.898
templ: version: v0.3.898
console/templates/layouts
templ: version: v0.3.898
templ: version: v0.3.898
console/templates/pages
templ: version: v0.3.898
templ: version: v0.3.898
core/console/templui/components/icon
templui component icon - version: v0.95.0 installed by templui v0.95.0
templui component icon - version: v0.95.0 installed by templui v0.95.0
core/console/templui/utils
templui util templui.go - version: v0.95.0 installed by templui v0.95.0
templui util templui.go - version: v0.95.0 installed by templui v0.95.0
core/console/views/components
templ: version: v0.3.898
templ: version: v0.3.898
core/console/views/layout
templ: version: v0.3.898
templ: version: v0.3.898
core/console/views/pages
templ: version: v0.3.898
templ: version: v0.3.898
core/server
simple type aliases that make readability, imports, and auto complete easier
simple type aliases that make readability, imports, and auto complete easier
eth
etl
mediorum/persistence
Package persistence handles taking content from the temp store and storing it in the persistence store.
Package persistence handles taking content from the temp store and storing it in the persistence store.
pos
These data structures allow core and mediorum to communicate for Proof of Storage challenges.
These data structures allow core and mediorum to communicate for Proof of Storage challenges.
pubsub
A generic pubsub system built with go channels.
A generic pubsub system built with go channels.
safemap
Package safemap provides a concurrency-safe generic map.
Package safemap provides a concurrency-safe generic map.
sdk

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL