Run a complete AO Computer testbed, locally, with Docker Compose.
The repo may helpful if you are doing one or more of the following:
- Contributing to @permaweb/ao.
- Compiling
ao
modules using theao
dev-cli.- And you want to avoid publishing each revision onto Arweave mainnet.
- You are developing an
ao
component (e.g. acu
,mu
, orsu
).- And you want to swap that into a working environment.
- You are developing Lua code that will be loaded into
aos
processes.- And you want to avoid bricking your
aos
processes onao
testnet.
- And you want to avoid bricking your
Warning
Later steps may not be fully functional
- Clone this repo and
cd
into the root. - Setup the Arweave wallets that the
ao
components will use to talk to each other:- Execute
wallets/generateAll.sh
to create new wallets for everything.- See wallets/README.md for more advanced configuration.
- Execute
- Use Docker Compose to boot up the
ao
localnet containers:- 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.)
- Run
- You will have many services now bound to ports in the 4000 range (all subject to change):
- http://localhost:4000/ - ArLocal (Arweave gateway)
- http://localhost:4001/ - ArDrive Web
- http://localhost:4002/ - An
ao
mu
- http://localhost:4003/ - An
ao
su
- http://localhost:4004/ - An
ao
cu
- http://localhost:4005/ - Turbo (Arweave uploader/bundlr)
- http://localhost:4006/ - ScAR (Arweave block explorer)
- Next, you will likely want to seed data into Arweave. Some options here:
cd
into theservices/arlocal/scripts
helper scripts directory.- Run
npm install
to install dependencies. - 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.)
- (This is logically separate from the wallets that the
- Run
./mint.mjs [winston]
to give AR to your user wallet.- (If omitted, the default is 1 billion winston, i.e. 1 AR).
- Run
./create-drive.mjs
to use theardrive-core-js
lib to create a new ArDrive drive and root folder. - Run
./mine.mjs
to mine the ArDrive transactions from the previosu step into a new block.
- Try to boot
aos
:- (There will soon be an script in this directory with which to invoke
aos
.)
- (There will soon be an script in this directory with which to invoke
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:
- ✅ Arweave block explorer (web interface)
- ✅ ScAR - A lightweight option from here, forked here with improvements.
- ⬜ ArweaveWebWallet - Another option from here which powers https://arweave.app/.
⚠️ 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.
- This can be mitigated by adding
- ℹ️ Two minor issues remaining:
⚠️ Fully functionalao
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 launchingaos
processes on theao
localnet- ℹ️ Some of this code is not committed yet, but I currently have an error in the
mu
when launchingaos
-@MichaelBuhler
- ℹ️ Some of this code is not committed yet, but I currently have an error in the
- ⬜ nginx reverse proxy, for hostname routing
- ⬜ DNS routing
- ℹ️ A containers should be reachable via
*.ao-localnet.xyz
domain names.
- ℹ️ A containers should be reachable via