Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a8c69d4
feat: enable aos mainnet m3 upgrade to .82 aoconnect
twilson63 May 8, 2025
a91141e
chore: updated to 83
May 8, 2025
aaa2d73
fix: meta/info/address
May 8, 2025
08e72a7
fix got spawn working for aos console
May 9, 2025
ae9cf6d
fix: spawn schema to remove signing format
twilson63 May 9, 2025
9a35e0d
fix: updated aoconnect to 84
twilson63 May 10, 2025
16e5f18
chore: refactored evaluate, mainnet, and register
twilson63 May 10, 2025
7e01631
feat: adding hyper-aos
twilson63 May 10, 2025
71ea3f1
fix: removed console.log
twilson63 May 10, 2025
76925d0
feat: added hyper-aos to repo with identifier for a hyper-aos process…
May 10, 2025
e2f4417
update ao lua with hints
May 11, 2025
53748c4
chg: s/script/module
May 11, 2025
3388bbf
chore: refactor script for module
twilson63 May 11, 2025
0102b47
wip: updated mainnet to contain target in message
twilson63 May 18, 2025
be8b5c5
feat: implement process.normalize function to standardize tag names a…
dpshade May 21, 2025
30388f3
feat(aos): add ability to add authorities via cli flag
jfrain99 May 22, 2025
20f7143
Merge pull request #448 from permaweb/jfrain99/authority-cli-flag
twilson63 May 22, 2025
b6ee8e5
feat: enhance process.normalize to include string normalization for keys
dpshade May 22, 2025
2130cfd
feat: update process.normalize to normalize strings to title case and…
dpshade May 22, 2025
aa4396a
feat: normalizeMsg helper rather than process.normalize
dpshade May 23, 2025
6b8ec10
feat(aos): fix checklive mainnet
jfrain99 May 23, 2025
7759e70
feat: update aos module identifier and clean up normalize message tes…
dpshade May 23, 2025
6bc9fed
fix(aos): authorities on spawn
jfrain99 May 23, 2025
3fcc603
chore(hyperAOS): add test setup for hyper-aos using lua busted
twilson63 May 24, 2025
3ef2bfd
chore: remove unused test files
twilson63 May 24, 2025
7a8c662
Merge pull request #453 from permaweb/rakis/spec
twilson63 May 24, 2025
f56ffec
chore: add helpers to hyper makefile
twilson63 May 24, 2025
6414e64
Merge pull request #450 from permaweb/feat/mainnet-live
twilson63 May 24, 2025
f6a09fb
Merge pull request #451 from permaweb/dpshade/normalize-incoming-mess…
twilson63 May 24, 2025
393c53e
added spec for stringify
twilson63 May 24, 2025
0ab65c7
chore: verifed impr and fixed .pause
twilson63 May 24, 2025
9fb63f0
feat: unified utils normalization function for pattern matching
dpshade May 27, 2025
ed773ec
Merge pull request #452 from permaweb/jfrain99/authority-fix
jfrain99 May 27, 2025
1aece07
feat: enhance utils.normalize to convert underscores to dashes and up…
dpshade May 27, 2025
88229cb
feat: move logic to matchesPattern as opposed to matchesSpec
dpshade May 27, 2025
3b5920b
implement gmatch v1
viksit May 27, 2025
74ac7a2
clean up comments
viksit May 28, 2025
19b66d7
chore: remove unused test files and binary assets
dpshade May 28, 2025
a91ac62
Merge pull request #455 from permaweb/viksit/m3/gmatch
twilson63 May 29, 2025
755d87f
chore(hyper): add specs to cover main, ao, and more
May 29, 2025
4a0bced
add json spec
May 29, 2025
0510dfd
Merge pull request #456 from permaweb/dpshade/case-insensitive-matche…
dpshade May 30, 2025
4af8dd3
Merge pull request #457 from permaweb/rakis/hyper/specs
twilson63 Jun 4, 2025
6cef5cf
fix: add correct tags for spawning and messages
NickJ202 Jun 6, 2025
8384a49
Merge pull request #459 from permaweb/fix/feat-m3
twilson63 Jun 6, 2025
4b6b895
fix(aos): fix live, error messages;
jfrain99 Jun 6, 2025
70b9f44
Merge pull request #460 from permaweb/fix/feat-m3
twilson63 Jun 6, 2025
c7148f6
fix(aos): set lua to experimental
jfrain99 Jun 6, 2025
7cc3536
Merge pull request #461 from permaweb/jfrain99/lua-experimental
jfrain99 Jun 6, 2025
5f7ad2f
fix(aos): fix cursor when going from legacy to hb
jfrain99 Jun 6, 2025
43b52b5
Merge pull request #462 from permaweb/jfrain99/live-legacy-to-hb-cursor
jfrain99 Jun 6, 2025
e602cc5
impr: fix authorities replying and warning message
twilson63 Jun 7, 2025
f263cbe
fix(aos): swallow first hb error
jfrain99 Jun 7, 2025
50c2c18
Merge pull request #464 from permaweb/jfrain99/swallow-first-hb-error
twilson63 Jun 7, 2025
395aa74
fix: added signingFormat and accept-bundle to the live update requests
twilson63 Jun 9, 2025
513d3dd
Merge branch 'feat/m3' of github.com:permaweb/aos into feat/m3
twilson63 Jun 9, 2025
79b1309
Merge pull request #467 from permaweb/fix/m3/live-feed-mainnet
twilson63 Jun 9, 2025
09c06f6
fix: include src files for .update
Jun 10, 2025
b63384d
fix: live results to support hyper-aos
Jun 12, 2025
d5cf6ca
feat: add topup for individual compute nodes
NickJ202 Jun 16, 2025
e6119fa
fix: close readline instance after topup
NickJ202 Jun 17, 2025
6503a6f
Merge pull request #469 from permaweb/NickJ202/feat-compute-topup
twilson63 Jun 17, 2025
d814c5f
fix: update pkg json with aos sqlite module
twilson63 Jul 17, 2025
d54fafc
Update mainnet.js
twilson63 Jul 25, 2025
e292ade
feat: added ability for user to choose between aos and hyper-aos when…
Aug 10, 2025
96f5843
feat: setup hyper mode for messages
Aug 10, 2025
783b639
feat: handle defaults for spawning hyper aos process
Aug 10, 2025
5dc0834
chore: remove debug log
Aug 10, 2025
77971a5
chore: change copy of aos type prompt
Aug 10, 2025
463228f
chore: add new hyper-aos
Aug 10, 2025
9c06744
chore: update aos to not display version update if dev
Aug 10, 2025
75d21f4
fix: live updates for hyper mode
Aug 10, 2025
92fe36e
feat: add htoken for hyper-aos
Aug 11, 2025
2477077
feat: created svg for htoken
Aug 11, 2025
867a44c
chore: remove debugging statement
Aug 11, 2025
44d09ab
fix: data argument should be working
Aug 11, 2025
8e2b8d5
fix: hyper only send data when set
Aug 11, 2025
0014dda
Merge branch 'main' into feat/m3
twilson63 Aug 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ aos.json
.prettierignore

.vscode
.DS_Store
.DS_Store
bun.lock
10 changes: 8 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ node_modules
wallet.json
backup
echo
potato
hyper
modules
logos
extensions
process/test
process/crypto
.gitpod
.husky
.github
aos.json
*.tgz
*.tgz
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ aos [name/process-id]
| `--cron [Interval]` | The cron flag can only be used when spawning a process, it instructs the Process to generate messages every `Interval`. An Interval can be defined with a [n]-(period) for example: 1-minute, 10-minutes, 5-hours, 10-blocks, etc. | 0-1 |
| `--get-blueprints [dir]` | This command will grab blueprints from the `/blueprints` folder or a folder specified by the user. These blueprints are small lua files that can be applied to your process to automatically give it some functionality. | 0-1 |
| `--tag-name [name]` and `--tag-value [value]` | These flags are also only when aos is spawning a Process. You may add many of these combinations as you would like and they will appear on the Process tags object | 0-n |
| `--authority [authority]` | The authority flag will allow you to set your authority when spawning a Process. Can be a single address or a comma-separated list. | 0-1 |
| `--load [luaFile]` | The load command allows you to load lua source files from your local directory. | 0-n |
| `--gateway-url [url]` | The gateway-url flag allows you to specify a custom Gateway to connect to. | 0-1 |
| `--cu-url [url]` | The cu-url flag allows you to specify a custom Computer Unit to connect to. | 0-1 |
Expand Down
229 changes: 229 additions & 0 deletions blueprints/htoken.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
local bint = require('.bint')(256)
--[[
This module implements the ao Standard Token Specification.

Terms:
Sender: the wallet or Process that sent the Message

It will first initialize the internal state, and then attach handlers,
according to the ao Standard Token Spec API:

- Info(): return the token parameters, like Name, Ticker, Logo, and Denomination

- Balance(Target?: string): return the token balance of the Target. If Target is not provided, the Sender
is assumed to be the Target

- Balances(): return the token balance of all participants

- Transfer(Target: string, Quantity: number): if the Sender has a sufficient balance, send the specified Quantity
to the Target. It will also issue a Credit-Notice to the Target and a Debit-Notice to the Sender

- Mint(Quantity: number): if the Sender matches the Process Owner, then mint the desired Quantity of tokens, adding
them the Processes' balance
]]
--
local json = require('json')

--[[
utils helper functions to remove the bint complexity.
]]
--


local utils = {
add = function(a, b)
return tostring(bint(a) + bint(b))
end,
subtract = function(a, b)
return tostring(bint(a) - bint(b))
end,
toBalanceValue = function(a)
return tostring(bint(a))
end,
toNumber = function(a)
return bint.tonumber(a)
end
}


--[[
Initialize State

ao.id is equal to the Process.Id
]]
--
Variant = "0.0.4"

-- token should be idempotent and not change previous state updates
Denomination = Denomination or 12
Balances = Balances or { [id] = utils.toBalanceValue(10000 * 10 ^ Denomination) }
TotalSupply = TotalSupply or utils.toBalanceValue(10000 * 10 ^ Denomination)
Name = Name or 'Hyper Test Coin'
Ticker = Ticker or 'HYPER'
Logo = Logo or 'eskTHZQzCLOFrpzkr7zeaf4RxmkaNVYvHuPLh4CLpX4'

--[[
Add handlers for each incoming Action defined by the ao Standard Token Specification
]]
--

--[[
Info
]]
--
Handlers.add('info', function(msg)
send({
Target = msg.from,
Name = Name,
Ticker = Ticker,
Logo = Logo,
Denomination = tostring(Denomination)
})
end)

--[[
Balance
]]
--
Handlers.add('balance', { action = "balance"}, function(msg)
local bal = '0'
print('balance called')
print('from ' .. msg.from)

-- If not Recipient is provided, then return the Senders balance
if (msg.recipient) then
if (Balances[msg.recipient]) then
bal = Balances[msg.recipient]
end
elseif msg.target and Balances[msg.target] then
bal = Balances[msg.target]
elseif Balances[msg.from] then
bal = Balances[msg.from]
end
send({
target = msg.from,
balance = bal,
ticker = Ticker,
account = msg.recipient or msg.from,
data = bal
})
end)

--[[
Balances
]]
--
Handlers.add('balances',
function(msg)
send({target = msg.from, data = json.encode(Balances) })
end)

--[[
Transfer
]]
--
Handlers.add('transfer', function(msg)
assert(type(msg.recipient) == 'string', 'Recipient is required!')
assert(type(msg.quantity) == 'string', 'Quantity is required!')
assert(bint.__lt(0, bint(msg.quantity)), 'Quantity must be greater than 0')

if not Balances[msg.from] then Balances[msg.from] = "0" end
if not Balances[msg.recipient] then Balances[msg.recipient] = "0" end

if bint(msg.quantity) <= bint(Balances[msg.from]) then
Balances[msg.from] = utils.subtract(Balances[msg.from], msg.quantity)
Balances[msg.recipient] = utils.add(Balances[msg.recipient], msg.quantity)

--[[
Only send the notifications to the Sender and Recipient
if the Cast tag is not set on the Transfer message
]]
--
if not msg.cast then
-- Debit-Notice message template, that is sent to the Sender of the transfer
local debitNotice = {
action = 'Debit-Notice',
recipient = msg.recipient,
quantity = msg.quantity,
data = colors.gray ..
"You transferred " ..
colors.blue .. msg.quantity .. colors.gray .. " to " .. colors.green .. msg.recipient .. colors.reset
}
-- Credit-Notice message template, that is sent to the Recipient of the transfer
local creditNotice = {
target = msg.recipient,
action = 'Credit-Notice',
sender = msg.from,
quantity = msg.quantity,
data = colors.gray ..
"You received " ..
colors.blue .. msg.quantity .. colors.gray .. " from " .. colors.green .. msg.from .. colors.reset
}

-- Add forwarded tags to the credit and debit notice messages
for tagName, tagValue in pairs(msg) do
-- Tags beginning with "X-" are forwarded
if string.sub(tagName, 1, 2) == "x-" then
debitNotice[tagName] = tagValue
creditNotice[tagName] = tagValue
end
end

-- Send Debit-Notice and Credit-Notice
debitNotice.Target = msg.from
send(debitNotice)
send(creditNotice)
end
else
send({
target = msg.from,
action = 'Transfer-Error',
['Message-Id'] = msg.id,
error = 'Insufficient Balance!'
})
end
end)

--[[
Mint
]]
--
Handlers.add('mint', function(msg)
assert(type(msg.quantity) == 'string', 'Quantity is required!')
assert(bint(0) < bint(msg.quantity), 'Quantity must be greater than zero!')

if not Balances[id] then Balances[id] = "0" end

if msg.from == id then
-- Add tokens to the token pool, according to Quantity
Balances[msg.from] = utils.add(Balances[msg.from], msg.quantity)
TotalSupply = utils.add(TotalSupply, msg.quantity)
send({
target = msg.from,
data = colors.gray .. "Successfully minted " .. colors.blue .. msg.quantity .. colors.reset
})
else
send({
target = msg.from,
action = 'Mint-Error',
['Message-Id'] = msg.id,
error = 'Only the Process Id can mint new ' .. Ticker .. ' tokens!'
})
end
end)

--[[
Total Supply
]]
--
Handlers.add('totalSupply', function(msg)
assert(msg.From ~= id, 'Cannot call Total-Supply from the same process!')
send({
Target = msg.From,
Action = 'Total-Supply',
Data = TotalSupply,
Ticker = Ticker
})
end)


9 changes: 9 additions & 0 deletions hyper/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test:
eval $(luarocks path)
busted

download:
wget https://www.lua.org/ftp/lua-5.3.6.tar.gz
tar -xzf lua-5.3.6.tar.gz
wget https://luarocks.org/releases/luarocks-3.9.2.tar.gz
tar -xzf luarocks-3.9.2.tar.gz
77 changes: 77 additions & 0 deletions hyper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# hyper AOS

hyper AOS is a hyperBEAM based implementation of AOS, focused to deliver lighting fast performance to the AO network.


## Developer Setup


* Install lua

```sh
wget https://www.lua.org/ftp/lua-5.3.6.tar.gz
tar -xzf lua-5.3.6.tar.gz
cd lua-5.3.6
```

For linux

```sh
make linux
```

For mac

```sh
make macosx
```

```sh
sudo make install
```

* Install luarocks

```sh
wget https://luarocks.org/releases/luarocks-3.9.2.tar.gz
tar -xzf luarocks-3.9.2.tar.gz
cd luarocks-3.9.2
```

```sh
./configure --lua-version=5.3 --with-lua=/usr/local
make
sudo make install
```

* Init lua env

```sh
luarocks init
```

* Install busted testing library

```sh
luarocks install busted
```

* Setup lua env

```sh
eval $(luarocks path)
```

## Tests

* Running Tests

```sh
busted
```

* Writing Tests

Add your test in the `spec` folder and name the test ending with `_spec.lua`


Loading
Loading