Skip to content

Commit

Permalink
Merge pull request #212 from kinode-dao/hf/boot-real-node
Browse files Browse the repository at this point in the history
add boot-real-node
  • Loading branch information
nick1udwig authored Jun 5, 2024
2 parents 7c2a054 + 37720f4 commit d429614
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/kit/boot-fake-node.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# `kit boot-fake-node`

`kit boot-fake-node` starts a "fake" node connected to a "fake" chain (i.e. not connected to the live network) , e.g.,
`kit boot-fake-node` starts a "fake" node connected to a "fake" chain (i.e. not connected to the live network), e.g.,

```
kit boot-fake-node
```

By default, `boot-fake-node` fetches a prebuilt binary and launches the node using it.
Alternatively, `boot-fake-node` can use a local binary or build a local Kinode core repo and use the resulting binary.
Alternatively, `boot-fake-node` can build a local Kinode core repo and use the resulting binary.

It also boots a fake chain with [anvil](https://book.getfoundry.sh/anvil/) in the background (see [kit chain](../kit/chain.md)).
The fake chain comes preseeded with two contracts: KNS, which nodes use to index networking info of other nodes; and app_store, which nodes use to index published packages.
It also boots a fake chain with [`anvil`](https://book.getfoundry.sh/anvil/) in the background (see [`kit chain`](../kit/chain.md)).
The fake chain comes preseeded with two contracts: KNS, which nodes use to index networking info of other nodes; and `app_store`, which nodes use to index published packages.

## Example Usage

Expand Down Expand Up @@ -54,13 +54,13 @@ Usage: kit boot-fake-node [OPTIONS]
Options:
-r, --runtime-path <PATH>
Path to Kinode core repo or runtime binary (overrides --version)
Path to Kinode core repo (overrides --version)
-v, --version <VERSION>
Version of Kinode binary to use (overridden by --runtime-path) [default: latest] [possible values: latest, v0.7.4, v0.7.3, v0.7.2]
-p, --port <NODE_PORT>
The port to run the fake node on [default: 8080]
-o, --home <HOME>
Where to place the home directory for the fake node [default: /tmp/kinode-fake-node]
Path to home directory for fake node [default: /tmp/kinode-fake-node]
-f, --fake-node-name <NODE_NAME>
Name for fake node [default: fake.dev]
-c, --fakechain-port <FAKECHAIN_PORT>
Expand All @@ -83,7 +83,7 @@ Options:

short: `-r`

Pass to boot a fake node from a local binary or build a local Kinode core repo and use the resulting binary, e.g.
Pass to build a local Kinode core repo and use the resulting binary to boot a fake node, e.g.

```
kit boot-fake-node --runtime-path ~/git/kinode
Expand All @@ -110,7 +110,7 @@ Run the fake node on this port; defaults to `8080`.

short: `-o`

Path to place fake node home directory at; defaults to `/tmp/kinode-fake-node`.
Path to home directory for fake node; defaults to `/tmp/kinode-fake-node`.

### `--fake-node-name`

Expand Down
95 changes: 95 additions & 0 deletions src/kit/boot-real-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# `kit boot-real-node`

`kit boot-real-node` starts a Kinode connected to the live network, e.g.,

```
kit boot-real-node
```

By default, `boot-real-node` fetches a prebuilt binary and launches the node using it.
Alternatively, `boot-real-node` can build a local Kinode core repo and use the resulting binary.

## Example Usage

You can create a new node, creating a home directory at, e.g., `~/<my-new-node-name>.os`, using

```
kit boot-real-node --home ~/<my-new-node-name>.os
```

or you can boot an existing node with home directory at, e.g., `~/<my-old-node-name>.os`, using

```
kit boot-real-node --home ~/<my-old-node-name>.os
```

## Discussion

`kit boot-real-node` makes it easier to run a node by reducing the number of steps to download the Kinode core binary and launch a node.
Be cautious using `boot-real-node` before Kinode core `1.0.0` launch without specifying the `--version` flag: the default `--version latest` may use a new major version of Kinode core!

## Arguments

```
$ kit boot-real-node --help
Boot a real node
Usage: kit boot-real-node [OPTIONS] --home <HOME>
Options:
-r, --runtime-path <PATH> Path to Kinode core repo or runtime binary (overrides --version)
-v, --version <VERSION> Version of Kinode binary to use (overridden by --runtime-path) [default: latest] [possible values: latest, v0.7.4, v0.7.3, v0.7.2]
-p, --port <NODE_PORT> The port to run the real node on [default: 8080]
-o, --home <HOME> Path to home directory for real node
--rpc <RPC_ENDPOINT> Ethereum RPC endpoint (wss://)
--release If set and given --runtime-path, compile release build [default: debug build]
--verbosity <VERBOSITY> Verbosity of node: higher is more verbose [default: 0]
-h, --help Print help
```

### `--runtime-path`

short: `-r`

Pass to build a local Kinode core repo and use the resulting binary to boot a real node, e.g.

```
kit boot-real-node --runtime-path ~/git/kinode
```

for a system with the Kinode core repo living at `~/git/kinode`.

Overrides `--version`.

### `--version`

short: `-v`

Fetch and run a specific version of the binary; defaults to most recent version.
Overridden by `--runtime-path`.

### `--port`

short: `-p`

Run the real node on this port; defaults to `8080`.

### `--home`

short: `-o`

Required field.
Path to home directory for real node.

### `--rpc`

The Ethereum RPC endpoint to use, if desired.

### `--release`

If `--runtime-path` is given, build the runtime for release; default is debug.
The tradeoffs between the release and default version are described [here](https://doc.rust-lang.org/book/ch01-03-hello-cargo.html?highlight=release#building-for-release).

### `--verbosity`

Set the verbosity of the node; higher is more verbose; default is `0`, max is `3`.

0 comments on commit d429614

Please sign in to comment.