update from fldist to aqua

This commit is contained in:
boneyard93501 2022-02-11 22:47:58 -06:00
parent a3d0663e4c
commit 1579d77282
3 changed files with 66 additions and 41 deletions

View File

@ -742,62 +742,68 @@ After that IDEs will provide code completion for `marine_test_env`. In order to
In each of the examples we created modules and services configurations and tested and inspected them with the Marine REPL. Feels like we're all dressed up and nowhere to go. In this section we briefly discuss how to deploy our modules and configurations to the network as services using the *Greeting* example. In each of the examples we created modules and services configurations and tested and inspected them with the Marine REPL. Feels like we're all dressed up and nowhere to go. In this section we briefly discuss how to deploy our modules and configurations to the network as services using the *Greeting* example.
Before we begin, you need to have the `fldist` tool installed. See the [Tools documentation](https://doc.fluence.dev/docs/knowledge_tools) for more information. Before we begin, you need to have the `aqua` tool installed. See the [Tools documentation](https://doc.fluence.dev/docs/knowledge_tools) for more information.
We use the `fldist new_service` command to do our bidding: We use the `aqua dist deploy` command to do our bidding:
```zsh ```zsh
fldist new_service --help aqua dist deploy --help
fldist new_service
Create service from a list of modules Usage: aqua dist deploy [--timeout <integer>] [--log-level <string>] --addr <string> [--on <string>] [--print-air] [--sk <string>] --data-path <string> --service <string>
Options: Deploy a service onto a remote peer
--help Show help [boolean]
--version Show version number [boolean] Options and flags:
-v, --verbose Display verbose information such as created client --help
seed + peer Id and relay peer id Display this help text.
[boolean] [default: false] --timeout <integer>, -t <integer>
-s, --seed Client seed [string] Request timeout in milliseconds
--sk, --secret-key Clients ed25519 private key in base64 (32 byte) --log-level <string>
[string] Set log level
--env Environment to use --addr <string>, -a <string>
[required] [choices: "krasnodar", "local", "testnet", "stage"] [default: Relay multiaddress
"krasnodar"] --on <string>, -o <string>
--node-id, --node PeerId of the node to use Where function will be run. Default: host_peer_id
--node-addr Multiaddr of the node to use --print-air
--log log level Prints generated AIR code before function execution
[required] [choices: "trace", "debug", "info", "warn", "error"] [default: --sk <string>, -s <string>
"error"] Ed25519 32-byte secret key in base64
--ttl particle time to live in ms --data-path <string>, -p <string>
[number] [required] [default: 60000] Path to file with arguments map in JSON format
--ms, --modules array of path:config pairs; meaning <path to wasm --service <string>, -s <string>
module>:<path to config> [array] [required] What service from the config file to deploy
-n, --name name of the service; will be set in the blueprint
[string] [required]
``` ```
Aside from our modules and configuration, we also want to supply the peer id of the node we want to host our service. You cna find all available nodes on the [Fluence Dashboard](https://dash.fluence.dev/nodes). Please note that for all of our examples we will use peer `12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA`. Alternatively, we can deploy to a local node -- see [Deploy A Local Node](https://doc.fluence.dev/docs/tutorials_tutorials/tutorial_run_local_node) for instructions. Aside from our modules and configuration, we also want to supply the peer id of the node we want to host our service. You can find all available nodes on the [Fluence Dashboard](https://dash.fluence.dev/nodes). Please note that for all of our examples we will use peer `12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA`. Alternatively, we can deploy to a local node -- see [Deploy A Local Node](https://doc.fluence.dev/docs/tutorials_tutorials/tutorial_run_local_node) for instructions.
To create our greeting service on peer `12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA`: To create our greeting service on peer `12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA`:
```zsh ```zsh
fldist --node-id 12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA new_service \ aqua dist deploy \
--ms artifacts/greeting.wasm:configs/greeting_cfg.json \ --addr /dns4/kras-01.fluence.dev/tcp/19001/wss/p2p/12D3KooWKnEqMfYo9zvfHmqTLpLdiHXPe4SVqUWcWHDJdFGrSmcA
--name my-greeting-service --data-path configs/greeting_deploy_cfg.json \
--service my-greeting-service
``` ```
To recap the `fldist` command: We specify the To recap the `aqua dist deploy` command: We specify the
1. Peer id with the `node-id` flag 1. Peer id with the `addr` flag
2. Module and config file location with the `--ms` flag 2. Config file location with the `data-path` flag
3. Service name with the `--name` flag 3. Service name with the `service` flag
Which results in a success message and more importantly, the unique id for the deployed service: Which results in a success message and more importantly, the unique id for the deployed service:
```zsh ```bash
service id: 810b8abc-6b9d-4227-a228-a53145086464 Your peerId: 12D3KooWBVzSqoQqFycENVhw7W5RY1UHwPCn6U9iHG2mbwuCuLq3
service created successfully "Going to upload a module..."
2022.02.11 18:57:48 [INFO] created ipfs client to /ip4/178.128.194.190/tcp/5001
2022.02.11 18:57:48 [INFO] connected to ipfs
2022.02.11 18:57:50 [INFO] file uploaded
"Now time to make a blueprint..."
"Blueprint id:"
"8d210ec2b83e4c661c71820b79f02d99908794e8af8034b465762f61682bc43b"
"And your service id is:"
"ec71a1fc-66d7-41f4-bff1-f9c07d361bd4"
``` ```
The (peer id, service id) tuple is going to be useful once you start putting the service to work with, say, [Aqua](https://doc.fluence.dev/aqua-book/) and you should hold on the data for future use. Also, you can look up your service on the [Fluence Dashboard](https://dash.fluence.dev/blueprint/d67cdb81c416bff902e0b5847a39b84e2cb42d21dde6426de14bb75d1d61236d/). For more detailed information regarding the Fluence solution see the [Fluence documentation](https://doc.fluence.dev/docs/) and if you have any questions, comments or suggestions for improvements, please open create Issue or open a PR. The (peer id, service id) tuple is going to be useful once you start putting the service to work with, say, [Aqua](https://doc.fluence.dev/aqua-book/) and you should hold on the data for future use. Also, you can look up your service on the [Fluence Dashboard](https://dash.fluence.dev/blueprint/8d210ec2b83e4c661c71820b79f02d99908794e8af8034b465762f61682bc43b). For more detailed information regarding the Fluence solution see the [Fluence documentation](https://doc.fluence.dev) and if you have any questions, comments or suggestions for improvements, please open an Issue or PR.

View File

@ -1,3 +1,11 @@
{ {
"name": "call_parameters" "call_parameters": {
"modules": [
{
"name": "call_parameters",
"path": "./artifacts/call_parameters.wasm",
"logger_enabled": [true]
}
]
}
} }

View File

@ -0,0 +1,11 @@
{
"greeting": {
"modules": [
{
"name": "greeting",
"path": "./artifacts/greeting.wasm",
"logger_enabled": [true]
}
]
}
}