mirror of
https://github.com/fluencelabs/examples
synced 2025-04-25 10:42:16 +00:00
bump versions, remove unused files
This commit is contained in:
parent
8fca51c2c0
commit
eb1ff6c8db
@ -1,233 +0,0 @@
|
||||
-- Default public interface of Fluence nodes
|
||||
|
||||
alias Field : []string
|
||||
alias Argument : []string
|
||||
alias Bytes : []u8
|
||||
alias PeerId : string
|
||||
alias Pairs : [][]string
|
||||
alias Base58String : string
|
||||
alias Hash : string
|
||||
|
||||
-- There are two types of dependencies: named and by-hash.
|
||||
-- name:foobar – specifies dependency by module name, points to a module with import name 'foobar'
|
||||
-- hash:04dc884... – specifies dependency by module hash
|
||||
-- By-hash dependencies are preffered since they are determenistic
|
||||
-- while by-name dependency can yield different modules at different points in time
|
||||
alias Dependency : string
|
||||
|
||||
data Service:
|
||||
id: string
|
||||
blueprint_id: string
|
||||
owner_id: string
|
||||
|
||||
data FunctionSignature:
|
||||
arguments: []Argument
|
||||
name: string
|
||||
output_types: []string
|
||||
|
||||
data RecordType:
|
||||
fields: []Field
|
||||
id: u64
|
||||
name: string
|
||||
|
||||
data Interface:
|
||||
function_signatures: []FunctionSignature
|
||||
record_types: []RecordType
|
||||
|
||||
data Info:
|
||||
external_addresses: []string
|
||||
|
||||
data ModuleConfig:
|
||||
name: string
|
||||
|
||||
data Module:
|
||||
name: string
|
||||
hash: string
|
||||
config: ModuleConfig
|
||||
|
||||
data AddBlueprint:
|
||||
name: string
|
||||
dependencies: []Dependency
|
||||
|
||||
data Blueprint:
|
||||
id: string
|
||||
name: string
|
||||
dependencies: []Dependency
|
||||
|
||||
data ScriptInfo:
|
||||
id: string
|
||||
src: string
|
||||
failures: u32
|
||||
interval: string
|
||||
owner: string
|
||||
|
||||
data Contact:
|
||||
peer_id: string
|
||||
addresses: []string
|
||||
|
||||
service Op("op"):
|
||||
-- does nothing
|
||||
noop()
|
||||
-- returns length of the passed array
|
||||
array_length(array: []string) -> u32
|
||||
-- takes any number of arguments and wraps them into a single array
|
||||
array(a: string, b: ?string, c: ?string, d: ?string) -> []string
|
||||
-- takes any number of arrays and flattens them by concatenating
|
||||
concat(a: []string, b: ?[]string, c: ?[]string, d: ?[]string) -> []string
|
||||
-- takes a single argument and returns it back
|
||||
identity(s: ?string) -> ?string
|
||||
string_to_b58(s: string) -> Base58String
|
||||
string_from_b58(b: Base58String) -> string
|
||||
bytes_to_b58(bs: []u8) -> Base58String
|
||||
bytes_from_b58(b: Base58String) -> []u8
|
||||
-- Applies SHA256 to the given string
|
||||
-- Argument: s - string to apply sha256 to (hash is applied to utf8 bytes of s)
|
||||
-- Returns: returns sha256 multihash encoded as base58
|
||||
sha256_string(s: string) -> Base58String
|
||||
|
||||
-- concatenate strings (in AIR it takes any number of arguments)
|
||||
concat_strings(a: string, b: string) -> string
|
||||
|
||||
service Peer("peer"):
|
||||
-- Checks if there is a direct connection to the peer identified by a given PeerId
|
||||
-- Argument: PeerId – id of the peer to check if there's a connection with
|
||||
-- Returns: bool - true if connected to the peer, false otherwise
|
||||
is_connected(peer: PeerId) -> bool
|
||||
|
||||
-- Initiates a connection to the specified peer
|
||||
-- Arguments:
|
||||
-- id - id of the target peer
|
||||
-- multiaddrs – an array of target peer's addresses
|
||||
-- Returns: bool - true if connection was successful
|
||||
connect(id: PeerId, multiaddrs: ?[]string) -> bool
|
||||
-- Resolves the contact of a peer via Kademlia
|
||||
-- Argument: PeerId – id of the target peer
|
||||
-- Returns: Contact - true if connection was successful
|
||||
get_contact(peer: PeerId) -> Contact
|
||||
|
||||
-- Get information about the peer
|
||||
identify() -> Info
|
||||
|
||||
-- Get Unix timestamp in milliseconds
|
||||
timestamp_ms() -> u64
|
||||
|
||||
-- Get Unix timestamp in seconds
|
||||
timestamp_sec() -> u64
|
||||
|
||||
service Kademlia("kad"):
|
||||
-- Instructs node to return the locally-known nodes
|
||||
-- in the Kademlia neighborhood for a given key
|
||||
-- Arguments:
|
||||
-- key – base58 string
|
||||
-- already_hashed – default false; if set to true, key is considered to be a SHA256 multihash
|
||||
-- count – default 20; limits number of returned nodes
|
||||
neighborhood(key: Base58String, already_hashed: ?bool, count: ?u32) -> []PeerId
|
||||
-- Merges given lists and sorts them by distance to target
|
||||
-- Arguments:
|
||||
-- target – base58 string; result is sorted by XOR distance to target
|
||||
-- left – list of base58 strings
|
||||
-- right – list of base58 strings
|
||||
-- count – how many items to return; default 20
|
||||
-- Returns: list of base58 strings sorted by distance to target; list will contain at most count elements
|
||||
merge(target: Base58String, left: []string, right: []string, count: ?u32) -> []string
|
||||
|
||||
service Srv("srv"):
|
||||
-- Used to create a service on a certain node
|
||||
-- Arguments:
|
||||
-- blueprint_id – ID of the blueprint that has been added to the node specified in the service call by the dist add_blueprint service.
|
||||
-- Returns: service_id – the service ID of the created service.
|
||||
create(blueprint_id: string) -> string
|
||||
|
||||
-- Used to remove a service from a certain node
|
||||
-- Arguments:
|
||||
-- service_id – ID of the service to remove
|
||||
remove(service_id: string)
|
||||
|
||||
-- Returns a list of services running on a peer
|
||||
list() -> []Service
|
||||
|
||||
-- Adds an alias on service, so, service could be called
|
||||
-- not only by service_id but by alias as well.
|
||||
-- Arguments:
|
||||
-- alias - settable service name
|
||||
-- service_id – ID of the service whose interface you want to name.
|
||||
add_alias(alias: string, service_id: string)
|
||||
|
||||
-- Resolves given alias to a service id
|
||||
-- If there's no such alias, throws an error
|
||||
-- Returns: service id associated with the given alias
|
||||
resolve_alias(alias: string) -> string
|
||||
|
||||
-- Retrieves the functional interface of a service running
|
||||
-- on the node specified in the service call
|
||||
-- Argument: service_id – ID of the service whose interface you want to retrieve.
|
||||
get_interface(service_id: string) -> Interface
|
||||
|
||||
service Dist("dist"):
|
||||
-- Constructs a ModuleConfig structure
|
||||
-- Arguments:
|
||||
-- module_name - import name of the module
|
||||
-- mem_pages_count - Maximum memory size accessible by a module in Wasm pages (64 Kb)
|
||||
-- logger_enabled - Defines whether Marine should provide a special host log_utf8_string function for this module
|
||||
-- preopened_files - Files available for this module. Module can access only files from this list
|
||||
-- envs - environment variables available for this module
|
||||
-- mapped_dirs - Directory mapping, e.g. [["/sites", "./web/data"]] so all
|
||||
-- reads & writes to /sites will actually to go ./web/data
|
||||
-- mounted_binaries - Mapping of host binaries available to call from module,
|
||||
-- e.g. [["curl", "/usr/bin/curl"]] will allow module to
|
||||
-- call /usr/bin/curl binary as function 'curl'
|
||||
-- logging_mask - Binary mask to enable & disable logging targets. Targets are
|
||||
-- configured in WasmLoggerBuilder::with_target_map
|
||||
-- mem_pages_count - Maximum memory size accessible by a module in Wasm pages (64 Kb)
|
||||
make_module_config(name: string, mem_pages_count: ?u32, logger_enabled: ?bool, preopened_files: ?[]string, envs: ?Pairs, mapped_dirs: ?Pairs, mounted_binaries: ?Pairs, logging_mask: ?i32) -> ModuleConfig
|
||||
|
||||
-- Constructs a ModuleConfig structure
|
||||
-- Arguments:
|
||||
-- module_name - import name of the module
|
||||
default_module_config(module_name: string) -> ModuleConfig
|
||||
|
||||
|
||||
-- Used to add modules to the node specified in the service call
|
||||
-- Arguments:
|
||||
-- bytes – a base64 string containing the .wasm module to add.
|
||||
-- config – module info
|
||||
-- Returns: blake3 hash of the module
|
||||
add_module(wasm_b56_content: Bytes, conf: ModuleConfig) -> string
|
||||
|
||||
-- Adds module by copying it from Particle Vault directory
|
||||
-- Arguments:
|
||||
-- path – path or a filename
|
||||
-- config - module config
|
||||
add_module_from_vault(path: string, config: ModuleConfig) -> Hash
|
||||
|
||||
-- Get a list of modules available on the node
|
||||
list_modules() -> []Module
|
||||
|
||||
-- Get the interface of a module
|
||||
get_interface(module_id: string) -> Interface
|
||||
|
||||
-- Creates Blueprint structure from from blueprint name and dependencies (modules)
|
||||
make_blueprint(name: string, dependencies: []Dependency) -> AddBlueprint
|
||||
-- Add a blueprint to the node
|
||||
add_blueprint(blueprint: AddBlueprint) -> string
|
||||
|
||||
-- Used to get the blueprints available on the node specified in the service call.
|
||||
-- A blueprint is an object of the following structure
|
||||
list_blueprints() -> []Blueprint
|
||||
|
||||
service Script("script"):
|
||||
-- Adds the given script to a node
|
||||
-- Arguments:
|
||||
-- air_script - raw AIR script without any undefined variables
|
||||
-- interval - if not set, script will be ran only once
|
||||
-- if set, script will be ran once in the interval
|
||||
-- (NOTE: actual interval may vary by up to 3 seconds)
|
||||
-- TODO: change interval to ?u64 when node API is updated
|
||||
add(air_script: string, interval: ?string) -> string
|
||||
|
||||
-- Removes recurring script from a node. Only a 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
|
@ -9,14 +9,14 @@
|
||||
"version": "0.1.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-lib": "^0.1.14",
|
||||
"@fluencelabs/fluence": "^0.14.3",
|
||||
"@fluencelabs/aqua-lib": "^0.2.1",
|
||||
"@fluencelabs/fluence": "^0.15.1",
|
||||
"@fluencelabs/fluence-network-environment": "^1.0.10",
|
||||
"it-all": "^1.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fluencelabs/aqua": "^0.4.0-235",
|
||||
"typescript": "^4.0.0"
|
||||
"@fluencelabs/aqua": "^0.5.0-247",
|
||||
"typescript": "^4.5.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@chainsafe/libp2p-noise": {
|
||||
@ -51,12 +51,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@fluencelabs/aqua": {
|
||||
"version": "0.4.0-235",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.4.0-235.tgz",
|
||||
"integrity": "sha512-tbbHG3dhlwcSzlHMPoV4/MLW6JE00q3hiyznjLh+aW91ovBAXuWe5C1n9CKeRiJtYz3yIQCn2l3arI/PvzLx9Q==",
|
||||
"version": "0.5.0-247",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.5.0-247.tgz",
|
||||
"integrity": "sha512-fqTyOfBqd5qOek/ciVZTHqBlk4qAMvd+zAiYtLr9HfIECb45XZF2m1MHexl8F8Fh4G5I4gAVdrto9ZM5lSPVrA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@fluencelabs/fluence": "0.12.1"
|
||||
"@fluencelabs/fluence": "0.15.1"
|
||||
},
|
||||
"bin": {
|
||||
"aqua": "index.js",
|
||||
@ -64,27 +64,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@fluencelabs/aqua-lib": {
|
||||
"version": "0.1.14",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.1.14.tgz",
|
||||
"integrity": "sha512-H2Q4gIvociUxc4J2mwmH0D+mrU2N2Z+enKCHgBCanMVEE2wZDsZ80GTbDKsQjEq+gpqbnJIk8lJBYW6lyvLJTg=="
|
||||
},
|
||||
"node_modules/@fluencelabs/aqua/node_modules/@fluencelabs/avm": {
|
||||
"version": "0.14.4",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.14.4.tgz",
|
||||
"integrity": "sha512-XyR+1H5k0CAc+mDHOkl81viX8XeW1Yqbw793xbsfUfju5bUb/hqk+gHv3q8lAFdbrCG5P45gdOT08a5RNODZaQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"base64-js": "1.5.1"
|
||||
}
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.2.1.tgz",
|
||||
"integrity": "sha512-uLP9mbgFHR1Q1FYhehasNxNBlTclBsjNI9MvIPF8oXtVJtnvPi+R4rGGTOHtRJukunxhpAV/svWQU9a2BRyDmQ=="
|
||||
},
|
||||
"node_modules/@fluencelabs/aqua/node_modules/@fluencelabs/fluence": {
|
||||
"version": "0.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.12.1.tgz",
|
||||
"integrity": "sha512-JrMKMHjYILAHQsLLd5H0fLt/UMZv+/PQYxJYe6h9HFyJlZrN1bUV+EcZnUw1u3DZE5k/RXBx0udfmkahggwrqA==",
|
||||
"version": "0.15.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.15.1.tgz",
|
||||
"integrity": "sha512-ZHLw85XgVMglCVJjGkdGRFzL7kO2x31BCYDt4BVlMCE/S2nFSsVHU8DO35Jlh40QZhQdN3F5dbJpkgdcwdC8bw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@chainsafe/libp2p-noise": "4.0.0",
|
||||
"@fluencelabs/avm": "0.14.4",
|
||||
"@fluencelabs/avm": "0.16.0-restriction-operator.9",
|
||||
"async": "3.2.0",
|
||||
"base64-js": "1.5.1",
|
||||
"bs58": "4.0.1",
|
||||
@ -98,24 +89,26 @@
|
||||
"loglevel": "1.7.0",
|
||||
"multiaddr": "10.0.0",
|
||||
"peer-id": "0.15.3",
|
||||
"rxjs": "^7.3.0",
|
||||
"ts-pattern": "^3.3.3",
|
||||
"uuid": "8.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@fluencelabs/avm": {
|
||||
"version": "0.16.7",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.16.7.tgz",
|
||||
"integrity": "sha512-tSbEBRdHTz6PCxLuzEWe3ayZQeDiuJu/Dw0qJmdpYe6eJf0jSwUnAnRaEOv2d0ILnzT1b4us9tCKOhac41YlLg==",
|
||||
"version": "0.16.0-restriction-operator.9",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.16.0-restriction-operator.9.tgz",
|
||||
"integrity": "sha512-34vJqo8TIho5H2+WhEAJOa6WxAPiS+c7Z3WKmRZVi+GAsZN3Hv2NiuiCFNFBmPRoD+juzHe4Dmv5cF7HZc6O6w==",
|
||||
"dependencies": {
|
||||
"base64-js": "1.5.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@fluencelabs/fluence": {
|
||||
"version": "0.14.3",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.14.3.tgz",
|
||||
"integrity": "sha512-JlF/B9Wtz0VMBJIfA+hZYZt44nX5AIJzgkhfbT1fKfwzb1CvS6IYaaH6PE8vLcBm556sJic94yYL++FpQrJUmQ==",
|
||||
"version": "0.15.2",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.15.2.tgz",
|
||||
"integrity": "sha512-RWGh70XkqcJusaqB4TR0tVBSVkzlMU9krwALQmgilLTxaSBMPtB6xMt13ceEJ/G6BwsLZWdgY2Wy6GvdSheKaw==",
|
||||
"dependencies": {
|
||||
"@chainsafe/libp2p-noise": "4.0.0",
|
||||
"@fluencelabs/avm": "0.16.7",
|
||||
"@fluencelabs/avm": "0.16.0-restriction-operator.9",
|
||||
"async": "3.2.0",
|
||||
"base64-js": "1.5.1",
|
||||
"bs58": "4.0.1",
|
||||
@ -2498,9 +2491,9 @@
|
||||
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz",
|
||||
"integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==",
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz",
|
||||
"integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
@ -2683,31 +2676,22 @@
|
||||
}
|
||||
},
|
||||
"@fluencelabs/aqua": {
|
||||
"version": "0.4.0-235",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.4.0-235.tgz",
|
||||
"integrity": "sha512-tbbHG3dhlwcSzlHMPoV4/MLW6JE00q3hiyznjLh+aW91ovBAXuWe5C1n9CKeRiJtYz3yIQCn2l3arI/PvzLx9Q==",
|
||||
"version": "0.5.0-247",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua/-/aqua-0.5.0-247.tgz",
|
||||
"integrity": "sha512-fqTyOfBqd5qOek/ciVZTHqBlk4qAMvd+zAiYtLr9HfIECb45XZF2m1MHexl8F8Fh4G5I4gAVdrto9ZM5lSPVrA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@fluencelabs/fluence": "0.12.1"
|
||||
"@fluencelabs/fluence": "0.15.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fluencelabs/avm": {
|
||||
"version": "0.14.4",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.14.4.tgz",
|
||||
"integrity": "sha512-XyR+1H5k0CAc+mDHOkl81viX8XeW1Yqbw793xbsfUfju5bUb/hqk+gHv3q8lAFdbrCG5P45gdOT08a5RNODZaQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"base64-js": "1.5.1"
|
||||
}
|
||||
},
|
||||
"@fluencelabs/fluence": {
|
||||
"version": "0.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.12.1.tgz",
|
||||
"integrity": "sha512-JrMKMHjYILAHQsLLd5H0fLt/UMZv+/PQYxJYe6h9HFyJlZrN1bUV+EcZnUw1u3DZE5k/RXBx0udfmkahggwrqA==",
|
||||
"version": "0.15.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.15.1.tgz",
|
||||
"integrity": "sha512-ZHLw85XgVMglCVJjGkdGRFzL7kO2x31BCYDt4BVlMCE/S2nFSsVHU8DO35Jlh40QZhQdN3F5dbJpkgdcwdC8bw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@chainsafe/libp2p-noise": "4.0.0",
|
||||
"@fluencelabs/avm": "0.14.4",
|
||||
"@fluencelabs/avm": "0.16.0-restriction-operator.9",
|
||||
"async": "3.2.0",
|
||||
"base64-js": "1.5.1",
|
||||
"bs58": "4.0.1",
|
||||
@ -2721,31 +2705,33 @@
|
||||
"loglevel": "1.7.0",
|
||||
"multiaddr": "10.0.0",
|
||||
"peer-id": "0.15.3",
|
||||
"rxjs": "^7.3.0",
|
||||
"ts-pattern": "^3.3.3",
|
||||
"uuid": "8.3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@fluencelabs/aqua-lib": {
|
||||
"version": "0.1.14",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.1.14.tgz",
|
||||
"integrity": "sha512-H2Q4gIvociUxc4J2mwmH0D+mrU2N2Z+enKCHgBCanMVEE2wZDsZ80GTbDKsQjEq+gpqbnJIk8lJBYW6lyvLJTg=="
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.2.1.tgz",
|
||||
"integrity": "sha512-uLP9mbgFHR1Q1FYhehasNxNBlTclBsjNI9MvIPF8oXtVJtnvPi+R4rGGTOHtRJukunxhpAV/svWQU9a2BRyDmQ=="
|
||||
},
|
||||
"@fluencelabs/avm": {
|
||||
"version": "0.16.7",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.16.7.tgz",
|
||||
"integrity": "sha512-tSbEBRdHTz6PCxLuzEWe3ayZQeDiuJu/Dw0qJmdpYe6eJf0jSwUnAnRaEOv2d0ILnzT1b4us9tCKOhac41YlLg==",
|
||||
"version": "0.16.0-restriction-operator.9",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.16.0-restriction-operator.9.tgz",
|
||||
"integrity": "sha512-34vJqo8TIho5H2+WhEAJOa6WxAPiS+c7Z3WKmRZVi+GAsZN3Hv2NiuiCFNFBmPRoD+juzHe4Dmv5cF7HZc6O6w==",
|
||||
"requires": {
|
||||
"base64-js": "1.5.1"
|
||||
}
|
||||
},
|
||||
"@fluencelabs/fluence": {
|
||||
"version": "0.14.3",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.14.3.tgz",
|
||||
"integrity": "sha512-JlF/B9Wtz0VMBJIfA+hZYZt44nX5AIJzgkhfbT1fKfwzb1CvS6IYaaH6PE8vLcBm556sJic94yYL++FpQrJUmQ==",
|
||||
"version": "0.15.2",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.15.2.tgz",
|
||||
"integrity": "sha512-RWGh70XkqcJusaqB4TR0tVBSVkzlMU9krwALQmgilLTxaSBMPtB6xMt13ceEJ/G6BwsLZWdgY2Wy6GvdSheKaw==",
|
||||
"requires": {
|
||||
"@chainsafe/libp2p-noise": "4.0.0",
|
||||
"@fluencelabs/avm": "0.16.7",
|
||||
"@fluencelabs/avm": "0.16.0-restriction-operator.9",
|
||||
"async": "3.2.0",
|
||||
"base64-js": "1.5.1",
|
||||
"bs58": "4.0.1",
|
||||
@ -4704,9 +4690,9 @@
|
||||
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz",
|
||||
"integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==",
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz",
|
||||
"integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==",
|
||||
"dev": true
|
||||
},
|
||||
"uint8arrays": {
|
||||
|
@ -13,8 +13,8 @@
|
||||
"package-lock.json"
|
||||
],
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-lib": "^0.1.14",
|
||||
"@fluencelabs/fluence": "^0.14.3",
|
||||
"@fluencelabs/aqua-lib": "^0.2.1",
|
||||
"@fluencelabs/fluence": "^0.15.1",
|
||||
"@fluencelabs/fluence-network-environment": "^1.0.10",
|
||||
"it-all": "^1.0.5"
|
||||
},
|
||||
@ -43,7 +43,7 @@
|
||||
},
|
||||
"homepage": "git+https://github.com/fluencelabs/examples/aqua-examples/echo-greeter#readme",
|
||||
"devDependencies": {
|
||||
"@fluencelabs/aqua": "^0.4.0-235",
|
||||
"typescript": "^4.0.0"
|
||||
"@fluencelabs/aqua": "^0.5.0-247",
|
||||
"typescript": "^4.5.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,801 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.4.0-235
|
||||
*
|
||||
*/
|
||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||
import {
|
||||
CallParams,
|
||||
callFunction,
|
||||
registerService,
|
||||
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v2';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
export interface SrvDef {
|
||||
add_alias: (alias: string, service_id: string, callParams: CallParams<'alias' | 'service_id'>) => void | Promise<void>;
|
||||
create: (blueprint_id: string, callParams: CallParams<'blueprint_id'>) => string | Promise<string>;
|
||||
get_interface: (service_id: string, callParams: CallParams<'service_id'>) => { function_signatures: { arguments: string[][]; name: string; output_types: string[]; }[]; record_types: { fields: string[][]; id: number; name: string; }[]; } | Promise<{ function_signatures: { arguments: string[][]; name: string; output_types: string[]; }[]; record_types: { fields: string[][]; id: number; name: string; }[]; }>;
|
||||
list: (callParams: CallParams<null>) => { blueprint_id: string; id: string; owner_id: string; }[] | Promise<{ blueprint_id: string; id: string; owner_id: string; }[]>;
|
||||
remove: (service_id: string, callParams: CallParams<'service_id'>) => void | Promise<void>;
|
||||
resolve_alias: (alias: string, callParams: CallParams<'alias'>) => string | Promise<string>;
|
||||
}
|
||||
export function registerSrv(service: SrvDef): void;
|
||||
export function registerSrv(serviceId: string, service: SrvDef): void;
|
||||
export function registerSrv(peer: FluencePeer, service: SrvDef): void;
|
||||
export function registerSrv(peer: FluencePeer, serviceId: string, service: SrvDef): void;
|
||||
|
||||
|
||||
export function registerSrv(...args: any) {
|
||||
registerService(
|
||||
args,
|
||||
{
|
||||
"defaultServiceId" : "srv",
|
||||
"functions" : [
|
||||
{
|
||||
"functionName" : "add_alias",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "alias",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "service_id",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "void"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "create",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "blueprint_id",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "get_interface",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "service_id",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "list",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "remove",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "service_id",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "void"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "resolve_alias",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "alias",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface PeerDef {
|
||||
connect: (id: string, multiaddrs: string[] | null, callParams: CallParams<'id' | 'multiaddrs'>) => boolean | Promise<boolean>;
|
||||
get_contact: (peer: string, callParams: CallParams<'peer'>) => { addresses: string[]; peer_id: string; } | Promise<{ addresses: string[]; peer_id: string; }>;
|
||||
identify: (callParams: CallParams<null>) => { external_addresses: string[]; } | Promise<{ external_addresses: string[]; }>;
|
||||
is_connected: (peer: string, callParams: CallParams<'peer'>) => boolean | Promise<boolean>;
|
||||
timestamp_ms: (callParams: CallParams<null>) => number | Promise<number>;
|
||||
timestamp_sec: (callParams: CallParams<null>) => number | Promise<number>;
|
||||
}
|
||||
export function registerPeer(service: PeerDef): void;
|
||||
export function registerPeer(serviceId: string, service: PeerDef): void;
|
||||
export function registerPeer(peer: FluencePeer, service: PeerDef): void;
|
||||
export function registerPeer(peer: FluencePeer, serviceId: string, service: PeerDef): void;
|
||||
|
||||
|
||||
export function registerPeer(...args: any) {
|
||||
registerService(
|
||||
args,
|
||||
{
|
||||
"defaultServiceId" : "peer",
|
||||
"functions" : [
|
||||
{
|
||||
"functionName" : "connect",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "id",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "multiaddrs",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "get_contact",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "peer",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "identify",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "is_connected",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "peer",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "timestamp_ms",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "timestamp_sec",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface OpDef {
|
||||
array: (a: string, b: string | null, c: string | null, d: string | null, callParams: CallParams<'a' | 'b' | 'c' | 'd'>) => string[] | Promise<string[]>;
|
||||
array_length: (array: string[], callParams: CallParams<'array'>) => number | Promise<number>;
|
||||
bytes_from_b58: (b: string, callParams: CallParams<'b'>) => number[] | Promise<number[]>;
|
||||
bytes_to_b58: (bs: number[], callParams: CallParams<'bs'>) => string | Promise<string>;
|
||||
concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null, callParams: CallParams<'a' | 'b' | 'c' | 'd'>) => string[] | Promise<string[]>;
|
||||
concat_strings: (a: string, b: string, callParams: CallParams<'a' | 'b'>) => string | Promise<string>;
|
||||
identity: (s: string | null, callParams: CallParams<'s'>) => string | null | Promise<string | null>;
|
||||
noop: (callParams: CallParams<null>) => void | Promise<void>;
|
||||
sha256_string: (s: string, callParams: CallParams<'s'>) => string | Promise<string>;
|
||||
string_from_b58: (b: string, callParams: CallParams<'b'>) => string | Promise<string>;
|
||||
string_to_b58: (s: string, callParams: CallParams<'s'>) => string | Promise<string>;
|
||||
}
|
||||
export function registerOp(service: OpDef): void;
|
||||
export function registerOp(serviceId: string, service: OpDef): void;
|
||||
export function registerOp(peer: FluencePeer, service: OpDef): void;
|
||||
export function registerOp(peer: FluencePeer, serviceId: string, service: OpDef): void;
|
||||
|
||||
|
||||
export function registerOp(...args: any) {
|
||||
registerService(
|
||||
args,
|
||||
{
|
||||
"defaultServiceId" : "op",
|
||||
"functions" : [
|
||||
{
|
||||
"functionName" : "array",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "a",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "b",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "c",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "d",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "array_length",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "array",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "bytes_from_b58",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "b",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "bytes_to_b58",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "bs",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "concat",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "a",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "b",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "c",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "d",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "concat_strings",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "a",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "b",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "identity",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "s",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "noop",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "void"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "sha256_string",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "s",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "string_from_b58",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "b",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "string_to_b58",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "s",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface KademliaDef {
|
||||
merge: (target: string, left: string[], right: string[], count: number | null, callParams: CallParams<'target' | 'left' | 'right' | 'count'>) => string[] | Promise<string[]>;
|
||||
neighborhood: (key: string, already_hashed: boolean | null, count: number | null, callParams: CallParams<'key' | 'already_hashed' | 'count'>) => string[] | Promise<string[]>;
|
||||
}
|
||||
export function registerKademlia(service: KademliaDef): void;
|
||||
export function registerKademlia(serviceId: string, service: KademliaDef): void;
|
||||
export function registerKademlia(peer: FluencePeer, service: KademliaDef): void;
|
||||
export function registerKademlia(peer: FluencePeer, serviceId: string, service: KademliaDef): void;
|
||||
|
||||
|
||||
export function registerKademlia(...args: any) {
|
||||
registerService(
|
||||
args,
|
||||
{
|
||||
"defaultServiceId" : "kad",
|
||||
"functions" : [
|
||||
{
|
||||
"functionName" : "merge",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "target",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "left",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "right",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "count",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "neighborhood",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "key",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "already_hashed",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "count",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface ScriptDef {
|
||||
add: (air_script: string, interval: string | null, callParams: CallParams<'air_script' | 'interval'>) => string | Promise<string>;
|
||||
list: (callParams: CallParams<null>) => { failures: number; id: string; interval: string; owner: string; src: string; } | Promise<{ failures: number; id: string; interval: string; owner: string; src: string; }>;
|
||||
remove: (script_id: string, callParams: CallParams<'script_id'>) => boolean | Promise<boolean>;
|
||||
}
|
||||
export function registerScript(service: ScriptDef): void;
|
||||
export function registerScript(serviceId: string, service: ScriptDef): void;
|
||||
export function registerScript(peer: FluencePeer, service: ScriptDef): void;
|
||||
export function registerScript(peer: FluencePeer, serviceId: string, service: ScriptDef): void;
|
||||
|
||||
|
||||
export function registerScript(...args: any) {
|
||||
registerService(
|
||||
args,
|
||||
{
|
||||
"defaultServiceId" : "script",
|
||||
"functions" : [
|
||||
{
|
||||
"functionName" : "add",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "air_script",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "interval",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "list",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "remove",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "script_id",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface DistDef {
|
||||
add_blueprint: (blueprint: { dependencies: string[]; name: string; }, callParams: CallParams<'blueprint'>) => string | Promise<string>;
|
||||
add_module: (wasm_b56_content: number[], conf: { name: string; }, callParams: CallParams<'wasm_b56_content' | 'conf'>) => string | Promise<string>;
|
||||
add_module_from_vault: (path: string, config: { name: string; }, callParams: CallParams<'path' | 'config'>) => string | Promise<string>;
|
||||
default_module_config: (module_name: string, callParams: CallParams<'module_name'>) => { name: string; } | Promise<{ name: string; }>;
|
||||
get_interface: (module_id: string, callParams: CallParams<'module_id'>) => { function_signatures: { arguments: string[][]; name: string; output_types: string[]; }[]; record_types: { fields: string[][]; id: number; name: string; }[]; } | Promise<{ function_signatures: { arguments: string[][]; name: string; output_types: string[]; }[]; record_types: { fields: string[][]; id: number; name: string; }[]; }>;
|
||||
list_blueprints: (callParams: CallParams<null>) => { dependencies: string[]; id: string; name: string; }[] | Promise<{ dependencies: string[]; id: string; name: string; }[]>;
|
||||
list_modules: (callParams: CallParams<null>) => { config: { name: string; }; hash: string; name: string; }[] | Promise<{ config: { name: string; }; hash: string; name: string; }[]>;
|
||||
make_blueprint: (name: string, dependencies: string[], callParams: CallParams<'name' | 'dependencies'>) => { dependencies: string[]; name: string; } | Promise<{ dependencies: string[]; name: string; }>;
|
||||
make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null, callParams: CallParams<'name' | 'mem_pages_count' | 'logger_enabled' | 'preopened_files' | 'envs' | 'mapped_dirs' | 'mounted_binaries' | 'logging_mask'>) => { name: string; } | Promise<{ name: string; }>;
|
||||
}
|
||||
export function registerDist(service: DistDef): void;
|
||||
export function registerDist(serviceId: string, service: DistDef): void;
|
||||
export function registerDist(peer: FluencePeer, service: DistDef): void;
|
||||
export function registerDist(peer: FluencePeer, serviceId: string, service: DistDef): void;
|
||||
|
||||
|
||||
export function registerDist(...args: any) {
|
||||
registerService(
|
||||
args,
|
||||
{
|
||||
"defaultServiceId" : "dist",
|
||||
"functions" : [
|
||||
{
|
||||
"functionName" : "add_blueprint",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "blueprint",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "add_module",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "wasm_b56_content",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "conf",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "add_module_from_vault",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "path",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "config",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "default_module_config",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "module_name",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "get_interface",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "module_id",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "list_blueprints",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "list_modules",
|
||||
"argDefs" : [
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "make_blueprint",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "name",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "dependencies",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"functionName" : "make_module_config",
|
||||
"argDefs" : [
|
||||
{
|
||||
"name" : "name",
|
||||
"argType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "mem_pages_count",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "logger_enabled",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "preopened_files",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "envs",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "mapped_dirs",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "mounted_binaries",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name" : "logging_mask",
|
||||
"argType" : {
|
||||
"tag" : "optional"
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType" : {
|
||||
"tag" : "primitive"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Functions
|
||||
|
@ -1,37 +0,0 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "value") [] value)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call node (service_id "add_one") [value] res)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
@ -1,45 +0,0 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "value") [] value)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "ns_tuples") [] ns_tuples)
|
||||
)
|
||||
(fold ns_tuples ns
|
||||
(par
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(xor
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call ns.$.node_id! (ns.$.service_id! "add_one") [value] $res)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("op" "identity") [$res.$.[2]!])
|
||||
)
|
||||
(call %init_peer_id% ("op" "noop") [])
|
||||
)
|
||||
(next ns)
|
||||
)
|
||||
)
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [$res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
@ -1,42 +0,0 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "payload") [] payload)
|
||||
)
|
||||
(fold payload vns
|
||||
(par
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(xor
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call vns.$.node_id! (vns.$.service_id! "add_one") [vns.$.value!] $res)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("op" "identity") [$res.$.[2]!])
|
||||
)
|
||||
(call %init_peer_id% ("op" "noop") [])
|
||||
)
|
||||
(next vns)
|
||||
)
|
||||
)
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [$res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
@ -1,58 +0,0 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "value") [] value)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "ns_tuples") [] ns_tuples)
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call ns_tuples.$.[0].node_id! (ns_tuples.$.[0].service_id! "add_one") [value] res1)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(xor
|
||||
(call ns_tuples.$.[1].node_id! (ns_tuples.$.[1].service_id! "add_one") [res1] res2)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(xor
|
||||
(call ns_tuples.$.[2].node_id! (ns_tuples.$.[2].service_id! "add_one") [res2] res3)
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res3])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 5])
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user