Skip to content

Commit

Permalink
Merge pull request #244 from permaweb/twilson63/docs-aos-add-release-243
Browse files Browse the repository at this point in the history
feat: adding release notes to cookbook
  • Loading branch information
twilson63 authored Nov 12, 2024
2 parents 0491b37 + 01dd59c commit f7cf282
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/community/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Community Guides and Links

## Guides

- [0rbit](/guides/0rbit/index)
- [BetterIdea](/guides/betteridea/index)

## Links

- [Autonomous Finance](https://www.autonomous.finance/)

## Notes

> Not seeing an AO Community Member? Create an issue or submit a pull request to add your community member guide or link. https://github.com/permaweb/ao-cookbook
5 changes: 5 additions & 0 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ features:
details: Learn how the ao network works under the hood.
link: /concepts/index
---

## More Information

- [Community Guides and Links](/community/index)
- [Release Notes](/releasenotes/index)
168 changes: 168 additions & 0 deletions src/releasenotes/aos-2_0_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# AOS Release Notes v2.0.1

## Install

```sh
npm install -g https://get_ao.arweave.net
```

## Features

- Bootloader
- Handlers.once (defaults to prepend mode)
- WeaveDrive with Attestors
- WeaveDrive L2 Headers
- Spawn module by name
- Graphql Modules
- msg.reply patch

### Bootloader

Bootloader enables users to include a script to evaluate when spawning a process. You can include this script either with the `Data` property or with a `txId` specified on the `On-Boot` Tag.

#### Examples

via AOS Console using `data`

```shell
echo "print('Hello Bootloader')" > example.lua
aos ex1 --tag-name On-Boot --tag-value Data --data example.lua
```

> As AOS boots up, you should see Hello Bootloader!
```
AOS Client Version: 2.0.1. 2024
Type "Ctrl-C" twice to exit
Your AOS process: uJvxYDk6Q1JvocgfajNbEcKmqoCDWEksjG6EH1o9xRo
Hello Bootloader
```

via Spawn message using `data`

```lua
Spawn(ao.env.Module.Id, {
["On-Boot"] = "Data",
Data = [[ print("Hello World!") ]]
})
```

via AOS Console using `txId`

```shell
aos ex2 --tag-name On-Boot --tag-value 1VAPs_V6iVx-zxuMW7Ns0IrYqqk6LAEDAe1b-EqKP28
```

via Spawn message using `txId`

```lua
Spawn(ao.env.Module.Id, {
["On-Boot"] = "1VAPs_V6iVx-zxuMW7Ns0IrYqqk6LAEDAe1b-EqKP28"
})
```

### Hanlders.once (defaults to prepend mode)

Now, when Handlers.once is called, it will default to prepend to the top of the Handlers stack.

```lua
Handlers.once("Name", function (msg)
-- do something
end)

-- is the same as

Handlers.prepend("Name", "Name", function (msg)
-- do something
end, 1)

```

### WeaveDrive with Attestors

Using WeaveDrive to access dataitems from Arweave with Attestations. When you spawn a process you can provide one or more `Attestor` tags with arweave wallet addresses as value. Then the arweave wallets set as attestors can create `Attestation` dataItems that authorize access to a specific arweave dataitem using weavedrive.

Here is a short guide on how to use WeaveDrive with Attestors - https://hackmd.io/@ao-docs/r1bixxO-Je

### WeaveDrive L2 Headers

Now, weaveDrive users can get L2 dataItem headers using `drive.getDataItem(id)` from the WeaveDrive apm module. This features allows indexers to index L2 dataItems and processes like stamps2 to determine if a user is stamping an Atomic Asset. The result is more interoperability with Arweave.

```lua
.load-blueprint apm
apm.install('@rakis/WeaveDrive')
local drive = require('@rakis/WeaveDrive')
local metaData = drive.getDataItem('K1jD3xrCJV3UnRtnBuQdd7k8HCwh9TX9GS-kh_Oevvw')
```

### Spawn module by name

Spawn module by name or identifier:

```sh
aos gql --module aos-graphql-sqlite-sm
```

Create a graphql/sqlite process by using the module name.

### Graphql Modules

You can now bulid graphql processes using the graphql custom module:

https://github.com/TillaTheHun0/aos-graphq

### msg reply legacy patch

This release provides a blueprint optional patch to allow for old processes to leverage the `msg.reply` function.

`.load-blueprint patch-legacy-reply`

A blueprint that creates a passthrough handler to attach `.reply` function to the `msg` table, for handlers downstream to leverage.

This allows developers to take advantage of the `.receive` function in AOS 2.0 and interact with older AOS 0.x processes. With this patch AOS 0.x processes need to be able to reply with an `X-Reference` tag. So that the `.receive` co-routine can properly catch the response sent by the calling AOS 2.0 process.

Then open an older process:

```sh
aos [my aos process]
```

And run `.load-blueprint patch-legacy-reply`

```
.load-blueprint patch-legacy-reply
```

## Source

You can review the blueprint source here:

https://github.com/permaweb/aos/blob/main/blueprints/patch-legacy-reply.lua

```lua
local function patchReply(msg)
if not msg.reply then
msg.reply = function (replyMsg)
replyMsg.Target = msg["Reply-To"] or (replyMsg.Target or msg.From)
replyMsg["X-Reference"] = msg["X-Reference"] or msg.Reference or ""
replyMsg["X-Origin"] = msg["X-Origin"] or ""

return ao.send(replyMsg)
end
end
end

Handlers.prepend("_patch_reply", function (msg) return "continue" end, patchReply)

```

---

Fixes:

- bubble up errors during co-routine resume functions - https://github.com/permaweb/aos/pull/374
- update token.lua to check for .reply before using the replay method
- staking blueprint improvement to default unstake delay block wait, and prepend finalize handler.
- fixed bug with Handlers.remove - https://github.com/permaweb/aos/pull/366
168 changes: 168 additions & 0 deletions src/releasenotes/aos-2_0_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# AOS Release Notes v2.0.1

## Install

```sh
npm install -g https://get_ao.arweave.net
```

## Features

- Bootloader
- Handlers.once (defaults to prepend mode)
- WeaveDrive with Attestors
- WeaveDrive L2 Headers
- Spawn module by name
- Graphql Modules
- msg.reply patch

### Bootloader

Bootloader enables users to include a script to evaluate when spawning a process. You can include this script either with the `Data` property or with a `txId` specified on the `On-Boot` Tag.

#### Examples

via AOS Console using `data`

```shell
echo "print('Hello Bootloader')" > example.lua
aos ex1 --tag-name On-Boot --tag-value Data --data example.lua
```

> As AOS boots up, you should see Hello Bootloader!
```
AOS Client Version: 2.0.1. 2024
Type "Ctrl-C" twice to exit
Your AOS process: uJvxYDk6Q1JvocgfajNbEcKmqoCDWEksjG6EH1o9xRo
Hello Bootloader
```

via Spawn message using `data`

```lua
Spawn(ao.env.Module.Id, {
["On-Boot"] = "Data",
Data = [[ print("Hello World!") ]]
})
```

via AOS Console using `txId`

```shell
aos ex2 --tag-name On-Boot --tag-value 1VAPs_V6iVx-zxuMW7Ns0IrYqqk6LAEDAe1b-EqKP28
```

via Spawn message using `txId`

```lua
Spawn(ao.env.Module.Id, {
["On-Boot"] = "1VAPs_V6iVx-zxuMW7Ns0IrYqqk6LAEDAe1b-EqKP28"
})
```

### Hanlders.once (defaults to prepend mode)

Now, when Handlers.once is called, it will default to prepend to the top of the Handlers stack.

```lua
Handlers.once("Name", function (msg)
-- do something
end)

-- is the same as

Handlers.prepend("Name", "Name", function (msg)
-- do something
end, 1)

```

### WeaveDrive with Attestors

Using WeaveDrive to access dataitems from Arweave with Attestations. When you spawn a process you can provide one or more `Attestor` tags with arweave wallet addresses as value. Then the arweave wallets set as attestors can create `Attestation` dataItems that authorize access to a specific arweave dataitem using weavedrive.

Here is a short guide on how to use WeaveDrive with Attestors - https://hackmd.io/@ao-docs/r1bixxO-Je

### WeaveDrive L2 Headers

Now, weaveDrive users can get L2 dataItem headers using `drive.getDataItem(id)` from the WeaveDrive apm module. This features allows indexers to index L2 dataItems and processes like stamps2 to determine if a user is stamping an Atomic Asset. The result is more interoperability with Arweave.

```lua
.load-blueprint apm
apm.install('@rakis/WeaveDrive')
local drive = require('@rakis/WeaveDrive')
local metaData = drive.getDataItem('K1jD3xrCJV3UnRtnBuQdd7k8HCwh9TX9GS-kh_Oevvw')
```

### Spawn module by name

Spawn module by name or identifier:

```sh
aos gql --module aos-graphql-sqlite-sm
```

Create a graphql/sqlite process by using the module name.

### Graphql Modules

You can now bulid graphql processes using the graphql custom module:

https://github.com/TillaTheHun0/aos-graphq

### msg reply legacy patch

This release provides a blueprint optional patch to allow for old processes to leverage the `msg.reply` function.

`.load-blueprint patch-legacy-reply`

A blueprint that creates a passthrough handler to attach `.reply` function to the `msg` table, for handlers downstream to leverage.

This allows developers to take advantage of the `.receive` function in AOS 2.0 and interact with older AOS 0.x processes. With this patch AOS 0.x processes need to be able to reply with an `X-Reference` tag. So that the `.receive` co-routine can properly catch the response sent by the calling AOS 2.0 process.

Then open an older process:

```sh
aos [my aos process]
```

And run `.load-blueprint patch-legacy-reply`

```
.load-blueprint patch-legacy-reply
```

## Source

You can review the blueprint source here:

https://github.com/permaweb/aos/blob/main/blueprints/patch-legacy-reply.lua

```lua
local function patchReply(msg)
if not msg.reply then
msg.reply = function (replyMsg)
replyMsg.Target = msg["Reply-To"] or (replyMsg.Target or msg.From)
replyMsg["X-Reference"] = msg["X-Reference"] or msg.Reference or ""
replyMsg["X-Origin"] = msg["X-Origin"] or ""

return ao.send(replyMsg)
end
end
end

Handlers.prepend("_patch_reply", function (msg) return "continue" end, patchReply)

```

---

Fixes:

- bubble up errors during co-routine resume functions - https://github.com/permaweb/aos/pull/374
- update token.lua to check for .reply before using the replay method
- staking blueprint improvement to default unstake delay block wait, and prepend finalize handler.
- fixed bug with Handlers.remove - https://github.com/permaweb/aos/pull/366
10 changes: 10 additions & 0 deletions src/releasenotes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
next:
text: "Getting Started"
link: "./getting-started"
---

# Release Notes

- [AOS 2.0.1](aos-2_0_1)
- [AOS 2.0.0](aos-2_0_0)

0 comments on commit f7cf282

Please sign in to comment.