fix syntax highlighting

This commit is contained in:
folex 2021-04-21 14:36:43 +03:00
parent 9f2ce45f32
commit d6d8971695

View File

@ -26,7 +26,7 @@ Checks if there is a direct connection to the peer identified by a given PeerId
Example of a service call: Example of a service call:
```text ```clojure
(call node ("peer" "is_connected") ["123D..."] ok) (call node ("peer" "is_connected") ["123D..."] ok)
``` ```
@ -41,7 +41,7 @@ Initiates a connection to the specified peer
Example of a service call: Example of a service call:
```text ```clojure
(seq (seq
(call node ("op" "identity") ["/ip4/1.2.3.4/tcp/7777" "/ip4/1.2.3.4/tcp/9999"] addrs) (call node ("op" "identity") ["/ip4/1.2.3.4/tcp/7777" "/ip4/1.2.3.4/tcp/9999"] addrs)
(call node ("peer" "connect") ["123D..." addrs] ok) (call node ("peer" "connect") ["123D..." addrs] ok)
@ -56,7 +56,7 @@ Resolves the contact of a peer via [Kademlia](https://en.wikipedia.org/wiki/Kade
* _PeerId_ id of the target peer * _PeerId_ id of the target peer
* **Returns**: Contact - true if connection was successful * **Returns**: Contact - true if connection was successful
```text ```rust
// get_contact return struct // get_contact return struct
Contact { Contact {
peer_id: PeerId, peer_id: PeerId,
@ -66,7 +66,7 @@ Contact {
Example of a service call: Example of a service call:
```text ```clojure
(call node ("peer" "get_contact") ["123D..."] contact) (call node ("peer" "get_contact") ["123D..."] contact)
``` ```
@ -77,13 +77,13 @@ Get information about the peer
* **Arguments**: None * **Arguments**: None
* **Returns:** _external address_ * **Returns:** _external address_
```text ```json
{ "external_addresses": [ "/ip4/1.2.3.4/tcp/7777", "/dns4/stage.fluence.dev/tcp/19002" ] } { "external_addresses": [ "/ip4/1.2.3.4/tcp/7777", "/dns4/stage.fluence.dev/tcp/19002" ] }
``` ```
Example of service call: Example of service call:
```text ```clojure
(call node ("peer" "identify") [] info) peer timestamp_ms (call node ("peer" "identify") [] info) peer timestamp_ms
``` ```
@ -96,7 +96,7 @@ Get Unix timestamp in milliseconds
Example of service call: Example of service call:
```text ```clojure
(call node ("peer" "timestamp_ms") [] ts_ms) (call node ("peer" "timestamp_ms") [] ts_ms)
``` ```
@ -109,7 +109,7 @@ Get Unix timestamp in seconds
Example of service call: Example of service call:
```text ```clojure
(call node ("peer" "timestamp_sec") [] ts_sec) (call node ("peer" "timestamp_sec") [] ts_sec)
``` ```
@ -122,7 +122,7 @@ Instructs node to return the locally-known nodes in the Kademlia neighborhood fo
Example of service call: Example of service call:
```text ```clojure
(call node ("dht" "neighborhood") [key] peers) (call node ("dht" "neighborhood") [key] peers)
``` ```
@ -138,7 +138,7 @@ Used to create a service on a certain node.
Example of service call: Example of service call:
```text ```clojure
(call node ("srv" "create") [blueprint_id] service_id) (call node ("srv" "create") [blueprint_id] service_id)
``` ```
@ -151,7 +151,7 @@ Used to enumerate services deployed to a peer.
Example of service call: Example of service call:
```text ```clojure
(call node ("srv" "list") [] services) (call node ("srv" "list") [] services)
``` ```
@ -164,7 +164,7 @@ Adds an alias on service, so service could be called not only by service\_id but
Example of service call: Example of service call:
```text ```clojure
(call node ("srv" "add_alias") [alias service_id]) (call node ("srv" "add_alias") [alias service_id])
``` ```
@ -177,7 +177,7 @@ Retrieves the functional interface of a service running on the node specified in
* Argument: service\_id ID of the service whose interface you want to retrieve. * Argument: service\_id ID of the service whose interface you want to retrieve.
* Returns : an interface object of the following structure: * Returns : an interface object of the following structure:
```text ```typescript
{ {
interface: { function_signatures, record_types }, interface: { function_signatures, record_types },
blueprint_id: "uuid-1234...", blueprint_id: "uuid-1234...",
@ -187,7 +187,7 @@ Retrieves the functional interface of a service running on the node specified in
Example of service call: Example of service call:
```text ```clojure
(call node ("srv" "get_interface") [service_id] interface) (call node ("srv" "get_interface") [service_id] interface)
``` ```
@ -200,7 +200,7 @@ Used to add modules to the node specified in the service call.
* bytes a base64 string containing the .wasm module to add. * bytes a base64 string containing the .wasm module to add.
* config an object of the following structure * config an object of the following structure
```text ```json
{ {
"name": "my_module_name" "name": "my_module_name"
} }
@ -208,7 +208,7 @@ Used to add modules to the node specified in the service call.
Example of service call: Example of service call:
```text ```clojure
(call node ("dist" "add_module") [bytes config] hash) (call node ("dist" "add_module") [bytes config] hash)
``` ```
@ -219,7 +219,7 @@ Get a list of modules available on the node
* Arguments: None * Arguments: None
* Returns: an array of objects containing module descriptions * Returns: an array of objects containing module descriptions
```text ```json
[ [
{ {
"name": "moduleA", "name": "moduleA",
@ -231,7 +231,7 @@ Get a list of modules available on the node
Example of service call: Example of service call:
```text ```clojure
(call node ("dist" "list_modules") [] modules) (call node ("dist" "list_modules") [] modules)
``` ```
@ -242,7 +242,7 @@ Get the interface of a module
* Arguments: hash of a module * Arguments: hash of a module
* Returns: an interface of the module \( see _srv get\_interface \)_ mple of service call: * Returns: an interface of the module \( see _srv get\_interface \)_ mple of service call:
```text ```clojure
(call node ("dist" "get_interface") [hash] interface) (call node ("dist" "get_interface") [hash] interface)
``` ```
@ -252,7 +252,7 @@ Used to add a blueprint to the node specified in the service call.
* Arguments: blueprint an object of the following structure * Arguments: blueprint an object of the following structure
```text ```json
{ {
"name": "good_service", "name": "good_service",
"dependencies": [ "hash:6ebff28c...", "hash:1e59875a...", "hash:d164a07..." ] "dependencies": [ "hash:6ebff28c...", "hash:1e59875a...", "hash:d164a07..." ]
@ -265,7 +265,7 @@ Used to add a blueprint to the node specified in the service call.
Example of service call: Example of service call:
```text ```clojure
(call node ("dist" "add_blueprint") [blueprint] blueprint_id) (call node ("dist" "add_blueprint") [blueprint] blueprint_id)
``` ```
@ -278,7 +278,7 @@ Used to get the blueprints available on the node specified in the service call.
A blueprint is an object of the following structure: A blueprint is an object of the following structure:
```text ```json
{ {
"id": "uuid-1234-...", "id": "uuid-1234-...",
"name": "good_service", "name": "good_service",
@ -288,7 +288,7 @@ A blueprint is an object of the following structure:
Example of service call: Example of service call:
```text ```clojure
(call node ("dist" "list_blueprints") [] blueprints) (call node ("dist" "list_blueprints") [] blueprints)
``` ```
@ -313,7 +313,7 @@ Example of service call:
* With an interval parameter value _k_ passed as a string, the script executes every _k_ seconds \(21 in this case\) * With an interval parameter value _k_ passed as a string, the script executes every _k_ seconds \(21 in this case\)
```text ```clojure
(call node ("script" "add") [script "21"] id) (call node ("script" "add") [script "21"] id)
``` ```
@ -326,7 +326,7 @@ Removes recurring script from a node. Only a creator of the script can delete it
Example of service call: Example of service call:
```text ```clojure
(call node ("script" "remove") [script_id] result) (call node ("script" "remove") [script_id] result)
``` ```
@ -335,7 +335,7 @@ Example of service call:
* Arguments: None * Arguments: None
* Returns: A list of existing scripts on the node. Each object in the list is of the following structure: * Returns: A list of existing scripts on the node. Each object in the list is of the following structure:
```text ```json
{ {
"id": "uuid-1234-...", "id": "uuid-1234-...",
"src": "(seq (call ...", // "src": "(seq (call ...", //
@ -347,7 +347,7 @@ Example of service call:
Example of a service call: Example of a service call:
```text ```clojure
(call node ("script" "list") [] list) (call node ("script" "list") [] list)
``` ```
@ -357,7 +357,7 @@ Acts as an identity function. This service returns exactly what was passed to it
Example of service call: Example of service call:
```text ```clojure
(call node ("op" "identity") [args] result) (call node ("op" "identity") [args] result)
``` ```
@ -370,7 +370,7 @@ Used in service aliasing. ****Stores the specified service provider \(provider\)
* key a string; usually, it is a human-readable service alias. * key a string; usually, it is a human-readable service alias.
* provider the location of the service. It is an object of the following structure: * provider the location of the service. It is an object of the following structure:
```text ```json
{ {
"peer": "123D...", // PeerId of some peer in the network "peer": "123D...", // PeerId of some peer in the network
"service_id": "uuid-1234-..." // Optional service_id of the service running on the peer specified by peer "service_id": "uuid-1234-..." // Optional service_id of the service running on the peer specified by peer
@ -379,7 +379,7 @@ Used in service aliasing. ****Stores the specified service provider \(provider\)
Example of service call: Example of service call:
```text ```clojure
(call node ("deprecated" "add_provider") [key provider]) (call node ("deprecated" "add_provider") [key provider])
``` ```
@ -392,7 +392,7 @@ Used in service aliasing to retrieve providers for a given key.
* Arguments: _key_ a string; usually, it is a human-readable service alias. * Arguments: _key_ a string; usually, it is a human-readable service alias.
* Returns: an array of objects of the following structure: * Returns: an array of objects of the following structure:
```text ```json
{ {
"peer": "123D...", // required field "peer": "123D...", // required field
"service_id": "uuid-1234-..." // optional field "service_id": "uuid-1234-..." // optional field
@ -401,9 +401,6 @@ Used in service aliasing to retrieve providers for a given key.
Example of service call: Example of service call:
```text ```clojure
(call node ("deprecated" "get_providers") [key] providers) (call node ("deprecated" "get_providers") [key] providers)
``` ```