permaweb / ao Goto Github PK
View Code? Open in Web Editor NEWThe ao component and tools Monorepo - ๐ฐ ๐ณ๏ธ ๐
Home Page: https://cookbook_ao.arweave.dev
License: Other
The ao component and tools Monorepo - ๐ฐ ๐ณ๏ธ ๐
Home Page: https://cookbook_ao.arweave.dev
License: Other
Allow specifying the bundler used to publish like:
ao publish -b https://node2.irys.xyz -w ... contract.wasm
setRecord
for subDomain
install
{
function: "setRecord",
subDomain: "install",
transactionId: installTxId,
}
If the user just calls ao
on the command line print the output as if the user called ao --help
The hyperbeam CLI needs a publish
command that will publish the built Wasm to Arweave with the appropriate tags:
{ name: "App-Name", value: "SmartWeaveContractSource" }
{ name: "App-Version", value: "0.4.0" }
{ name: "Content-Type", value: "application/wasm" }
{ name: "Contract-Type", value: "hyperbeam" }
p3rmaw3b/hyperbeam
imagepublish
command
-w
hb init foo
This script will create the new directory, and create two files:
null
tags
passed to the handler are now just the raw array of { name, value }
objects, from Arweave
handler
now accepts (buffer
, message
, ao
)
handler
returns a Promise
handler
does not return a Promise
These will be separate documents in persistence that purely contain an _id
field equal to the computed message id. Prior to evaluation, we will query the db, and if the message id exists, then we will simply skip over the message and not perform an evaluation.
result.messages
should contains all messages emitted across the range of interactions evaluated (accumulate array)result.output
should contain all out emitted across the range of interactions evaluated (accumulate string, separated by newlines)Also, we may want to consider a few helper commands for irys.
ao irys
ao irys fund [amount]
ao irys balance
ao irys -w [wallet]:
ao irys fund -w [wallet] -h [node] [amount]:
ao irys -w [wallet] balance:
Thoughts?
Is this the same thing @TillaTheHun0 / @twilson63 #21?
The hyperbeam dev-cli will need to be published to arweave, along with an install script to install that specific version of the cli.
Since we do not know the transaction that will contain the binaries until we publish them
result.spawns
should contains all spawns emitted across the range of interactions evaluated (accumulate array)As part of #117 , I disabled the SDK integration tests, until we have some ao processes we can use in them.
This issue just tracks turning those back on, so that we don't forget about it.
Using Lua, docker and emscripten create a cli tool that can be used to compile lua scripts into wasm. The tool will need to wrap the lua contracts in a main lua function that deserializes the incoming JSON string and serializes the outgoing table into a json string.
hb
cliAs described in https://hctzqejcuudjfi4t5lfxlp7vgrxflkdvikmigkyy7kecn6rpgjhq.arweave.net/OKeYESKlBpKjk-rLdb_1NG5VqHVCmIMrGPqIJvovMk8
/scheduled/:processId?[from=messageId]&[to=messageId]
Much of the logic between the endpoints will be shared and reusable. So once I have /state
done, the others will be able to piggy back off of that work.
Init-State
tagInit-State-Tx
tagContract-Src
We should check if docker exists then print a message if docker is not installed.
repl
run
build
publish
contract
ao
source as part of ao publish
?add docs in ao site and readme's
This task is to build out the compile to wasm function
hb build
This function will call
docker run -v ${PWD}:/src hyperbeam/dev emcc-lua
Right now only a single page of 5000 are fetched from the warp sequencer. We need to implement fetching multiple pages and combining the results in the Warp Sequencer Client.
See
ao/sdk/src/client/warp-sequencer.js
Lines 143 to 144 in 9a06812
With the move to be DataItem centric, ao
will no longer share many semantics with SmartWeaveContracts:
Init-State
will not be required, and instead any tags can provided on the initial process spawn
, which collectively will serve as the "initial state"Contract-Src
will still be required and the rules therein will be the same ie. "must be an ao
Contract-TypeIn addition to changing semantics, ao
will also no longer use the Warp Sequencer, and therefore will not need to register the ao
Process at the Warp Gateway (in order for the Warp Sequencer to sequence properly)
The ao
SDK will need to implement these new rules
With ao publish
we should check if the user has a funded wallet on Irys.
And let them know they need to fund their wallet on Irys in order publish
This server needs to expose an endpoint /crank/:tx
this endpoint takes a interaction id to connect to know which messages to crank.
Look at subscribing to the contract to get notifications and cache them in the server.
const result = await warp.contract(CONTRACT).connect(signer).evaluationOptions(options).writeInteraction(input)
// subscribe to events from that contract
// need an internal pub/sub mechanism to trigger when messages are available
// get those messages and subscribe to events and repeat
create an ao-sdk that supports the readState
I propose the following protocol/layout for the messenger/sdk
A .drive(muAddress, txId, callBack) (or .crank) is added to the sdk. This can be called immediately after a writeInteraction or any time later down the line. This opens a websocket to the mu and sends a request for status on a txId. The status will be a JSON response 1 of 4 things
{status: "NONE", info: {...message etc}}
{status: "SUCCESS", info: {...message etc}}
{status: "FAILURE", info: {...message etc}}
{status: "PROCESSING", info: {...message etc}}
PROCESSING means the messenger is still cranking, NONE means cranking never started.
When the sdk receives a SUCCESS or FAILURE it will call the callback sent into .drive() or .crank()
Title says it all.
As part of this, I may also try to automate update install_ao g8way, if I can figure out how to add to CI
Move setting up install_ao
ANT contract to a separate issue, so as to unblock X64 Mac users asap
The CLI needs to build a wasm
file that contains the following methods:
The loader will need to implement the pause
and resume
methods to allow the cu
to stash the state as memory.
This version is built with emscripten
, but as long as the abstraction is consistent, we should be able to build a version of the loader that handles wasi
and the cu
can support both emscripten
and wasi
implementations.
The loader will also surface the spawn
and handle
process to the cu
to be called.
As described in https://hackmd.io/fb6-25ccQbe7Ffg4uDVNdg
readState
from SDK into cu
(done by @VinceJuliano)readState
in SDK to fetch from cu
endpoint/relayer/crank
input:
Right now, the inner shape of a failed evaluation (implemented using a transduce
) is being exposed when readState
returns.
Instead, the SDK should unwrap the value from the transduce
and return that instead
We'd like to provide an API for Lua SmartWeaveContracts to:
send
messages to another contract (by way of returning a properly formatted results
output)receive
messages from other contracts (by way of returning a properly formatted results
output)spawn
new contract instances (not sure on this mechanism yet. Maybe expose on results
?)We need to decide on what inputs are required, validate those inputs, and then determine a way to expose to the contract.
send
receive
spawn
AoMessages
and show that it works as part of a contract invocationRight now the relay is all in memory so if something fails theres no way it can pick up where it left off cranking. If someone requests cranking on a tx it should pick up where it left off and not try to crank the same messages
Contracts are often created programmatically. The ability to create an AO contract, using the SDK, would be great for those use-cases.
createContract
api
Questions:
Right now, the cache is blown away on each deploy. This works well in the development stage when the cache shape is in flux.
Eventually though, once the cache shape and debugging is more stable, we'll need to mount a Render Disk and allow placing the PouchDB files on that persistent disk, so the cache will persist across deploys.
This module is deprecated and needs to be marked as such using the npm
cli, and made to point to the new loader
Since the packages will be published under the @permaweb
scope (@permaweb/ao-loader
and @permaweb/ao-sdk
), I wasn't able to publish the packages without first needing to login to NPM CLI using the account that issued the Auth token (I think an account owned by @twilson63?)
So once the packages are registered under that scope on NPM, they can be published be CI using the token.
@permaweb/ao-loader
module on NPM@permaweb/ao-sdk
module on NPM@permaweb/ao-loader
module on NPM (can be done with CI)@permaweb/ao-sdk
module on NPM (can be done with CI)/message - sends a message to su and does the cranking
/spawn - creates a new AO contract and sends it to the su
/monitor - watches a process for implicit actions and cranks those actions
The ao build script should support require
lua files based on path.
We've settled on ao
as the new name for the hyperbeam
project. So we need to account for this in the project.
hb
-> ao
hyperbeam
-> ao
hyperbeam
and hb
in code with ao
Contract-Type
used by CLI and modified Warp SDKprocessId
and to
(messageId)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.