From e172d73d25bd1ffa370929125c863639168b7e2c Mon Sep 17 00:00:00 2001 From: TheOneID Date: Mon, 30 Oct 2023 19:51:43 +0100 Subject: [PATCH] Adds Tower documentation Signed-off-by: TheOneID --- docs/Tools/tower/index.md | 18 ++++++++ docs/Tools/tower/use-tower-cli.md | 70 +++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 docs/Tools/tower/index.md create mode 100644 docs/Tools/tower/use-tower-cli.md diff --git a/docs/Tools/tower/index.md b/docs/Tools/tower/index.md new file mode 100644 index 00000000..368586a6 --- /dev/null +++ b/docs/Tools/tower/index.md @@ -0,0 +1,18 @@ +--- +title: "Tower" +id: "index" +hidden: false +--- + +# What is Tower + +Tower is the verifiable delay function (VDF) proof-of-work system 0L used to bootstrap and mint all the coins up to V7. Users mine up to a certain maximum amount of proofs per epoch which are submitted into the Blockchain. For more info about Delay Towers, please follow our series of [Blog post](https://0l.network/2021/11/01/) + +## How to use Tower in 0L Network? + +A CLI tool with all needed capabilities is provided. It allows to do things such as mining, verifying, submitting proofs, etc. + +### Tower CLI +The `tower` tool is a command line interface (CLI) for managing tower proofs in the 0L network. + +- [Use Tower CLI](tower/use-tower-cli) diff --git a/docs/Tools/tower/use-tower-cli.md b/docs/Tools/tower/use-tower-cli.md new file mode 100644 index 00000000..5e9df065 --- /dev/null +++ b/docs/Tools/tower/use-tower-cli.md @@ -0,0 +1,70 @@ +--- +title: "Use the Tower CLI" +id: "use-tower-cli" +--- +## Tower CLI commands and options +```bash +libra-tower --help +``` +Output: +``` +clap struct entry point for the tower cli + +Usage: libra-tower [OPTIONS] + +Commands: + backlog + start + once + zero + help Print this message or the help of the given subcommand(s) + +Options: + -l, --local-mode + If the node is offline and tower needs to run in local mode without querying chain + -c, --config-file + The optional path to an alternate path besides $HOME/.0L + -p, --profile + nickname of the profile to use, if there is more than one. Defaults to first + -t, --test-private-key + optional, private key of the account. Otherwise this will prompt for mnemonic. Warning: intended for testing + -h, --help + Print help + -V, --version + Print version +``` + +## Configuration +If you don't already a valid `libra.yml` configuration file under path `~/.libra`, you may generate a new one with the following command (mnemonic needed): +```bash +libra config init +``` +Alternatively, the configuration folder can also be overwritten by: +```bash +libra config init --path +``` + +## Mining (Production Mode) +If you wish to create the genesis proof AKA proof zero of the configured account, execute the command: +```bash +libra-tower zero +``` +If everything went find, you should be able to see the file `proof_0.json` under `/vdf_proofs_/` +Now let us generate the proof #n 1: +```bash +libra-tower once +``` +The above command will generate only one proof, which is good for testing purposes, but in production you may want to keep generating proofs automatically. This can be achieved with the following command: +```bash +libra-tower start +``` +The previous command will keep generating proofs and submit them automatically, but what if for some reason you wish to submit them manually? We got you: +```bash +libra-tower backlog +``` + +## Mining (Testing Mode) +For testing purposes is not feasible to wait too long just to have a generated proof, therefore it's possible to generate proofs in 1 sec. Such can be achieved using any of the above mining commands, we just need environment variable instructing to generate a proof a testing mode. Eg: +```bash +MODE_0L=TESTING libra-tower zero +```