mirror of
https://github.com/fluencelabs/examples
synced 2025-04-25 02:32:16 +00:00
Intro 4: remove NewDist from process.aqua
This commit is contained in:
parent
2658b5918d
commit
2f4679ad01
@ -21,9 +21,9 @@
|
||||
}
|
||||
},
|
||||
"@fluencelabs/aqua-lib": {
|
||||
"version": "0.1.9",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.1.9.tgz",
|
||||
"integrity": "sha512-WLvwrH98R4BT7NHrzYkJE8f0G61BZi3lVog/W3pmyzYjufxTtxoAS28Zqycbt0ZVpUTfIC016QKu58b4SbhZWw=="
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-lib/-/aqua-lib-0.1.10.tgz",
|
||||
"integrity": "sha512-DB4fE4kqN6T3TcQLzgYuNnHZd2rT0MGQ6Yky/KXfy0HlH/xL2cYQHs0xctDwIRMytA7U3laYvyz7FWPc3wEiNg=="
|
||||
},
|
||||
"@fluencelabs/avm": {
|
||||
"version": "0.10.5",
|
||||
|
@ -29,7 +29,7 @@
|
||||
"@fluencelabs/aqua-ipfs": "^0.1.8",
|
||||
"@fluencelabs/fluence": "0.9.53",
|
||||
"@fluencelabs/fluence-network-environment": "1.0.10",
|
||||
"@fluencelabs/aqua-lib": "0.1.9",
|
||||
"@fluencelabs/aqua-lib": "0.1.10",
|
||||
"ipfs-http-client": "^50.1.2",
|
||||
"it-all": "^1.0.5",
|
||||
"uint8arrays": "^2.1.5",
|
||||
|
@ -8,24 +8,20 @@ alias Multiaddr : string
|
||||
alias Hash : string
|
||||
alias ServiceID : string
|
||||
|
||||
service NewDist("dist"):
|
||||
default_module_config(name: string) -> ModuleConfig
|
||||
add_module_from_vault(path: string, config: ModuleConfig) -> Hash
|
||||
|
||||
service NewOp("op"):
|
||||
concat_strings(a: string, b: string) -> string
|
||||
service StringOp("op"):
|
||||
-- function that wraps string in array
|
||||
array(s: string) -> []string
|
||||
|
||||
-- Add module to node
|
||||
func add_module(name: string, path: string) -> Hash:
|
||||
config <- NewDist.default_module_config(name)
|
||||
module_hash <- NewDist.add_module_from_vault(path, config)
|
||||
config <- Dist.default_module_config(name)
|
||||
module_hash <- Dist.add_module_from_vault(path, config)
|
||||
<- module_hash
|
||||
|
||||
-- Add service blueprint to node
|
||||
func add_blueprint(module_hash: Hash) -> string:
|
||||
prefixed_hash <- NewOp.concat_strings("hash:", module_hash)
|
||||
dependencies <- NewOp.array(prefixed_hash)
|
||||
prefixed_hash <- Op.concat_strings("hash:", module_hash)
|
||||
dependencies <- StringOp.array(prefixed_hash)
|
||||
blueprint <- Dist.make_blueprint("process_files", dependencies)
|
||||
blueprint_id <- Dist.add_blueprint(blueprint)
|
||||
<- blueprint_id
|
||||
|
Loading…
x
Reference in New Issue
Block a user