Skip to content

Run a complete AO Computer testbed, locally, with Docker Compose.

Notifications You must be signed in to change notification settings

weavedb/ao-localnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ao-localnet

Run a complete AO Computer testbed, locally, with Docker Compose.

Purpose

The repo may helpful if you are doing one or more of the following:

  1. Contributing to @permaweb/ao.
  2. Compiling ao modules using the ao dev-cli.
    • And you want to avoid publishing each revision onto Arweave mainnet.
  3. You are developing an ao component (e.g. a cu, mu, or su).
    • And you want to swap that into a working environment.
  4. You are developing Lua code that will be loaded into aos processes.
    • And you want to avoid bricking your aos processes on ao testnet.

How to Run a Localnet

Warning

Later steps may not be fully functional

  1. Clone this repo and cd into the root.
  2. Setup the Arweave wallets that the ao components will use to talk to each other:
    1. Execute wallets/generateAll.sh to create new wallets for everything.
  3. Use Docker Compose to boot up the ao localnet containers:
    1. Run docker compose up --detach
      • (You will need to have the Docker daemon running.)
      • (This could take a while the first time you run it.)
  4. You will have many services now bound to ports in the 4000 range (all subject to change):
  5. Next, you will likely want to seed data into Arweave. Some options here:
    1. cd into the services/arlocal/scripts helper scripts directory.
    2. Run npm install to install dependencies.
    3. Run ./generate-wallet.mjs to generate a user wallet in the currently directory.
      • (This is logically separate from the wallets that the ao components use.)
    4. Run ./mint.mjs [winston] to give AR to your user wallet.
      • (If omitted, the default is 1 billion winston, i.e. 1 AR).
    5. Run ./create-drive.mjs to use the ardrive-core-js lib to create a new ArDrive drive and root folder.
    6. Run ./mine.mjs to mine the ArDrive transactions from the previosu step into a new block.
  6. Try to boot aos:
    • (There will soon be an script in this directory with which to invoke aos.)

Development Status of this Repo

Note

Approximately 80-90% operational, as the ao components are running, but not playing nicely with each other yet.

  • ✅ ArLocal instance mocking Arweave and acting as Arweave gateway
    • ℹ️ There are some features missing from the upstream that tend to be used by block explorers, so we are using this fork, which fixes:
      • ✅ Getting pending transactions via GET /tx/pending route
      • ⬜ Blocks don't include block_size (#1)
      • ⬜ Blocks don't include reward_addr (#3)
      • ⬜ Blocks don't include weave_size (#2)
  • ✅ Arweave block explorer (web interface)
  • ⚠️ Fully functional ArDrive Web (web interface)
    • ℹ️ Two minor issues remaining:
      • ⏳ Waiting on this issue, which causes ArDrive Web to makes calls the Arweave gateway on the wrong port.
      • ⚠️ ArDrive Web is using so-called "sandboxed urls" where it contacts the gateway on a subdomain that is the base32 encoded transaction id of the Arweave transaction.
        • This can be mitigated by adding 127.0.0.1 *.localhost to your /etc/hosts file.
  • ⚠️ Fully functional ao computer, using the reference implementations.
    • cu
      • ✅ Builds and boots.
    • mu
      • ✅ Builds and boots.
      • ❌ Returns a 500 error when launching aos process. Error: ao-mu:POST_root Failed to send the DataItem TypeError: f is not a function
    • su
      • ✅ Builds and boots.
  • ⚠️ Successfully launching aos processes on the ao localnet
    • ℹ️ Some of this code is not committed yet, but I currently have an error in the mu when launching aos -@MichaelBuhler
  • ⬜ nginx reverse proxy, for hostname routing
  • ⬜ DNS routing
    • ℹ️ A containers should be reachable via *.ao-localnet.xyz domain names.

About

Run a complete AO Computer testbed, locally, with Docker Compose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 52.2%
  • Shell 24.8%
  • Dockerfile 23.0%