Skip to content

Commit

Permalink
Restructure and review README
Browse files Browse the repository at this point in the history
  • Loading branch information
mudlee committed Jul 8, 2021
1 parent 42fc535 commit d4f87bf
Showing 1 changed file with 48 additions and 88 deletions.
136 changes: 48 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,113 +1,70 @@
# Core v2 Management Tool (git install)
# Hydra Core-Control Management Tool

This is a Streamlined CLI-Based Hydra Core Management Tool.
## Installation

> IMPORTANT: We only support Ubuntu 18.04LTS and Ubuntu 20.04 LTS
```sh
git clone https://github.com/Internet-of-People/core-control -b master
$ git clone https://github.com/Internet-of-People/core-control -b master
```

## Important Change from 2.6.10

In 2.6.10 we made three breaking changes.

1. You only have to use the `master` branch from now. The `develop` branch is for development only and contains changes that might ruin your live production.
2. You need to prepend the `ccontrol` with a `NETWORK` environment set. See in the next section.

### How to Upgrade from 2.5.19 to 2.6.10

If you ran only a relay node, you have nothing to do here. Only, if you ran a forger as well.

1. Move to `master` branch.

```bash
git fetch
git checkout master
```

1. Upgrade the core-control

```bash
$ export NETWORK=[mainnet|devnet] && ./ccontrol.sh update self
```

1. Upgrade Hydra Core

```bash
$ export NETWORK=[mainnet|devnet] && ./ccontrol.sh update core
```

1. Stop all
**IMPORTANT NOTES**

```bash
$ export NETWORK=[mainnet|devnet] && ./ccontrol.sh stop all
```

1. If you ran both a relay and a forger, then start all with `all`

```bash
$ export NETWORK=[mainnet|devnet] && ./ccontrol.sh start all
```
- We only support Ubuntu LTS. If you need more flexibility, use [our Docker tools](https://github.com/Internet-of-People/hydra-core/blob/master/docker/README.md).
- **Do not run as root!**
- Installs fail2ban for ssh, and ufw allowing only port 22(ssh) and the cores ports.
- If you already use this tool, please review the changelog section.

## Core Control Usage
## Usage

```sh
cd core-control
export NETWORK=[devnet|mainnet] && ./ccontrol.sh arg1 [arg2]
$ cd core-control
$ NETWORK=[devnet|mainnet] ./ccontrol.sh arg1 [arg2]
```

For some sub-commands you can leave out the 2nd argument and the bold one will be the default.

| arg1 | arg2 | Description |
| --- | --- | --- |
| `install` | `core` | Install Core |
| `update` | `core`/`self`/`check` | Update Core / Core-Control / Check |
| `remove` | `core`/`self` | Remove Core / Core-Control |
| `install` | **core** | Install Core |
| `update` | `core`/`self`/**check** | Update Core / Core-Control / Check |
| `remove` | **core**/`self` | Remove Core / Core-Control |
| `secret` | `set`/`clear` | Delegate Secret Set / Clear |
| `start` | `relay`/`forger`/`all` | Start Core Services |
| `restart` | `relay`/`forger`/`all`/`safe` | Restart Core Services |
| `stop` | `relay`/`forger`/`all` | Stop Core Services |
| `status` | `relay`/`forger`/`all` | Show Core Services Status |
| `logs` | `relay`/`forger`/`all` | Show Core Logs |
| `start` | `relay`/`forger`/**all** | Start Core Services |
| `restart` | `relay`/`forger`/**all**/`safe` | Restart Core Services |
| `stop` | `relay`/`forger`/**all** | Stop Core Services |
| `status` | `relay`/`forger`/**all** | Show Core Services Status |
| `logs` | `relay`/`forger`/**all** | Show Core Logs |
| `snapshot` | `create`/`restore` | Snapshot Create / Restore |
| `system` | `info`/`update` | System Info / Update |
| `system` | **info**/`update` | System Info / Update |
| `config` | `reset` | Reset Config Files to Defaults |
| `database` | `clear` | Clear the Database |
| `rollback` | | Rollback to Specified Height |
| `plugin` | `list`/`add`/`remove`/`update` | Manage Core Plugins |
| `plugin` | **list**/`add`/`remove`/`update` | Manage Core Plugins |

## General

This is a Streamlined CLI-Based Core v2 Management Tool.
### Notes

- **Do not run as root!**
- Installs fail2ban for ssh, and ufw allowing only port 22(ssh) and the cores ports.
- For start/restart/stop/status/logs you can skip the 'all' argument as it's the default.
- For install/remove you can skip the 'core' argument as it's the default.
- For update you can skip the 'check' argument as it's the default.
- For system you can skip the 'info' argument as it's the default.
- For plugin you can skip the 'list' argument as it's the default.
- Using the 'restart safe' arguments requires the round-monitor core plugin and restarts the core services when safe to do so in
order to avoid missing a block.
- When setting a delegate secret just type your secret after the 'set' argument without quotes.

- When setting a delegate secret just type your secret after the 'set' argument without quotes, like below:
```bash
# Example
export NETWORK=[devnet|mainnet] && ./ccontrol.sh secret set one two three four five six seven eight nine ten eleven twelve
$ NETWORK=[devnet|mainnet] ./ccontrol.sh secret set one two three four five six seven eight nine ten eleven twelve
```

- When doing a rollback just type the desired height after the 'rollback' argument.
- When doing a rollback just type the desired height after the `rollback` argument.
- Rollback will stop the running processes, do the rollback and start the processes that were online.
- The script adds an alias named 'ccontrol' on first run. On your next shell login you'll be able to call the script from anywhere
using: ccontrol arg1 [arg2]. It also has autocomplete functionality for all possible arguments.
- Using the 'config reset' arguments will stop the core processes, delete your existing configs and replace them with the defaults.
- The script adds an alias named `ccontrol` on first run. On your next shell login you'll be able to call the script from anywhere
using: `ccontrol arg1 [arg2]`. It also has autocomplete functionality for all possible arguments.
- Using the `config reset` arguments will stop the core processes, delete your existing configs and replace them with the defaults.
If you're running a forger and/or have custom settings, you should add them again.
- Using the 'database clear' arguments will stop the core processes, wipe the database clean, and start the processes that were online before.
- Using the `database clear` arguments will stop the core processes, wipe the database clean, and start the processes that were online before.
The end result is that your node will start syncing from 0.
- For plugin management just type the name of the plugin after 'plugin add/remove/update' as it appears in the list.
- On first run the tool exposes the core-cli with the project name, e.g. ark for project Ark. It will be accessible after logout.
- For plugin management just type the name of the plugin after `plugin add/remove/update` as it appears in the list.
- On first run the tool exposes the core-cli with the project name, e.g. hydra for project Hydra. It will be accessible after logout.

## Changelog

In addition to this changelog, please also review [Hydra Core's changelog](https://github.com/Internet-of-People/hydra-core#changelog).

### 2.6.31+p3

- Upgraded to 4.0.4 SSI (project Morpheus, previously called DAC)
Expand All @@ -127,10 +84,10 @@ The end result is that your node will start syncing from 0.
#### How to update from 2.6.31

```bash
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh update self
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh update core
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh stop all
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh start [relay|forger|all]
$ NETWORK=[devnet|mainnet] ./ccontrol.sh update self
$ NETWORK=[devnet|mainnet] ./ccontrol.sh update core
$ NETWORK=[devnet|mainnet] ./ccontrol.sh stop all
$ NETWORK=[devnet|mainnet] ./ccontrol.sh start [relay|forger|all]
```

### 2.6.31
Expand All @@ -142,24 +99,27 @@ $ export NETWORK=[devnet|mainnet] && ./ccontrol.sh start [relay|forger|all]
#### How to update from 2.6.10

```bash
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh update self
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh update core
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh stop all
$ export NETWORK=[devnet|mainnet] && ./ccontrol.sh start [relay|forger|all]
$ NETWORK=[devnet|mainnet] ./ccontrol.sh update self
$ NETWORK=[devnet|mainnet] ./ccontrol.sh update core
$ NETWORK=[devnet|mainnet] ./ccontrol.sh stop all
$ NETWORK=[devnet|mainnet] ./ccontrol.sh start [relay|forger|all]
```

### 2.6.10 - MANDATORY RELEASE

- updated for core 2.6.10
- `ccontrol.sh` now requires a `NETWORK` environment variable set to be either `devnet` or `mainnet`. See the installation guide.

Note: it's a mandatory update!
**Breaking Changes**

1. You only have to use the `master` branch from now. The `develop` branch is for development only and contains changes that might ruin your live production.
2. You need to prepend the `ccontrol` with a `NETWORK` environment set. See in the next section.

**To be able to use the latest core-control and Hydra Core, follow these steps:**

1. `cd core-control`
1. `git checkout master`
1. `export NETWORK=[devnet|mainnet] && ./ccontrol update core`
1. `NETWORK=[devnet|mainnet] ./ccontrol update core`

### 2.5.1

Expand Down

0 comments on commit d4f87bf

Please sign in to comment.