-
Notifications
You must be signed in to change notification settings - Fork 59
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
Lua Messages API #21
Comments
I had to switch focus to the AO js SDK, so wasn't able to dive much into this. I'll un-assign for now, until we know who's working on it. |
Before anyone works on how this library will be published we need to discuss and determine the strategy.
This library will only be used for ao-sdk, it is not a general library and will not have any utility outside of the SDK. So what is the best approach?
{
contract: ...,
block: ...,
transaction: ...,
ao: {
send: ...,
receive: ...,
spawn: ...
}
}
For example, NodeJS provides implicit modules for standard library like We could do the same, local ao = require "ao"
... and bundle it during the compile step.
ao build -r ao-lib Happy to entertain more options, but if we can't come to agreement for 0.1, I recommend we embed/bundle the library like we do the https://github.com/permaweb/ao/tree/main/dev-cli/container/src |
This Dockerfile has luarocks: https://github.com/permaweb/ao/blob/main/dev-cli/container/Dockerfile It can install the ao-lib from the permaweb with configuration, though fwiw I was just messing around with luarocks in it's own repo so I could play around with the tool. My intention was to move it into the monorepo once I have it running the "lua documented way", but wanted to get it working without uploading the whole repo so I could work quickly (luarocks tries uploading the entire repo for some reason when using luarocks upload and it was taking forever): I would also build this lib in it's own repo now that I have played with luarocks (and setup a job that uploads the .rock / .rockspec to the permaweb), then pull it in from the permaweb and into the container using the luarocks instance you're already installing on this Dockerfile. Or you could not use the luarocks tool and just curl or something but youre already installing luarocks on the Dockerfile so the tools are there. That would be like not using npm/yarn and just using curl and unziping a zip. I'd probably go with this option: Anyways, are there any docs on the receive / spawn / send inputs and outputs? |
We are not using luaRocks in 0.1 it is not on the table |
Tom, do you understand what I mean when I say "i was just using luarocks to test out lua?" I feel like we're talking past each other. |
Sorry for the delay on this. I lean towards option 2. It is the simplest to implement given the current toolchain, we know how to do it already (we do it with |
ao-lib - specs https://g8way.io/ay2Q_xfgO1HO5YkIKTgS5XdNPrw1UxM5z414b5sxRaA |
This is effectively done, just existing in |
We'd like to provide an API for Lua SmartWeaveContracts to:
send
messages to another contract (by way of returning a properly formattedresults
output)receive
messages from other contracts (by way of returning a properly formattedresults
output)spawn
new contract instances (not sure on this mechanism yet. Maybe expose onresults
?)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 invocationThe text was updated successfully, but these errors were encountered: