Skip to content

Commit

Permalink
Oct-06 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ImmaZoni committed Oct 21, 2022
1 parent 9770865 commit 9ae8b79
Show file tree
Hide file tree
Showing 10 changed files with 1,128 additions and 237 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^2.0.1",
"@docusaurus/plugin-content-docs": "^2.0.1",
"@docusaurus/plugin-google-gtag": "^2.0.1",
"@docusaurus/plugin-sitemap": "^2.0.1",
"@docusaurus/preset-classic": "^2.0.1",
"@docusaurus/core": "^2.1.0",
"@docusaurus/plugin-content-docs": "^2.1.0",
"@docusaurus/plugin-google-gtag": "^2.1.0",
"@docusaurus/plugin-sitemap": "^2.1.0",
"@docusaurus/preset-classic": "^2.1.0",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"docusaurus-plugin-remote-content": "^3.0.0",
Expand Down
85 changes: 27 additions & 58 deletions protocol/farm/farming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ import TabItem from '@theme/TabItem';
import Link from '@docusaurus/Link';
import styles from '@site/src/pages/index.module.css';

:::caution
### Update from earlier versions of Gemini 1b
There were some issues in initial Gemini 1b release `gemini-1b-2022-june-02` fixed by later releases.

If you see any of these errors:
- `Node is running on non-canonical fork, full node and farmer reset is required`
- `Attempt to switch to a different fork beyond archiving depth, can't do it...`

That means your node is affected, and you need to follow "Switching to a new snapshot" section below to reset your node and farmer.

:::

## I. Pre-requisites

---
Expand Down Expand Up @@ -58,28 +46,9 @@ The address of your account will be necessary at the last step.
For help refer to our forum post [How to setup Subwallet & a Polkadot.js Wallet](https://forum.subspace.network/t/subspace-wallet/61)
- *make sure to follow the Bonus section of the bottom of the post above.*

### C. Archival or Full Node?
:::danger Please see [GitHub Issue #555](https://github.com/subspace/subspace/issues/555)
There is was a bug in prior versions. If you were running a version prior, and would like to switch to a Full Node, you will need to follow the [wipe & purge](#wipe--purge) instructions.
:::

Before starting your node you will want to decide if you are going to run an Archival or Full node.

**Full Node:** This will only keep the last 1024 blocks. As a result the node will take up significantly less space, leaving more space for farming plot.
**Archival Node:** This will keep the full history of the network on your device. As a result the node will take up more space and continue to grow.
- Running an archival node will significantly help new users trying to sync the network.
- Archival nodes are also helpful if you want to run your node as an RPC node for historical queries etc.

The default instructions below will assume you would like to be a full node. If you would like to run an Archival node remove the following parameters from your node command.
- `--pruning 1024`
- `--keep-blocks 1024`

And instead add this:
- `--pruning archive`

> NOTE: You can't switch between full and archival node without wiping it, so if you need that, follow steps in the [Wipe & Purge](#wipe--purge) section.

### D. Required ports

Currently, TCP port `30333` needs to be exposed for node to work properly.

If you have a server with no firewall, there is nothing to be done, but otherwise make sure to open TCP port `30333` for incoming connections.
Expand Down Expand Up @@ -128,7 +97,7 @@ We will be downloading two files for your respective operating system.
services:
node:
# For running on Aarch64 add `-aarch64` after `DATE`
image: ghcr.io/subspace/node:gemini-2a-2022-sep-10
image: ghcr.io/subspace/node:gemini-2a-2022-oct-06
volumes:
# Instead of specifying volume (which will store data in `/var/lib/docker`), you can
# alternatively specify path to the directory where files will be stored, just make
Expand Down Expand Up @@ -164,7 +133,7 @@ We will be downloading two files for your respective operating system.
node:
condition: service_healthy
# For running on Aarch64 add `-aarch64` after `DATE`
image: ghcr.io/subspace/farmer:gemini-2a-2022-sep-10
image: ghcr.io/subspace/farmer:gemini-2a-2022-oct-06
volumes:
# Instead of specifying volume (which will store data in `/var/lib/docker`), you can
# alternatively specify path to the directory where files will be stored, just make
Expand Down Expand Up @@ -213,17 +182,17 @@ We will be downloading two files for your respective operating system.
<div className={styles.buttons}>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-node-windows-x86_64-gemini-2a-2022-sep-10.exe">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-node-windows-x86_64-gemini-2a-2022-oct-06.exe">
Download Node Executable
</Link>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-farmer-windows-x86_64-gemini-2a-2022-sep-10.exe">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-farmer-windows-x86_64-gemini-2a-2022-oct-06.exe">
Download Farmer Executable
</Link>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-farmer-opencl-windows-x86_64-gemini-2a-2022-sep-10.exe">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-farmer-opencl-windows-x86_64-gemini-2a-2022-oct-06.exe">
Download Farmer Executable (OpenCL)
</Link>
</div>
Expand All @@ -244,7 +213,7 @@ We will be downloading two files for your respective operating system.
```PowerShell
# Replace `INSERT_YOUR_ID` with a nickname you choose
# Copy all of the lines below, they are all part of the same command
.\subspace-node-windows-x86_64-gemini-2a-2022-sep-10.exe `
.\subspace-node-windows-x86_64-gemini-2a-2022-oct-06.exe `
--chain gemini-2a `
--execution wasm `
--state-pruning archive `
Expand Down Expand Up @@ -275,10 +244,10 @@ We will be downloading two files for your respective operating system.
```
5. After running this command, Windows may ask you for permissions related to firewall, select `allow` in this case.
6. We will then open another terminal, change to the downloads directory, then start the farmer node with the following command:
*Change command to feature `subspace-farmer-opencl-windows-x86_64-gemini-2a-2022-sep-10.exe` if using Open CL version.*
*Change command to feature `subspace-farmer-opencl-windows-x86_64-gemini-2a-2022-oct-06.exe` if using Open CL version.*
```PowerShell
# Replace `WALLET_ADDRESS` below with your account address from Polkadot.js wallet
.\subspace-farmer-windows-x86_64-gemini-2a-2022-sep-10.exe farm `
.\subspace-farmer-windows-x86_64-gemini-2a-2022-oct-06.exe farm `
--reward-address WALLET_ADDRESS `
--plot-size 100G
```
Expand Down Expand Up @@ -308,12 +277,12 @@ We will be downloading two files for your respective operating system.
<div className={styles.buttons}>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-node-macos-x86_64-gemini-2a-2022-sep-10.zip">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-node-macos-x86_64-gemini-2a-2022-oct-06.zip">
Download Node Executable
</Link>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-farmer-macos-x86_64-gemini-2a-2022-sep-10.zip">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-farmer-macos-x86_64-gemini-2a-2022-oct-06.zip">
Download Farmer Executable
</Link>
</div>
Expand All @@ -328,8 +297,8 @@ We will be downloading two files for your respective operating system.

1. Open your favorite terminal, and change to the Downloads directory using `cd Downloads`
2. Make the farmer & node executable:
- `chmod +x subspace-farmer-macos-x86_64-gemini-2a-2022-sep-10`
- `chmod +x subspace-node-macos-x86_64-gemini-2a-2022-sep-10`
- `chmod +x subspace-farmer-macos-x86_64-gemini-2a-2022-oct-06`
- `chmod +x subspace-node-macos-x86_64-gemini-2a-2022-oct-06`
3. We will then start the node using the following command

> *Note, when attempting to run this command you may be prompted:* Click on `cancel` instead of moving it to trash.
Expand All @@ -339,7 +308,7 @@ We will be downloading two files for your respective operating system.
```bash
# Replace `INSERT_YOUR_ID` with a nickname you choose
# Copy all of the lines below, they are all part of the same command
./subspace-node-macos-x86_64-gemini-2a-2022-sep-10 \
./subspace-node-macos-x86_64-gemini-2a-2022-oct-06 \
--chain gemini-2a \
--execution wasm \
--state-pruning archive \
Expand Down Expand Up @@ -371,7 +340,7 @@ We will be downloading two files for your respective operating system.
5. We will then open another terminal, change to the downloads directory, then start the farmer node with the following command:
```bash
# Replace `WALLET_ADDRESS` below with your account address from Polkadot.js wallet
./subspace-farmer-macos-x86_64-gemini-2a-2022-sep-10 farm \
./subspace-farmer-macos-x86_64-gemini-2a-2022-oct-06 farm \
--reward-address WALLET_ADDRESS \
--plot-size 100G
```
Expand Down Expand Up @@ -403,17 +372,17 @@ We will be downloading two files for your respective operating system.
<div className={styles.buttons}>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-node-ubuntu-x86_64-gemini-2a-2022-sep-10">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-node-ubuntu-x86_64-gemini-2a-2022-oct-06">
Download Node Executable
</Link>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-farmer-ubuntu-x86_64-gemini-2a-2022-sep-10">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-farmer-ubuntu-x86_64-gemini-2a-2022-oct-06">
Download Farmer Executable
</Link>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-farmer-opencl-ubuntu-x86_64-gemini-2a-2022-sep-10">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-farmer-opencl-ubuntu-x86_64-gemini-2a-2022-oct-06">
Download Farmer Executable (OpenCL)
</Link>
</div>
Expand All @@ -430,12 +399,12 @@ We will be downloading two files for your respective operating system.
<div className={styles.buttons}>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-node-ubuntu-aarch64-gemini-2a-2022-sep-10">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-node-ubuntu-aarch64-gemini-2a-2022-oct-06">
1. Download Node Executable
</Link>
<Link
className="button button--secondary button"
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-sep-10/subspace-farmer-ubuntu-aarch64-gemini-2a-2022-sep-10">
to="https://github.com/subspace/subspace/releases/download/gemini-2a-2022-oct-06/subspace-farmer-ubuntu-aarch64-gemini-2a-2022-oct-06">
2. Download Farmer Executable
</Link>
</div>
Expand Down Expand Up @@ -463,15 +432,15 @@ We will be downloading two files for your respective operating system.
---
1. Open your favorite terminal, and change to the Downloads directory using `cd Downloads`
2. Make the farmer & node executable
- `chmod +x subspace-farmer-ubuntu-x86_64-gemini-2a-2022-sep-10`
- `chmod +x subspace-node-ubuntu-x86_64-gemini-2a-2022-sep-10`
- `chmod +x subspace-farmer-ubuntu-x86_64-gemini-2a-2022-oct-06`
- `chmod +x subspace-node-ubuntu-x86_64-gemini-2a-2022-oct-06`
3. We will then start the node using the following command

```bash
# Replace `NODE_FILE_NAME` with the name of the node file you downloaded from releases
# Replace `INSERT_YOUR_ID` with a nickname you choose
# Copy all of the lines below, they are all part of the same command
./subspace-node-ubuntu-x86_64-gemini-2a-2022-sep-10 \
./subspace-node-ubuntu-x86_64-gemini-2a-2022-oct-06 \
--chain gemini-2a \
--execution wasm \
--state-pruning archive \
Expand Down Expand Up @@ -501,11 +470,11 @@ We will be downloading two files for your respective operating system.
2022-02-03 10:52:29 ⚙️ Syncing, target=#215883 (2 peers), best: #55 (0xafc7…bccf), finalized #0 (0x6ada…0d38), 850.1kiB/s 1.5kiB/s
```
5. We will then open another terminal, change to the downloads directory, then start the farmer node with the following command:
*Change command to feature `subspace-farmer-opencl-ubuntu-x86_64-gemini-2a-2022-sep-10` if using openCL.*
*Change command to feature `subspace-farmer-opencl-ubuntu-x86_64-gemini-2a-2022-oct-06` if using openCL.*
```bash
# Replace `FARMER_FILE_NAME` with the name of the farmer file you downloaded from releases
# Replace `WALLET_ADDRESS` below with your account address from Polkadot.js wallet
./subspace-farmer-ubuntu-x86_64-gemini-2a-2022-sep-10 farm \
./subspace-farmer-ubuntu-x86_64-gemini-2a-2022-oct-06 farm \
--reward-address WALLET_ADDRESS \
--plot-size 100G
```
Expand Down Expand Up @@ -554,7 +523,7 @@ To set your node to use a custom path all you will need to do is add the `--base

**Example:**
```
.\subspace-node-ubuntu-x86_64-gemini-2a-2022-sep-10 --chain gemini-1 --base-path /path/to/directory/here --execution wasm --pruning 1024 --keep-blocks 1024 --validator --name INSERT_YOUR_ID
.\subspace-node-ubuntu-x86_64-gemini-2a-2022-oct-06 --chain gemini-1 --base-path /path/to/directory/here --execution wasm --state-pruning archive --validator --name INSERT_YOUR_ID
```
</TabItem>
<TabItem value="farmer" label="2.🧑‍🌾 Farmer">
Expand All @@ -564,7 +533,7 @@ To set your node to use a custom path all you will need to do is add the `--base

**Example:**
```
.\subspace-farmer-ubuntu-x86_64-gemini-2a-2022-sep-10 --base-path /path/to/directory/here farm --reward-address WALLET_ADDRESS --plot-size PLOT_SIZE
.\subspace-farmer-ubuntu-x86_64-gemini-2a-2022-oct-06 --base-path /path/to/directory/here farm --reward-address WALLET_ADDRESS --plot-size PLOT_SIZE
```
</TabItem>
</Tabs>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Core Protocol Development
sidebar_position: 99
description: A basic guide on how to develop on the core subspace protocol utilizing substrate
displayed_sidebar: masterSidebar
draft: true # Meaning this will NOT be shown in Production
keywords:
- Getting Started
- Learn
- Core Protocol
- Development
---

## Pre-requisites

In addition to Rust toolchain, LLVM and Clang are needed for build to succeed, can be installed on Ubuntu like this:
```bash
sudo apt-get install llvm clang
```

## To Farm By Yourself (Offline)

1. Download the executables for your operating system
2. Open your favourite terminal, and go to the folder where you download the executables

**Linux/MacOS:**
1. Make them executable: `chmod +x subspace-farmer-x86_64-*-snapshot subspace-node-x86_64-*-snapshot`
2. Run the node: `./subspace-node-x86_64-*-snapshot --dev --tmp`
3. In macOS, it may prompt that this app is not verified. Click on `cancel` instead of moving it to trash.
To allow execution, go to `System Preferences -> Security & Privacy -> General`, and click on `allow`.
After this, simply repeat step 4. This time, there will be `Open` button in the prompt, click it to run node.
4. Run the farmer (do this in another terminal): `./subspace-farmer-x86_64-*-snapshot farm`
5. In macOS, it may prompt that this app is not verified. Click on `cancel` instead of moving it to trash.
To allow execution, go to `System Preferences -> Security & Privacy -> General`, and click on `allow`.
After this, simply repeat step 4. This time, there will be `Open` button in the prompt, click it to run node.

**Windows**
1. Run the node: `subspace-node-x86_64-*-snapshot --dev --tmp`
2. After running this command, Windows may ask you for permissions related to firewall, select `allow` in this case.
3. Run the farmer (do this in another terminal): `subspace-farmer-x86_64-*-snapshot farm`

## To Run From The Source (primarily for developers)

This is a monorepo with multiple binaries and the workflow is typical for Rust projects:

- `cargo run --release --bin subspace-node -- --dev --tmp` to run [a node](/crates/subspace-node)
- `cargo run --release --bin subspace-farmer farm` to [start farming](/crates/subspace-farmer)

NOTE 1: You need to have `nightly` version of Rust toolchain with `wasm32-unknown-unknown` target available or else you'll get a compilation error.
NOTE 2: Following the commands above, you will be farming in an offline setting (by yourself).
NOTE 3: To farm in online setting, you can modify the command accordingly.

You can find readme files in corresponding crates for requirements, multi-node setup and other details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Farm with CLI",
"position": 2
}
Loading

0 comments on commit 9ae8b79

Please sign in to comment.