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