Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: standalone binaries #267

Merged
merged 3 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 62 additions & 5 deletions docs/src/getting-started/local-testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,72 @@

This guide will help you to setup a local parachain network using zombienet. At the end we will have three nodes: Alice, Bob and Charlie. Alice and Bob will be running Polkadot relay chain nodes as validators, and Charlie will be running a relay chain and parachain node. Charlie will be our contact point to the parachain network.

## Prerequisites
## Native Binaries

th7nder marked this conversation as resolved.
Show resolved Hide resolved
You can download our latest releases's binaries directly and run them on your machine without additional dependencies.
We support `Linux x86_64` and `MacOS ARM x64`. The commands below will download:
- [Relay Chain](https://github.com/paritytech/polkadot-sdk/releases) binaries (`polkadot`, `polkadot-prepare-worker`, `polkadot-execute-worker`),
- Polka Storage Parachain binary (`polka-storage-node`),
- [Polka Storage Provider](../storage-provider-cli/index.md) internal node (`polka-storage-provider`),
- [CLI for interacting with the parachain](../storagext-cli/) (`storagext-cli`),
- [zombienet](https://paritytech.github.io/zombienet/install.html) to spawn local testnets and orchestrate them (`zombienet`),
- Polka Storage Parachain out-of-the-box zombienet's configuration (`polka-storage-testnet.toml`).

### Linux x86_64

```bash
wget https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.13.0/polkadot
wget https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.13.0/polkadot-prepare-worker
wget https://github.com/paritytech/polkadot-sdk/releases/download/polkadot-v1.13.0/polkadot-execute-worker
wget https://s3.eu-central-1.amazonaws.com/polka-storage/linux_x86-64/polka-storage-node
wget https://s3.eu-central-1.amazonaws.com/polka-storage/linux_x86-64/polka-storage-provider
wget https://s3.eu-central-1.amazonaws.com/polka-storage/linux_x86-64/storagext-cli
wget https://github.com/paritytech/zombienet/releases/download/v1.3.106/zombienet-linux-x64 -O zombienet
chmod +x zombienet polka-storage-node polka-storage-provider storagext-cli polkadot polkadot-prepare-worker polkadot-execute-worker
export PATH=$(pwd):$PATH
jmg-duarte marked this conversation as resolved.
Show resolved Hide resolved

wget https://s3.eu-central-1.amazonaws.com/polka-storage/polka-storage-testnet.toml
zombienet -p native spawn polka-storage-testnet.toml
```

### MacOS ARM

```bash
wget https://s3.eu-central-1.amazonaws.com/polka-storage/macos_arm/polkadot
wget https://s3.eu-central-1.amazonaws.com/polka-storage/macos_arm/polkadot-prepare-worker
wget https://s3.eu-central-1.amazonaws.com/polka-storage/macos_arm/polkadot-execute-worker
wget https://s3.eu-central-1.amazonaws.com/polka-storage/macos_arm/polka-storage-node
wget https://s3.eu-central-1.amazonaws.com/polka-storage/macos_arm/polka-storage-provider
wget https://s3.eu-central-1.amazonaws.com/polka-storage/macos_arm/storagext-cli
wget https://github.com/paritytech/zombienet/releases/download/v1.3.106/zombienet-macos-arm64 -O zombienet
chmod +x zombienet polka-storage-node polka-storage-provider storagext-cli polkadot polkadot-prepare-worker polkadot-execute-worker
xattr -d com.apple.quarantine zombienet polka-storage-node polka-storage-provider storagext-cli polkadot polkadot-prepare-worker polkadot-execute-worker
export PATH=$(pwd):$PATH

wget https://s3.eu-central-1.amazonaws.com/polka-storage/polka-storage-testnet.toml
zombienet -p native spawn polka-storage-testnet.toml
```


You can easily access the parachain using the Polkadot.js Apps interface by clicking on this link:
[https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A42069#/explorer](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A42069#/explorer)
Or you can interact with the chain via [`storagext-cli`](../storagext-cli/index.md).
Example:
```bash
storagext-cli --sr25519-key "//Alice" storage-provider register Alice
```

## Kubernetes

### Prerequisites

- [zombienet v1.3.106](https://github.com/paritytech/zombienet/releases/tag/v1.3.106) - cli tool to easily spawn ephemeral Polkadot/Substrate networks and perform tests against them.
- [minikube](https://minikube.sigs.k8s.io/docs/start/) — to run the parachain nodes
- a configured [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) — used to setup the required kubernetes resources by `zombienet`
- [https://minikube.sigs.k8s.io/docs/handbook/kubectl/](https://minikube.sigs.k8s.io/docs/handbook/kubectl/)
- [https://kubernetes.io/docs/tasks/tools/#kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)

## Start up the Kubernetes cluster
### Start up the Kubernetes cluster

Using `minikube` you can start the cluster with the following command:

Expand All @@ -20,7 +77,7 @@ minikube start

You can read more about `minikube` in its [Getting Started](https://minikube.sigs.k8s.io/docs/handbook/controls/) page.

## Running the Parachain
### Running the Parachain

1. Create a `local-kube-testnet.toml` file on your machine with the following content.

Expand Down Expand Up @@ -118,7 +175,7 @@ zombienet -p kubernetes spawn local-kube-testnet.toml

</details>

## Verifying the Setup
### Verifying the Setup

Check if all zombienet pods were started successfully:

Expand All @@ -144,7 +201,7 @@ zombie-01b7920d650c18d3d78f75fd8b0978af temp-collator 0/1

</details>

## Accessing the Parachain
### Accessing the Parachain

You can easily access the parachain using the Polkadot.js Apps interface by clicking on this link:

Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
PROTOC = "${protobuf}/bin/protoc";
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library/";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
};
}
);
Expand Down