mirror of
https://github.com/fluencelabs/aqua-lib
synced 2025-04-24 23:42:14 +00:00
Compare commits
24 Commits
aqua-lib-v
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
ac266a69bf | ||
|
cba9b785a3 | ||
|
49ca1fe7ff | ||
|
c8efe9c33a | ||
|
7bf3e62d3b | ||
|
f8ef9f3a54 | ||
|
c01820d7ef | ||
|
b439997ba7 | ||
|
724bd44805 | ||
|
c92d3e3363 | ||
|
ae27eebd67 | ||
|
5414624156 | ||
|
f2665b0292 | ||
|
5b5237dde6 | ||
|
60b91def4a | ||
|
d50ea23fb2 | ||
|
f89ecfbe79 | ||
|
09c2cd9c07 | ||
|
e3c06bf8fc | ||
|
3b31da9a41 | ||
|
a062fcd444 | ||
|
f8d7738798 | ||
|
a59acbf40e | ||
|
401621a389 |
2
.github/release-please/manifest.json
vendored
2
.github/release-please/manifest.json
vendored
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
".": "0.8.1"
|
".": "0.12.1"
|
||||||
}
|
}
|
||||||
|
84
CHANGELOG.md
84
CHANGELOG.md
@ -1,5 +1,89 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.12.1](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.12.0...aqua-lib-v0.12.1) (2024-09-18)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fix Peer.identify return type ([#92](https://github.com/fluencelabs/aqua-lib/issues/92)) ([cba9b78](https://github.com/fluencelabs/aqua-lib/commit/cba9b785a3eae32bfd02d55d08febdd076540844))
|
||||||
|
|
||||||
|
## [0.12.0](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.11.0...aqua-lib-v0.12.0) (2024-09-12)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* **builtins:** update peer.identify
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **builtins:** update peer.identify ([c8efe9c](https://github.com/fluencelabs/aqua-lib/commit/c8efe9c33a0730a5ebaeb17228c2f4db90f7729e))
|
||||||
|
|
||||||
|
## [0.11.0](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.10.2...aqua-lib-v0.11.0) (2024-08-08)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* change Worker type in SubnetResolveResult ([#88](https://github.com/fluencelabs/aqua-lib/issues/88))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* change Worker type in SubnetResolveResult ([#88](https://github.com/fluencelabs/aqua-lib/issues/88)) ([f8ef9f3](https://github.com/fluencelabs/aqua-lib/commit/f8ef9f3a5408354026b6b6fccbf3689b492ff929))
|
||||||
|
|
||||||
|
## [0.10.2](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.10.1...aqua-lib-v0.10.2) (2024-02-24)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add new method for module upload from vault ([b439997](https://github.com/fluencelabs/aqua-lib/commit/b439997ba77168ea7a5e773368e0a03c6167d988))
|
||||||
|
|
||||||
|
## [0.10.1](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.10.0...aqua-lib-v0.10.1) (2024-02-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **worker:** change cu_ids type ([#84](https://github.com/fluencelabs/aqua-lib/issues/84)) ([c92d3e3](https://github.com/fluencelabs/aqua-lib/commit/c92d3e3363a936b0ba4db6bd0b2e2e42337bcfd1))
|
||||||
|
|
||||||
|
## [0.10.0](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.9.1...aqua-lib-v0.10.0) (2024-02-19)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* **worker:** add cu_ids to worker create ([#82](https://github.com/fluencelabs/aqua-lib/issues/82))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **worker:** add cu_ids to worker create ([#82](https://github.com/fluencelabs/aqua-lib/issues/82)) ([5414624](https://github.com/fluencelabs/aqua-lib/commit/54146241562fcece7fd6783305d2c5fd32aa6da8))
|
||||||
|
|
||||||
|
## [0.9.1](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.9.0...aqua-lib-v0.9.1) (2024-01-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **aqua-lib:** Add headers ([60b91de](https://github.com/fluencelabs/aqua-lib/commit/60b91def4a481e56f849f5d04734d117eb29c902))
|
||||||
|
|
||||||
|
## [0.9.0](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.8.2...aqua-lib-v0.9.0) (2023-12-21)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* **binary:** Remove binary.aqua ([#75](https://github.com/fluencelabs/aqua-lib/issues/75))
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **builtin:** Add header to builtin.aqua ([#74](https://github.com/fluencelabs/aqua-lib/issues/74)) ([09c2cd9](https://github.com/fluencelabs/aqua-lib/commit/09c2cd9c07ad25af673dc6f69e5ce4599428dfc0))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **binary:** Remove binary.aqua ([#75](https://github.com/fluencelabs/aqua-lib/issues/75)) ([f89ecfb](https://github.com/fluencelabs/aqua-lib/commit/f89ecfbe7910aed418a30400b4d6de4a82efa197))
|
||||||
|
|
||||||
|
## [0.8.2](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.8.1...aqua-lib-v0.8.2) (2023-11-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **workers:** add activate/deactivate ([#65](https://github.com/fluencelabs/aqua-lib/issues/65)) ([401621a](https://github.com/fluencelabs/aqua-lib/commit/401621a38930c8166984ecbf03edede451fe9487))
|
||||||
|
|
||||||
## [0.8.1](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.8.0...aqua-lib-v0.8.1) (2023-11-15)
|
## [0.8.1](https://github.com/fluencelabs/aqua-lib/compare/aqua-lib-v0.8.0...aqua-lib-v0.8.1) (2023-11-15)
|
||||||
|
|
||||||
|
|
||||||
|
25
binary.aqua
25
binary.aqua
@ -1,25 +0,0 @@
|
|||||||
-- TODO: add aqua tests
|
|
||||||
|
|
||||||
func and(l: bool, r: bool) -> bool:
|
|
||||||
res: ?bool
|
|
||||||
if l:
|
|
||||||
res <<- r
|
|
||||||
else:
|
|
||||||
res <<- false
|
|
||||||
<- res!
|
|
||||||
|
|
||||||
func or(l: bool, r: bool) -> bool:
|
|
||||||
res: ?bool
|
|
||||||
if l:
|
|
||||||
res <<- true
|
|
||||||
else:
|
|
||||||
res <<- r
|
|
||||||
<- res!
|
|
||||||
|
|
||||||
func not(u: bool) -> bool:
|
|
||||||
res: ?bool
|
|
||||||
if u:
|
|
||||||
res <<- false
|
|
||||||
else:
|
|
||||||
res <<- true
|
|
||||||
<- res!
|
|
49
builtin.aqua
49
builtin.aqua
@ -1,4 +1,5 @@
|
|||||||
-- Default public interface of Fluence nodes
|
-- Default public interface of Fluence nodes
|
||||||
|
aqua Builtin declares *
|
||||||
|
|
||||||
alias Field : []string
|
alias Field : []string
|
||||||
alias Argument : []string
|
alias Argument : []string
|
||||||
@ -34,12 +35,18 @@ data Interface:
|
|||||||
function_signatures: []FunctionSignature
|
function_signatures: []FunctionSignature
|
||||||
record_types: []RecordType
|
record_types: []RecordType
|
||||||
|
|
||||||
|
data VmInfo:
|
||||||
|
ip: string
|
||||||
|
default_ssh_port: u16
|
||||||
|
forwarded_ports: []string
|
||||||
|
|
||||||
data Info:
|
data Info:
|
||||||
external_addresses: []string
|
external_addresses: []string
|
||||||
node_version: string
|
node_version: string
|
||||||
air_version: string
|
air_version: string
|
||||||
spell_version: string
|
spell_version: string
|
||||||
allowed_binaries: []string
|
allowed_binaries: []string
|
||||||
|
vm_info: ?VmInfo
|
||||||
|
|
||||||
data ModuleWASIConfig:
|
data ModuleWASIConfig:
|
||||||
envs: ?Pairs
|
envs: ?Pairs
|
||||||
@ -64,13 +71,6 @@ data Blueprint:
|
|||||||
name: string
|
name: string
|
||||||
dependencies: []CID
|
dependencies: []CID
|
||||||
|
|
||||||
data ScriptInfo:
|
|
||||||
id: string
|
|
||||||
src: string
|
|
||||||
failures: u32
|
|
||||||
interval: string
|
|
||||||
owner: string
|
|
||||||
|
|
||||||
data Contact:
|
data Contact:
|
||||||
peer_id: string
|
peer_id: string
|
||||||
addresses: []string
|
addresses: []string
|
||||||
@ -283,20 +283,27 @@ service Dist("dist"):
|
|||||||
-- module_name - import name of the module
|
-- module_name - import name of the module
|
||||||
default_module_config(module_name: string) -> ModuleConfig
|
default_module_config(module_name: string) -> ModuleConfig
|
||||||
|
|
||||||
|
|
||||||
-- Used to add modules to the node specified in the service call
|
-- Used to add modules to the node specified in the service call
|
||||||
-- Arguments:
|
-- Arguments:
|
||||||
-- bytes – a base64 string containing the .wasm module to add.
|
-- bytes – a base64 string containing the .wasm module to add.
|
||||||
-- config – module info
|
-- config – module info
|
||||||
-- Returns: blake3 hash of the module
|
-- Returns: blake3 hash of the module
|
||||||
|
-- NOTE: the config is IGNORED and only module's `name` is taken from it
|
||||||
add_module(wasm_b56_content: Bytes, conf: ModuleConfig) -> string
|
add_module(wasm_b56_content: Bytes, conf: ModuleConfig) -> string
|
||||||
|
|
||||||
-- Adds module by copying it from Particle Vault directory
|
-- Adds module by copying it from Particle Vault directory
|
||||||
-- Arguments:
|
-- Arguments:
|
||||||
-- path – path or a filename
|
-- path – path or a filename
|
||||||
-- config - module config
|
-- config - module config
|
||||||
|
-- NOTE: the config is IGNORED and only module's `name` is taken from it
|
||||||
add_module_from_vault(path: Path, config: ModuleConfig) -> Hash
|
add_module_from_vault(path: Path, config: ModuleConfig) -> Hash
|
||||||
|
|
||||||
|
-- Adds module by copying it from Particle Vault directory
|
||||||
|
-- Arguments:
|
||||||
|
-- path – path or a filename
|
||||||
|
-- config - module config
|
||||||
|
add_module_bytes_from_vault(name: string, module_cid: string) -> string
|
||||||
|
|
||||||
-- Get a list of modules available on the node
|
-- Get a list of modules available on the node
|
||||||
list_modules() -> []Module
|
list_modules() -> []Module
|
||||||
|
|
||||||
@ -320,32 +327,6 @@ service Dist("dist"):
|
|||||||
-- Get a single blueprint
|
-- Get a single blueprint
|
||||||
get_blueprint(blueprint_id: string) -> Blueprint
|
get_blueprint(blueprint_id: string) -> Blueprint
|
||||||
|
|
||||||
service Script("script"):
|
|
||||||
-- Adds the given script to a node
|
|
||||||
-- Arguments:
|
|
||||||
-- air_script - raw AIR script without any undefined variables
|
|
||||||
-- interval - time to next run of the script in seconds
|
|
||||||
-- - if set, script will be ran once in the interval
|
|
||||||
-- - if not set, script will be ran only once
|
|
||||||
-- (NOTE: an actual interval may vary by up to 3 seconds)
|
|
||||||
add(air_script: string, interval: ?u64) -> string
|
|
||||||
|
|
||||||
-- Adds the script from the given path to a node
|
|
||||||
-- Arguments:
|
|
||||||
-- path - path to the AIR script without any undefined variables in the particle file vault
|
|
||||||
-- interval - time to next run of the script in seconds
|
|
||||||
-- - if set, script will be ran once in the interval
|
|
||||||
-- - if not set, script will be ran only once
|
|
||||||
-- (NOTE: an actual interval may vary by up to 3 seconds)
|
|
||||||
add_from_vault(path: Path, interval: ?u64) -> string
|
|
||||||
|
|
||||||
-- Removes recurring script from a node. Only the creator of the script can delete it
|
|
||||||
remove(script_id: string) -> bool
|
|
||||||
|
|
||||||
-- Returns a list of existing scripts on the node.
|
|
||||||
-- Each object in the list is of the following structure
|
|
||||||
list() -> []ScriptInfo
|
|
||||||
|
|
||||||
data SignResult:
|
data SignResult:
|
||||||
-- Was call successful or not
|
-- Was call successful or not
|
||||||
success: bool
|
success: bool
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
aqua MathLib declares *
|
||||||
|
|
||||||
service Math("math"):
|
service Math("math"):
|
||||||
-- x + y
|
-- x + y
|
||||||
add(x: i64, y: i64) -> i64
|
add(x: i64, y: i64) -> i64
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@fluencelabs/aqua-lib",
|
"name": "@fluencelabs/aqua-lib",
|
||||||
"version": "0.8.1",
|
"version": "0.12.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@fluencelabs/aqua-lib",
|
"name": "@fluencelabs/aqua-lib",
|
||||||
"version": "0.8.1",
|
"version": "0.12.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/aqua": "0.9.4"
|
"@fluencelabs/aqua": "0.9.4"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fluencelabs/aqua-lib",
|
"name": "@fluencelabs/aqua-lib",
|
||||||
"version": "0.8.1",
|
"version": "0.12.1",
|
||||||
"description": "Aqua standard library",
|
"description": "Aqua standard library",
|
||||||
"files": [
|
"files": [
|
||||||
"builtin.aqua",
|
"builtin.aqua",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
aqua SubnetLib declares *
|
||||||
|
|
||||||
data Worker:
|
data Worker:
|
||||||
pat_id: string
|
cu_ids: []string
|
||||||
host_id: string
|
host_id: string
|
||||||
worker_id: ?string
|
worker_id: ?string
|
||||||
|
|
||||||
|
28
workers.aqua
28
workers.aqua
@ -1,10 +1,18 @@
|
|||||||
|
aqua WorkersLib declares *
|
||||||
|
|
||||||
import PeerId from "./builtin.aqua"
|
import PeerId from "./builtin.aqua"
|
||||||
|
|
||||||
|
alias CUID : []u8
|
||||||
|
|
||||||
-- Available only on rust peers
|
-- Available only on rust peers
|
||||||
service Worker("worker"):
|
service Worker("worker"):
|
||||||
-- Creates new worker associated with `deal_id`.
|
-- Creates new worker associated with `deal_id` and allows specifying custom `cu_ids`.
|
||||||
-- Throws an error if worker exists.
|
-- Arguments:
|
||||||
create(deal_id: string) -> PeerId
|
-- deal_id - ID of the deal
|
||||||
|
-- cu_ids – an array of target compute unit IDs
|
||||||
|
-- Returns: PeerId - worker ID if creation was successful
|
||||||
|
-- Throws an error if a worker exists.
|
||||||
|
create(deal_id: string, cu_ids: []CUID) -> PeerId
|
||||||
|
|
||||||
-- Returns worker peer id associated with `deal_id`.
|
-- Returns worker peer id associated with `deal_id`.
|
||||||
-- Returns nil if worker doesn't exist.
|
-- Returns nil if worker doesn't exist.
|
||||||
@ -17,3 +25,17 @@ service Worker("worker"):
|
|||||||
|
|
||||||
-- Returns list of all workers.
|
-- Returns list of all workers.
|
||||||
list() -> []PeerId
|
list() -> []PeerId
|
||||||
|
|
||||||
|
-- Restarts worker installation spell.
|
||||||
|
-- Can be called only by system spells or peer manager,
|
||||||
|
-- Throws an error if worker doesn't exist.
|
||||||
|
activate(deal_id: string)
|
||||||
|
|
||||||
|
-- Stops all worker spells and drops all incoming particles until activation.
|
||||||
|
-- Can be called only by system spells or peer manager,
|
||||||
|
-- Throws an error if worker doesn't exist.
|
||||||
|
deactivate(deal_id: string)
|
||||||
|
|
||||||
|
-- Returns true if worker is active.
|
||||||
|
-- Throws an error if worker doesn't exist.
|
||||||
|
is_active(deal_id: string) -> bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user