diff --git a/.gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (1).png b/.gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (3) (1).png similarity index 100% rename from .gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (1).png rename to .gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (3) (1).png diff --git a/.gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (2).png b/.gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (3) (2).png similarity index 100% rename from .gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (2).png rename to .gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (3) (2).png diff --git a/.gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3).png b/.gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (3) (3).png similarity index 100% rename from .gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3).png rename to .gitbook/assets/air_fold_4 (1) (2) (2) (3) (3) (3) (3) (3) (3) (3).png diff --git a/.gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (1).png b/.gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (3) (1).png similarity index 100% rename from .gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (1).png rename to .gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (3) (1).png diff --git a/.gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (2).png b/.gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (3) (2).png similarity index 100% rename from .gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (2).png rename to .gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (3) (2).png diff --git a/.gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3).png b/.gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (3) (3).png similarity index 100% rename from .gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3).png rename to .gitbook/assets/air_null_6 (1) (2) (2) (3) (3) (3) (3) (3) (3) (3).png diff --git a/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (1).png b/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (1).png similarity index 100% rename from .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (1).png rename to .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (1).png diff --git a/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (2).png b/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (2).png similarity index 100% rename from .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (2).png rename to .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (2).png diff --git a/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (3).png b/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (3).png similarity index 100% rename from .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (3).png rename to .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (3).png diff --git a/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4).png b/.gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (4).png similarity index 100% rename from .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4).png rename to .gitbook/assets/air_sequential_2 (1) (1) (1) (1) (1) (2) (3) (4) (4) (4) (4).png diff --git a/SUMMARY.md b/SUMMARY.md index 086dc88..02e5061 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -39,7 +39,7 @@ * [Tutorials](tutorials_tutorials/README.md) * [Deploy A Local Fluence Node](tutorials_tutorials/tutorial_run_local_node.md) * [Deploy A Private Fluence Network](tutorials_tutorials/running-a-fluence-network.md) - * [Add Your Own Builtin](tutorials_tutorials/add-your-own-builtin.md) + * [Add Your Own Node Native Service](tutorials_tutorials/add-your-own-builtin.md) * [TrustGraph In Action](tutorials_tutorials/tutorial_trustgraph.md) * [Securing Services](tutorials_tutorials/securing-services.md) * [Developing a Frontend Application with JS-SDK](tutorials_tutorials/developing-a-frontend-application-with-js-sdk.md) diff --git a/knowledge_knowledge/knowledge_aquamarine/hll/knowledge_aquamarine_air.md b/knowledge_knowledge/knowledge_aquamarine/hll/knowledge_aquamarine_air.md index 24d8bb8..af87768 100644 --- a/knowledge_knowledge/knowledge_aquamarine/hll/knowledge_aquamarine_air.md +++ b/knowledge_knowledge/knowledge_aquamarine/hll/knowledge_aquamarine_air.md @@ -23,7 +23,7 @@ AIR instructions are intended to launch the execution of a service method as fol 4. The arguments specified by the argument list are passed to the method 5. The result of the method returned under the name output name -**Figure 2: Sequential Instruction** ![Execution](../../../.gitbook/assets/air_sequential_2%20%281%29%20%281%29%20%281%29%20%281%29%20%281%29%20%282%29%20%283%29%20%284%29%20%282%29.png) +**Figure 2: Sequential Instruction** ![Execution](../../../.gitbook/assets/air_sequential_2%20%281%29%20%281%29%20%281%29%20%281%29%20%281%29%20%282%29%20%283%29%20%284%29%20%284%29%20%284%29%20%282%29.png) The _**seq**_ instruction takes two instructions at most as its arguments and executes them sequentially, one after the other. diff --git a/tutorials_tutorials/add-your-own-builtin.md b/tutorials_tutorials/add-your-own-builtin.md index 0e0b839..2bd8bb9 100644 --- a/tutorials_tutorials/add-your-own-builtin.md +++ b/tutorials_tutorials/add-your-own-builtin.md @@ -1,14 +1,48 @@ -# Add Your Own Builtin +--- +description: The Case For Node Native Services +--- +# Add Your Own Node Native Service +As discussed in the [Node](../knowledge_knowledge/node/knowledge_node_services.md) section, some service functionalities useful to a large audience. Such services and can be directly deployed to a peer node as a Wasm module. The remainder of this tutorial guides you through the steps necessary to create and submit a Node Native Service candidate. -If you want to have a service that available out-of-the-box with startup script and scheduled scripts, you can use `builtins deployer` feature. It will upload modules, deploy service, run init script and schedule others. -You should put your service files in the corresponding folder specified in config as `builtins_base_dir`. +In order to have a service available out-of-the-box with the necessary startup and scheduling scripts, we can take advantage of the Fluence [deployer feature](https://github.com/fluencelabs/fluence/tree/master/deploy) for Node native Services. This feature handles the complete deployment process including -### Builtins directory structure +* module uploads, +* service deployment, +* script initialization and scheduling + +Note that the deployment process is a fully automated workflow requiring you to merely submit your service assets in the appropriate structure as a PR to the appropriate GitHub repository. At this point you should have a solid grasp of creating service modules and their associated configuration files. See the [Developing Modules And Services](../development_development/) section for details. + +Our first step is fork the ??? repo by clicking on the Fork button, upper right of the repo webpage, and follow the instructions to create a local copy. In your local repo copy, checkout a new branch with a new, unique branch name: + +```text +git checkout -b MyBranchName +``` + +In your new branch create a new directory with the service name in the _builtin_ directory: + +```text +cd builtins +mkdir my-new-super-service +cd new-super-service +``` + + Replace my-_new-super-service_ with your service name. + +Now we can build and populate the required directory structure with your service assets. You should put your service files in the corresponding my-_new-super-service_ directory specified in config as `builtins_base_dir` **TODO: check if that applies to new repo approach.** + +Asset Requirements + +In order to deploy a builtin service, you need + +* the wasm files for each module as the module build +* the blueprint file for the service +* start and schedule scripts + +Just to recap, Blueprints capture module names, blueprint name, and blueprint id. -- builtins ```text --- builtins -- {service_alias} -- scheduled -- {script_name}_{interval_in_seconds}.air [optional]