Skip to content

Commit

Permalink
docs: add documentation generator
Browse files Browse the repository at this point in the history
PhearZero committed Jan 3, 2025
1 parent c56b34d commit 215bd2d
Showing 20 changed files with 654 additions and 116 deletions.
136 changes: 33 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,120 +1,50 @@
# ⌨️ AlgoRun-TUI
## algorun

<div align="center">
<img alt="Terminal Render" src="/assets/Banner.gif" width="65%">
</div>
Manage Algorand nodes from the command line

<div align="center">
<a target="_blank" href="https://github.com/algorandfoundation/algorun-tui/actions/workflows/test.yaml">
<img alt="CI Badge" src="https://github.com/algorandfoundation/algorun-tui/actions/workflows/test.yaml/badge.svg"/>
</a>
<a target="_blank" href="https://github.com/algorandfoundation/algorun-tui">
<img alt="CD Badge" src="https://img.shields.io/badge/CD-TODO-red"/>
</a>
<a target="_blank" href="https://github.com/algorandfoundation/algorun-tui/stargazers">
<img alt="Repository Stars Badge" src="https://img.shields.io/github/stars/algorandfoundation/algorun-tui?color=7B1E7A&logo=star&style=flat" />
</a>
<img alt="Repository Visitors Badge" src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Falgorandfoundation%2Falgorun-tui&countColor=%237B1E7A&style=flat" />
</div>
### Synopsis

---
<img alt="Terminal Render" src="/docs/nodekit.png" width="65%">
Manage Algorand nodes from the command line

Overview:
Welcome to Algorun, a TUI for managing Algorand nodes.
A one stop shop for managing Algorand nodes, including node creation, configuration, and management.

Note: This is still a work in progress. Expect bugs and rough edges.

Terminal UI for managing Algorand nodes.
Built with [bubbles](https://github.com/charmbracelet/bubbles) & [bubbletea](https://github.com/charmbracelet/bubbletea)

> [!CAUTION]
> This project is in alpha state and under heavy development. We do not recommend performing actions (e.g. key management) on participation nodes connected to public networks.
# 🚀 Get Started

Download the latest release by running

```bash
curl -fsSL https://raw.githubusercontent.com/algorandfoundation/algorun-tui/refs/heads/main/install.sh | bash
```

Launch the TUI by replacing the `<ENDPOINT>` and `<TOKEN>`
with your server in the following example

> [!IMPORTANT]
> TUI requires the *admin* token in order to access participation key information. This can be found in the `algod.admin.token` file, e.g. `/var/lib/algorand/algod.admin.token`
```bash
./algorun --algod-endpoint <ENDPOINT> --algod-token <TOKEN>
algorun [flags]
```

# ℹ️ Advanced Usage

## 🧑‍💻 Commands

The default command will launch the full TUI application
### Options

```bash
./algorun
```

### Status

Render only the status overview in the terminal

```bash
./algorun status
-d, --datadir string Data directory for the node
-h, --help help for algorun
```

### Help

Display the usage information for the command
### SEE ALSO

```bash
./algorun help
```
## ⚙️ Configuration

Configuration precedence takes place in the following order:
* [algorun bootstrap](/docs/algorun_bootstrap.md) - Initialize a fresh node
* [algorun catchup](/docs/algorun_catchup.md) - Manage Fast-Catchup for your node
* [algorun configure](/docs/algorun_configure.md) - Change settings on the system (WIP)
* [algorun debug](/docs/algorun_debug.md) - Display debugging information
* [algorun install](/docs/algorun_install.md) - Install the node daemon
* [algorun start](/docs/algorun_start.md) - Start the node daemon
* [algorun stop](/docs/algorun_stop.md) - Stop the node daemon
* [algorun uninstall](/docs/algorun_uninstall.md) - Uninstall the node daemon
* [algorun upgrade](/docs/algorun_upgrade.md) - Upgrade the node daemon

1. [ALGORAND_DATA Parsing](#algorand_data)
2. [Configuration File](#configuration-file)
3. [Environment Variables](#environment-variables)
4. [Command Line Flag Arguments](#flags)
###### Auto generated by spf13/cobra on 3-Jan-2025

### Flags
### Installing

The application supports the `algod-endpoint` and `algod-token` flags for configuration.
Connect to your server and run the installation script which will bootstrap your node.

```bash
./algorun --algod-endpoint http://localhost:8080 --algod-token aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

### Configuration File

The configuration file is named `.algorun.yaml` and is loaded in the following order:

1. Current Directory
2. Home Directory
3. /etc/algorun/

Example `.algorun.yaml` configuration file:

```yaml
algod-endpoint: "http://localhost:8080"
algod-token: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
```
### Environment Variables
Environment variables can be set in order to override a configuration or ALGORAND_DATA setting
but cannot be used to override the command line arguments.
The following are the additional ENV variables the TUI supports
| Name | Example |
|------------------------|----------------------------------------------------------------------------------------|
| ALGORUN_ALGOD-ENDPOINT | ALGORUN_ALGOD-ENDPOINT="http://localhost:8080" |
| ALGORUN_ALGOD-TOKEN | ALGORUN_ALGOD-TOKEN="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" |
### ALGORAND_DATA
The TUI searches the environment for an `ALGORAND_DATA` variable.
It then loads the `algod-token` and `algod-endpoint` values from
the algod data directory.

curl -fsSL https://raw.githubusercontent.com/algorandfoundation/algorun-tui/refs/heads/main/install.sh | bash
```
27 changes: 14 additions & 13 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ import (
)

var (
Name = "algorun"

// algodEndpoint defines the URI address of the Algorand node, including the protocol (http/https), for client communication.
algodData string
@@ -42,9 +43,9 @@ var (
"",
style.Yellow.Render(explanations.ExperimentalWarning),
)
// rootCmd is the primary command for managing Algorand nodes, providing CLI functionality and TUI for interaction.
rootCmd = utils.WithAlgodFlags(&cobra.Command{
Use: "algorun",
// RootCmd is the primary command for managing Algorand nodes, providing CLI functionality and TUI for interaction.
RootCmd = utils.WithAlgodFlags(&cobra.Command{
Use: Name,
Version: Version,
Short: short,
Long: long,
@@ -129,19 +130,19 @@ func init() {
log.SetReportTimestamp(false)
// Add Commands
if runtime.GOOS != "windows" {
rootCmd.AddCommand(bootstrapCmd)
rootCmd.AddCommand(debugCmd)
rootCmd.AddCommand(installCmd)
rootCmd.AddCommand(startCmd)
rootCmd.AddCommand(stopCmd)
rootCmd.AddCommand(uninstallCmd)
rootCmd.AddCommand(upgradeCmd)
rootCmd.AddCommand(catchup.Cmd)
rootCmd.AddCommand(configure.Cmd)
RootCmd.AddCommand(bootstrapCmd)
RootCmd.AddCommand(debugCmd)
RootCmd.AddCommand(installCmd)
RootCmd.AddCommand(startCmd)
RootCmd.AddCommand(stopCmd)
RootCmd.AddCommand(uninstallCmd)
RootCmd.AddCommand(upgradeCmd)
RootCmd.AddCommand(catchup.Cmd)
RootCmd.AddCommand(configure.Cmd)
}
}

// Execute executes the root command.
func Execute() error {
return rootCmd.Execute()
return RootCmd.Execute()
}
33 changes: 33 additions & 0 deletions docs/algorun_bootstrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## algorun bootstrap

Initialize a fresh node

### Synopsis

<img alt="Terminal Render" src="/docs/nodekit.png" width="65%">
Initialize a fresh node

Overview:
Get up and running with a fresh Algorand node.
Uses the local package manager to install Algorand, and then starts the node and preforms a Fast-Catchup.

Note: This command only supports the default data directory, /var/lib/algorand

```
algorun bootstrap [flags]
```

### Options

```
-h, --help help for bootstrap
```

### SEE ALSO

* [algorun](/README.md) - Manage Algorand nodes from the command line

###### Auto generated by spf13/cobra on 3-Jan-2025
37 changes: 37 additions & 0 deletions docs/algorun_catchup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## algorun catchup

Manage Fast-Catchup for your node

### Synopsis

<img alt="Terminal Render" src="/docs/nodekit.png" width="65%">
Fast-Catchup is a feature that allows your node to catch up to the network faster than normal.

Overview:
The entire process should sync a node in minutes rather than hours or days.
Actual sync times may vary depending on the number of accounts, number of blocks and the network.

Note: Not all networks support Fast-Catchup.

```
algorun catchup [flags]
```

### Options

```
-d, --datadir string Data directory for the node
-h, --help help for catchup
```

### SEE ALSO

* [algorun](/README.md) - Manage Algorand nodes from the command line
* [algorun catchup debug](/docs/algorun_catchup_debug.md) - Display debug information for Fast-Catchup.
* [algorun catchup start](/docs/algorun_catchup_start.md) - Get the latest catchpoint and start catching up.
* [algorun catchup stop](/docs/algorun_catchup_stop.md) - Stop a fast catchup

###### Auto generated by spf13/cobra on 3-Jan-2025
33 changes: 33 additions & 0 deletions docs/algorun_catchup_debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## algorun catchup debug

Display debug information for Fast-Catchup.

### Synopsis

<img alt="Terminal Render" src="/docs/nodekit.png" width="65%">
Display debug information for Fast-Catchup.

Overview:
This information is useful for debugging fast-catchup issues.

Note: Not all networks support Fast-Catchup.

```
algorun catchup debug [flags]
```

### Options

```
-d, --datadir string Data directory for the node
-h, --help help for debug
```

### SEE ALSO

* [algorun catchup](/docs/algorun_catchup.md) - Manage Fast-Catchup for your node

###### Auto generated by spf13/cobra on 3-Jan-2025
34 changes: 34 additions & 0 deletions docs/algorun_catchup_start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## algorun catchup start

Get the latest catchpoint and start catching up.

### Synopsis

<img alt="Terminal Render" src="/docs/nodekit.png" width="65%">
Catchup the node to the latest catchpoint.

Overview:
Starting a catchup will sync the node to the latest catchpoint.
Actual sync times may vary depending on the number of accounts, number of blocks and the network.

Note: Not all networks support Fast-Catchup.

```
algorun catchup start [flags]
```

### Options

```
-d, --datadir string Data directory for the node
-h, --help help for start
```

### SEE ALSO

* [algorun catchup](/docs/algorun_catchup.md) - Manage Fast-Catchup for your node

###### Auto generated by spf13/cobra on 3-Jan-2025
33 changes: 33 additions & 0 deletions docs/algorun_catchup_stop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## algorun catchup stop

Stop a fast catchup

### Synopsis

<img alt="Terminal Render" src="/docs/nodekit.png" width="65%">
Stop a fast catchup

Overview:
Stop an active Fast-Catchup. This will abort the catchup process if one has started

Note: Not all networks support Fast-Catchup.

```
algorun catchup stop [flags]
```

### Options

```
-d, --datadir string Data directory for the node
-h, --help help for stop
```

### SEE ALSO

* [algorun catchup](/docs/algorun_catchup.md) - Manage Fast-Catchup for your node

###### Auto generated by spf13/cobra on 3-Jan-2025
Loading

0 comments on commit 215bd2d

Please sign in to comment.