Compare commits

...

24 Commits

Author SHA1 Message Date
fluencebot
ac266a69bf
chore(main): release aqua-lib 0.12.1 (#93) 2024-09-18 11:39:51 +02:00
Maria Kuklina
cba9b785a3
fix: fix Peer.identify return type (#92) 2024-09-18 11:06:04 +02:00
fluencebot
49ca1fe7ff
chore(main): release aqua-lib 0.12.0 (#91) 2024-09-12 17:22:54 +02:00
Maria Kuklina
c8efe9c33a
update peer.identify (#90) 2024-09-12 17:16:33 +02:00
fluencebot
7bf3e62d3b
chore(main): release aqua-lib 0.11.0 (#89) 2024-08-08 13:37:03 +03:00
Aleksey Proshutinskiy
f8ef9f3a54
feat!: change Worker type in SubnetResolveResult (#88) 2024-08-08 13:28:08 +03:00
fluencebot
c01820d7ef
chore(main): release aqua-lib 0.10.2 (#87) 2024-02-24 13:50:32 +01:00
Maria Kuklina
b439997ba7
Add new method for module upload from vault (#86) 2024-02-24 13:39:51 +01:00
fluencebot
724bd44805
chore(main): release aqua-lib 0.10.1 (#85) 2024-02-19 20:12:54 +03:00
Nick
c92d3e3363
feat(worker): change cu_ids type (#84) 2024-02-19 20:12:24 +03:00
fluencebot
ae27eebd67
chore(main): release aqua-lib 0.10.0 (#83) 2024-02-19 18:41:30 +03:00
Nick
5414624156
feat(worker)!: add cu_ids to worker create (#82)
* feat(worker): add cu_ids to worker create

* add docs

* add docs
2024-02-19 18:35:02 +03:00
Maria Kuklina
f2665b0292
Remove Script API (#80) 2024-02-09 09:27:28 +01:00
fluencebot
5b5237dde6
chore(main): release aqua-lib 0.9.1 (#78) 2024-01-15 09:38:59 +01:00
InversionSpaces
60b91def4a
Add headers (#77) 2024-01-12 13:13:52 +01:00
fluencebot
d50ea23fb2
chore(main): release aqua-lib 0.9.0 (#76) 2023-12-21 16:24:44 +02:00
InversionSpaces
f89ecfbe79
fix(binary)!: Remove binary.aqua (#75) 2023-12-21 16:23:08 +02:00
InversionSpaces
09c2cd9c07
feat(builtin): Add header to builtin.aqua (#74) 2023-12-21 16:21:35 +02:00
InversionSpaces
e3c06bf8fc
Revert "Remove binary.aqua (#71)" (#73)
This reverts commit a062fcd44494bebf35ecdf238365f43a8b72732e.
2023-12-21 16:03:43 +02:00
InversionSpaces
3b31da9a41
Revert "Add header to builtin.aqua (#70)" (#72)
This reverts commit f8d7738798d38e5d2cbbe31f5009eb71a5b79101.
2023-12-21 16:03:30 +02:00
InversionSpaces
a062fcd444
Remove binary.aqua (#71) 2023-12-21 15:29:37 +02:00
InversionSpaces
f8d7738798
Add header to builtin.aqua (#70) 2023-12-21 11:37:07 +01:00
fluencebot
a59acbf40e
chore(main): release aqua-lib 0.8.2 (#68) 2023-12-13 15:37:16 +01:00
Aleksey Proshutinskiy
401621a389
feat(workers): add activate/deactivate (#65) 2023-11-27 20:34:22 +02:00
9 changed files with 133 additions and 67 deletions

View File

@ -1,3 +1,3 @@
{ {
".": "0.8.1" ".": "0.12.1"
} }

View File

@ -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)

View File

@ -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!

View File

@ -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

View File

@ -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
View File

@ -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"

View File

@ -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",

View File

@ -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

View File

@ -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