Skip to content

Commit

Permalink
Updating documentation on cli.js location and 3rd party repo links (#…
Browse files Browse the repository at this point in the history
…1442)

* Updating cli.js location and name

* Updated comments

* Updated docs with new links to polkadot-sdk project

* Update docs/book/searchindex.js

* Update docs/book/searchindex.j

* Update README.md

Co-authored-by: Javier Viola <pepoviola@gmail.com>

* Update javascript/packages/cli/README.md

Co-authored-by: Javier Viola <pepoviola@gmail.com>

* Updated docs after review

* Updating docs after review v2

* Updating HTML

* Update javascript/README.md

* Update javascript/packages/orchestrator/README.md

* Update javascript/packages/orchestrator/README.md

---------

Co-authored-by: Nikos Kontakis <wirednkod@gmail.com>
Co-authored-by: Javier Viola <pepoviola@gmail.com>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent 87212d8 commit 5ad9359
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 138 deletions.
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ Internally zombienet is a `javascript` library, designed to run on `Node.js` and
backend `providers` to run the *nodes*, at this moment `kubernetes`, `podman` and `native` are
supported.

**Note:** Currently, it is only possible to use `podman` for Zombienet users on Linux machines.
Although `podman` comes with support for macOS, it is done using an internal VM and the Zombienet provider code expects `podman` to be running natively.

## Usage

Zombienet releases are available in `github`. Each one provides an executable for both `linux` and
Expand Down Expand Up @@ -120,7 +117,7 @@ Native provider doesn't run any extra layer/process at the moment.
*For this example we will use the `macos` version of the executable*

```bash
./zombienet-macos
./zombienet-macos
Usage: zombienet [options] [command]

Options:
Expand Down Expand Up @@ -178,7 +175,7 @@ id = 100
Then you can spawn the network by running the following command:

```bash
./zombienet-macos spawn --provider native examples/0001-small-network.toml
./zombienet-macos spawn --provider native examples/0001-small-network.toml
```

Note that the command expects two binaries `polkadot` and `adder-collator` to be installed on your system. See further down for how to get them.
Expand Down Expand Up @@ -266,8 +263,8 @@ add_to_genesis = false
Then you can `export` the needed values before you run the command to spawn the network again:

```bash
export ZOMBIENET_INTEGRATION_TEST_IMAGE=docker.io/paritypr/polkadot-debug:master
export COL_IMAGE=docker.io/paritypr/colander:master
export ZOMBIENET_INTEGRATION_TEST_IMAGE=docker.io/paritypr/polkadot-debug:master
export COL_IMAGE=docker.io/paritypr/colander:master

./zombienet-macos spawn examples/0001-small-network.toml
```
Expand All @@ -286,7 +283,7 @@ metrics, logs and some `built-in` function that query the network using `polkado
assertions should be defined in a *.zndsl test*, and the `dsl` (**D**omain **S**pecific **L**anguage) and format is documented in
[here](https://paritytech.github.io/zombienet/cli/test-dsl-definition-spec.html).

The following is an small example to spawn a network (using the previous `simple network
The following is a small example to spawn a network (using the previous `simple network
definition`) and assert that:
- Both `nodes` are running
- The defined `parachain` is registered
Expand Down Expand Up @@ -321,17 +318,17 @@ Other examples are provided in the [examples](examples) directory.
You need first to *clone* this repository and run:

```bash
cd zombienet/javascript
npm install
npm run build
cd zombienet/javascript
❯ npm i && npm run build
```

### Download and install needed artifacts (optional)

For an easier and faster setup of your local environment, run:

```bash
node dist/cli.js setup <binaries>
cd zombinet/javascript
❯ npm i && npm run zombie -- setup <binaries>
```

This allows to use the `setup` script, making everything ready for a ZombieNet dev environment.
Expand All @@ -343,10 +340,11 @@ You can use the following arguments:
For example:

```bash
node dist/cli.js setup polkadot polkadot-parachain
cd zombinet/javascript
❯ npm i && npm run zombie -- setup polkadot polkadot-parachain
```

> Note: If you are using macOS please clone the [Polkadot repo](https://github.com/paritytech/polkadot) and run it locally. At the moment there is no `polkadot` binary for MacOs.
> Note: If you are using macOS please clone the [polkadot-sdk repo](https://github.com/paritytech/polkadot-sdk) and run it locally. At the moment there is no `polkadot` binary for MacOs.
The command above will retrieve the binaries provided and try to download and prepare those binaries for usage.
At the end of the download, the `setup` script will provide a command to run in your local environment in order to add the directory where the binaries were downloaded in your $PATH var, for example:
Expand All @@ -360,10 +358,10 @@ Please add the dir to your $PATH by running the command: export PATH=/home/<user
You can build it from source like this

```bash
git clone git@github.com:paritytech/polkadot
cd polkadot
cargo build --profile testnet -p test-parachain-adder-collator
export PATH=$(pwd)/target/testnet:$PATH
git clone git@github.com:paritytech/polkadot-sdk.git
cd polkadot-sdk
cargo build --profile testnet -p test-parachain-adder-collator
export PATH=$(pwd)/target/testnet:$PATH
```


Expand All @@ -372,20 +370,26 @@ export PATH=$(pwd)/target/testnet:$PATH
With the above steps completed, the `zombienet` CLI is ready to run:

```bash
❯ node dist/cli.js
cd zombinet/javascript
❯ npm run zombie

Usage: zombienet [options] [command]

Options:
-p, --provider <provider> Override provider to use (choices: "podman",
"kubernetes", default: kubernetes)
-c, --spawn-concurrency <concurrency> Number of concurrent spawning process to launch, default is 1
-p, --provider <provider> Override provider to use (choices: "podman", "kubernetes", "native")
-l, --logType <logType> Type of logging - defaults to 'table' (choices: "table", "text", "silent")
-d, --dir <path> Directory path for placing the network files instead of random temp one
(e.g. -d /home/user/my-zombienet)
-f, --force Force override all prompt commands
-h, --help display help for command

Commands:
spawn <networkConfig> [creds] [monitor] Spawn the network defined in the config
test <testFile> Run tests on the network defined
spawn [options] <networkConfig> [creds] Spawn the network defined in the config
test <testFile> [runningNetworkSpec] Run tests on the network defined
setup [options] <binaries...> Setup is meant for downloading and making dev environment of ZombieNet ready
convert <filePath> Convert is meant for transforming a (now deprecated) polkadot-launch configuration to zombienet configuration
version Prints zombienet version
setup Runs the setup of local environment
help [command] display help for command
```

Expand Down
33 changes: 22 additions & 11 deletions docs/book/development.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,42 +155,53 @@ <h2 id="requirements"><a class="header" href="#requirements">Requirements</a></h
</ul>
<h2 id="installation"><a class="header" href="#installation">Installation</a></h2>
<p>You need to first <em>clone</em> this repository and run:</p>
<pre><code class="language-bash">cd zombienet
npm install
npm run build
<pre><code class="language-bash">❯ cd zombienet
❯ npm i && npm run build
</code></pre>
<h3 id="download-and-install-needed-artifacts-optional"><a class="header" href="#download-and-install-needed-artifacts-optional">Download and install needed artifacts (optional)</a></h3>
<p>For an easier and faster setup of your local environment, run:</p>
<pre><code class="language-bash">node dist/cli.js setup &lt;binaries&gt;
<pre><code class="language-bash">❯ cd zombinet/javascript && npm i && npm run zombie -- setup &lt;binaries&gt;
</code></pre>
<p>This allows to use the <code>setup</code> script, making everything ready for a ZombieNet dev environment.</p>
<p>You can use the following arguments:</p>
<p><code>--help</code> shows the different options and commands for using the Zombienet CLI.
<code>--binaries</code> or <code>-b</code>: enables providing the binaries that you want to be downloaded and installed during the setup. Possible options: <code>polkadot</code>, <code>polkadot-parachain</code>.</p>
<p>For example:</p>
<pre><code class="language-bash">node dist/cli.js setup polkadot polkadot-parachain
<pre><code class="language-bash">❯ cd zombinet/javascript && npm i && npm run zombie -- setup polkadot polkadot-parachain
</code></pre>
<blockquote>
<p>Note: If you are using macOS please clone the <a href="https://github.com/paritytech/polkadot">Polkadot repo</a> and run it locally. At the moment there is no <code>polkadot</code> binary for MacOs.</p>
<p>Note: If you are using macOS please clone the <a href="https://github.com/paritytech/polkadot-sdk">polkadot-sdk repo</a> and run it locally. At the moment there is no <code>polkadot</code> binary for MacOs.</p>
</blockquote>
<p>The command above will retrieve the binaries provided and try to download and prepare those binaries for usage.
At the end of the download, the <code>setup</code> script will provide a command to run in your local environment in order to add the directory where the binaries were downloaded in your $PATH var, for example:</p>
<pre><code class="language-bash">Please add the dir to your $PATH by running the command: export PATH=/home/&lt;user&gt;/current_directory:$PATH
</code></pre>
<h3 id="using-zombienet"><a class="header" href="#using-zombienet">Using Zombienet</a></h3>
<p>With the above steps completed, the <code>zombienet</code> CLI is ready to run:</p>
<pre><code class="language-bash">node dist/cli.js
<pre><code class="language-bash">cd zombinet/javascript && npm run zombie

Usage: zombienet [options] [command]

Options:
-c, --spawn-concurrency &lt;concurrency&gt; Number of concurrent spawning process to launch,
default is 1
-p, --provider &lt;provider&gt; Override provider to use (choices: &quot;podman&quot;,
&quot;kubernetes&quot;, default: kubernetes)
-h, --help display help for command
&quot;kubernetes&quot;, &quot;native&quot;)
-l, --logType &lt;logType&gt; Type of logging - defaults to &quot;table&quot;
(choices: &quot;table&quot;, &quot;text&quot;, &quot;silent&quot;)
-d, --dir &lt;path&gt; Directory path for placing the network files instead of random temp one
(e.g. -d /home/user/my-zombienet)
-f, --force Force override all prompt commands
-h, --help Display help for command

Commands:
spawn &lt;networkConfig&gt; [creds] [monitor] Spawn the network defined in the config
test &lt;testFile&gt; Run tests on the network defined
spawn [options] &lt;networkConfig&gt; [creds] Spawn the network defined in the config
test &lt;testFile&gt; [runningNetworkSpec] Run tests on the network defined
setup [options] &lt;binaries...&gt; Setup is meant for downloading and making
dev environment of ZombieNet ready
convert &lt;filePath&gt; Convert is meant for transforming a
(now deprecated) polkadot-launch configuration
to zombienet configuration
version Prints zombienet version
help [command] display help for command
</code></pre>
Expand Down
30 changes: 21 additions & 9 deletions docs/book/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ <h3 id="download-and-install-needed-artifacts-optional">
<p>
For an easier and faster setup of your local environment, run:
</p>
<pre><code class="language-bash">node dist/cli.js setup &lt;binaries&gt;
<pre><code class="language-bash">❯ cd zombinet/javascript && npm i && npm run zombie -- setup &lt;binaries&gt;
</code></pre>
<p>
This allows to use the <code>setup</code> script, making
Expand All @@ -1705,13 +1705,13 @@ <h3 id="download-and-install-needed-artifacts-optional">
<code>polkadot</code>, <code>polkadot-parachain</code>.
</p>
<p>For example:</p>
<pre><code class="language-bash">node dist/cli.js setup polkadot polkadot-parachain
<pre><code class="language-bash">❯ cd zombinet/javascript && npm i && npm run zombie -- setup polkadot polkadot-parachain
</code></pre>
<blockquote>
<p>
Note: If you are using macOS please clone the
<a href="https://github.com/paritytech/polkadot"
>Polkadot repo</a
<a href="https://github.com/paritytech/polkadot-sdk"
>polkadot-sdk repo</a
>
and run it locally. At the moment there is no
<code>polkadot</code> binary for MacOs.
Expand All @@ -1733,18 +1733,30 @@ <h3 id="using-zombienet">
With the above steps completed, the <code>zombienet</code> CLI is
ready to run:
</p>
<pre><code class="language-bash">node dist/cli.js
<pre><code class="language-bash">cd zombinet/javascript && npm run zombie

Usage: zombienet [options] [command]

Options:
-c, --spawn-concurrency &lt;concurrency&gt; Number of concurrent spawning process to launch,
default is 1
-p, --provider &lt;provider&gt; Override provider to use (choices: &quot;podman&quot;,
&quot;kubernetes&quot;, default: kubernetes)
-h, --help display help for command
&quot;kubernetes&quot;, &quot;native&quot;)
-l, --logType &lt;logType&gt; Type of logging - defaults to &quot;table&quot;
(choices: &quot;table&quot;, &quot;text&quot;, &quot;silent&quot;)
-d, --dir &lt;path&gt; Directory path for placing the network files instead of random temp one
(e.g. -d /home/user/my-zombienet)
-f, --force Force override all prompt commands
-h, --help Display help for command

Commands:
spawn &lt;networkConfig&gt; [creds] [monitor] Spawn the network defined in the config
test &lt;testFile&gt; Run tests on the network defined
spawn [options] &lt;networkConfig&gt; [creds] Spawn the network defined in the config
test &lt;testFile&gt; [runningNetworkSpec] Run tests on the network defined
setup [options] &lt;binaries...&gt; Setup is meant for downloading and making
dev environment of ZombieNet ready
convert &lt;filePath&gt; Convert is meant for transforming a
(now deprecated) polkadot-launch configuration
to zombienet configuration
version Prints zombienet version
help [command] display help for command
</code></pre>
Expand Down
4 changes: 2 additions & 2 deletions docs/book/searchindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ Object.assign(window.search, {
title: "Installation",
},
37: {
body: "For an easier and faster setup of your local environment, run: node dist/cli.js setup <binaries> This allows to use the setup script, making everything ready for a ZombieNet dev environment. You can use the following arguments: --help shows the different options and commands for using the Zombienet CLI. --binaries or -b: enables providing the binaries that you want to be downloaded and installed during the setup. Possible options: polkadot, polkadot-parachain. For example: node dist/cli.js setup polkadot polkadot-parachain Note: If you are using macOS please clone the Polkadot repo and run it locally. At the moment there is no polkadot binary for MacOs. The command above will retrieve the binaries provided and try to download and prepare those binaries for usage. At the end of the download, the setup script will provide a command to run in your local environment in order to add the directory where the binaries were downloaded in your $PATH var, for example: Please add the dir to your $PATH by running the command: export PATH=/home/<user>/current_directory:$PATH",
body: "For an easier and faster setup of your local environment, run: cd zombinet/javascript && npm i && npm run zombie -- setup <binaries> This allows to use the setup script, making everything ready for a ZombieNet dev environment. You can use the following arguments: --help shows the different options and commands for using the Zombienet CLI. --binaries or -b: enables providing the binaries that you want to be downloaded and installed during the setup. Possible options: polkadot, polkadot-parachain. For example: cd zombinet/javascript && npm i && npm run zombie -- setup polkadot polkadot-parachain Note: If you are using macOS please clone the polkadot-sdk repo and run it locally. At the moment there is no polkadot binary for MacOs. The command above will retrieve the binaries provided and try to download and prepare those binaries for usage. At the end of the download, the setup script will provide a command to run in your local environment in order to add the directory where the binaries were downloaded in your $PATH var, for example: Please add the dir to your $PATH by running the command: export PATH=/home/<user>/current_directory:$PATH",
breadcrumbs:
"Development » Download and install needed artifacts (optional)",
id: "37",
title: "Download and install needed artifacts (optional)",
},
38: {
body: 'With the above steps completed, the zombienet CLI is ready to run: ❯ node dist/cli.js Usage: zombienet [options] [command] Options: -p, --provider <provider> Override provider to use (choices: "podman", "kubernetes", default: kubernetes) -h, --help display help for command Commands: spawn <networkConfig> [creds] [monitor] Spawn the network defined in the config test <testFile> Run tests on the network defined version Prints zombienet version help [command] display help for command',
body: 'With the above steps completed, the zombienet CLI is ready to run: cd zombinet/javascript && npm i && npm run zombie -- Usage: zombienet [options] [command] Options: -c, --spawn-concurrency <concurrency> Number of concurrent spawning process to launch, default is 1 -p, --provider <provider> Override provider to use (choices: "podman", "kubernetes", "native") -l, --logType <logType> Type of logging - defaults to "table" (choices: "table", "text", "silent") -d, --dir <path> Directory path for placing the network files instead of random temp one -f, --force Force override all prompt commands -h, --help display help for command Commands: spawn [options] <networkConfig> [creds] Spawn the network defined in the config test <testFile> [runningNetworkSpec] Run tests on the network defined setup [options] <binaries...> Setup is meant for downloading and making dev environment of ZombieNet ready convert <filePath> Convert is meant for transforming a (now deprecated) polkadot-launch configuration to zombienet configuration version Prints zombienet version help [command] display help for command',
breadcrumbs: "Development » Using Zombienet",
id: "38",
title: "Using Zombienet",
Expand Down
Loading

0 comments on commit 5ad9359

Please sign in to comment.