Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(readme): update readme with new APIs #31

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
99 changes: 61 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@ This repository contains the source code used for Arweave Name Tokens used to re

This repository provides two flavours of ANT process module, AOS and a custom module.

<!-- toc -->

- [Setup](#setup)
- [Install](#install)
- [Testing](#testing)
- [Building the AOS code](#building-the-aos-code)
- [Build](#build)
- [Publish](#publish)
- [Load](#load)
- [Spawn](#spawn)
- [Handler Methods](#handler-methods)
- [Read Methods](#read-methods)
- [`Info`](#info)
- [`Get-Records`](#get-records)
- [`Get-Record`](#get-record)
- [`Get-Controllers`](#get-controllers)
- [`Balance`](#balance)
- [`Balances`](#balances)
- [Write methods](#write-methods)
- [`Transfer`](#transfer)
- [`Set-Record`](#set-record)
- [`Set-Name`](#set-name)
- [`Set-Ticker`](#set-ticker)
- [`Set-Description`](#set-description)
- [`Set-Keywords`](#set-keywords)
- [`Set-Controller`](#set-controller)
- [`Remove-Controller`](#remove-controller)
- [`Remove-Record`](#remove-record)
- [`Release-Name`](#release-name)
- [`Reassign-Name`](#reassign-name)
- [Developers](#developers)
- [Requirements](#requirements)
- [Lua Setup (MacOS)](#lua-setup-macos)
- [LuaRocks Setup](#luarocks-setup)
- [aos](#aos)
- [Code Formatting](#code-formatting)
- [Testing](#testing-1)
- [Dependencies](#dependencies)

<!-- tocstop -->

## Setup

### Install
Expand Down Expand Up @@ -67,44 +108,6 @@ yarn aos:spawn

This will deploy the bundled lua file to arweave as an L1 transaction, so your wallet will need AR to pay the gas.

### Building the custom module

Using the ao-dev-cli.

#### Build

This will compile the standalone ANT module to wasm, as a file named `process.wasm` and loads the module in [AO Loader](https://github.com/permaweb/ao/tree/main/loader) to validate the WASM program is valid.

```bash
yarn module:build
```

#### Publish

Publishes the custom ANT module to arweave - requires you placed your JWK in the `tools` directory. May require AR in the wallet to pay gas.

```sh
yarn module:publish
```

#### Load

Loads the module in [AO Loader](https://github.com/permaweb/ao/tree/main/loader) to validate the WASM program is valid.

```bash
yarn module:load
```

Requires `module:build` to have been called so that `process.wasm` exists.

#### Spawn

Spawns a process with the `process.wasm` file.

```bash
yarn module:spawn
```

## Handler Methods

For interacting with handlers please refer to the [AO Cookbook]
Expand Down Expand Up @@ -246,6 +249,26 @@ Removes a record from the ANT.
| Action | string | "Remove-Record" | true | Action tag for triggering handler |
| Sub-Domain | string | "^(?:[a-zA-Z0-9_-]+\|@)$" | true | Subdomain of the record to remove. |

#### `Release-Name`

Calls the IO Network process to release the given ArNS name if that name is associated with the ANT.

| Tag Name | Type | Pattern | Required | Description |
| -------- | ------ | ------------------- | -------- | --------------------------------- |
| Action | string | "Release-Name" | true | Action tag for triggering handler |
| Name | string | "^([a-zA-Z0-9_-])$" | true | ArNS name to release |

#### `Reassign-Name`

Calls the IO Network process to reassign the given ArNS name to a new ANT ID if that name is associated with the ANT.

| Tag Name | Type | Pattern | Required | Description |
| ------------- | ------ | --------------------- | -------- | ---------------------------------------------------- |
| Action | string | "Reassign-Name" | true | Action tag for triggering handler |
| IO-Process-Id | string | "^[a-zA-Z0-9_-]{43}$" | true | ID of the IO Network Process to reassign the name on |
| Process-Id | string | "^[a-zA-Z0-9_-]{43}$" | true | ID of the new ANT to assign to the ArNS name |
| Name | string | "^([a-zA-Z0-9_-])$" | true | Subdomain of the record to remove. |

## Developers

### Requirements
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"arweave": "^1.15.1",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"markdown-toc-gen": "^1.1.0",
"prettier": "^3.3.2"
},
"lint-staged": {
Expand All @@ -29,6 +30,9 @@
],
"*.{js,mjs}": [
"prettier --write"
],
"**/README.md": [
"markdown-toc-gen insert"
]
}
}
Loading
Loading