diff --git a/.github/workflows/release-bin.yaml b/.github/workflows/release-bin.yaml new file mode 100644 index 0000000..e20003c --- /dev/null +++ b/.github/workflows/release-bin.yaml @@ -0,0 +1,41 @@ +name: "Release" + +on: + push: + tags: + - '**' + +# Test Locally with: +# goreleaser build --skip-validate --snapshot + +jobs: + goreleaser: + permissions: write-all + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v2 + with: + go-version: '1.21' + + - name: Clean up dist directory + run: rm -rf dist + + - name: Build + uses: goreleaser/goreleaser-action@v5 + with: + version: latest + args: build --skip-validate + + - name: Release + uses: goreleaser/goreleaser-action@v5 + if: startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --skip-validate --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7a8ef73..f58947f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,5 +27,6 @@ cache state configs/logs.json +dist/* -coverage.txt \ No newline at end of file +coverage.txt diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..ee1ae48 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,110 @@ +project_name: manifest-ledger +release: + github: + owner: liftedinit + name: manifest-ledger + name_template: '{{.Tag}}' +builds: + - id: manifest-ledger + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + - "386" + goarm: + - "6" + gomips: + - hardfloat + goamd64: + - v1 + targets: + - linux_amd64_v1 + - linux_arm64 + - linux_386 + - darwin_amd64_v1 + - darwin_arm64 + - windows_amd64_v1 + - windows_arm64 + - windows_386 + dir: . + main: ./cmd/manifestd + binary: manifestd + builder: go + gobinary: go + command: build + ldflags: + - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser +archives: + - id: default + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}' + format: tar.gz + files: + - src: license* + - src: LICENSE* + - src: readme* + - src: README* + - src: changelog* + - src: CHANGELOG* +snapshot: + name_template: '{{ .Version }}-SNAPSHOT-{{ .ShortCommit }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' + algorithm: sha256 +dist: dist +env_files: + github_token: ~/.config/goreleaser/github_token + gitlab_token: ~/.config/goreleaser/gitlab_token + gitea_token: ~/.config/goreleaser/gitea_token +source: + name_template: '{{ .ProjectName }}-{{ .Version }}' + format: tar.gz +gomod: + gobinary: go +announce: + twitter: + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + mastodon: + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + server: "" + reddit: + title_template: '{{ .ProjectName }} {{ .Tag }} is out!' + url_template: '{{ .ReleaseURL }}' + slack: + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + username: GoReleaser + discord: + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + author: GoReleaser + color: "3888754" + icon_url: https://goreleaser.com/static/avatar.png + teams: + title_template: '{{ .ProjectName }} {{ .Tag }} is out!' + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + color: '#2D313E' + icon_url: https://goreleaser.com/static/avatar.png + smtp: + subject_template: '{{ .ProjectName }} {{ .Tag }} is out!' + body_template: 'You can view details from: {{ .ReleaseURL }}' + mattermost: + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + title_template: '{{ .ProjectName }} {{ .Tag }} is out!' + username: GoReleaser + linkedin: + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + telegram: + message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' + webhook: + message_template: '{ "message": "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}"}' + content_type: application/json; charset=utf-8 + opencollective: + title_template: '{{ .Tag }}' + message_template: '{{ .ProjectName }} {{ .Tag }} is out!
Check it out at {{ .ReleaseURL }}' +git: + tag_sort: -version:refname +github_urls: + download: https://github.com +gitlab_urls: + download: https://gitlab.com diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e14a050 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,63 @@ +# Contributing to Manifest Ledger + +All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. + +## Table of Contents + +- [I Have a Question](#i-have-a-question) +- [I Want To Contribute](#i-want-to-contribute) +- [I Want To Open A Pull Request](#i-want-to-open-a-pull-request) +- [Reporting Bugs](#reporting-bugs) + +## I Have a Question + +> If you want to ask a question, we assume that you have read the available [Documentation](./README.md). + +Before you ask a question, it is best to search for existing [Issues](/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. + +If you then still feel the need to ask a question and need clarification, we recommend the following: + +- Open an [Issue](/issues/new). +- Select a template and stick to its guidelines. +- Provide as much context as you can about what you're running into. +- Provide project and platform versions (os, arch, go, etc.), depending on what seems relevant. + +## I Want To Contribute + +### Legal Notice + +When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. + +### Reporting Bugs + +#### Before Submitting a Bug Report + +Please complete the following steps in advance to help us fix any potential bug as fast as possible. + +- Make sure that you are using the latest version. +- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](./README.md). If you are looking for support, you might want to check [this section](#i-have-a-question)). +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or issue. +- Collect information about the bug: +- Stack trace (Traceback) +- OS, Platform and Version (Windows, Linux, macOS, x86, ARM) +- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. +- Can you reliably reproduce the issue? And can you also reproduce it with older versions? + +#### How Do I Submit a Good Bug Report? + +> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . See [SECURITY.md](SECURITY.md) for further details. + +We use GitHub issues to track bugs and errors. If you run into an issue with the project: + +- Open an [Issue](/issues/new). +- Explain the behavior you would expect and the actual behavior. +- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. +- Provide the information you collected in the previous section. + +## I Want To Open A Pull Request + +Before opening a pull request, please make sure to read the [Contributing Guidelines](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md). + +We are using the [GitHub Flow](https://guides.github.com/introduction/flow/index.html) for our development process. This means that you should fork this repository and create a branch for your changes. After you are done with your changes, open a pull request to the `main` branch of this repository. + +Any PR's created without the PR template will be ignored and closed. Please follow the template as best as you can, removing any irrelevant sections and filling in the rest to the best of your ability. diff --git a/MODULE.md b/MODULE.md new file mode 100644 index 0000000..80d78c8 --- /dev/null +++ b/MODULE.md @@ -0,0 +1,265 @@ +# Modules + +## Table of Contents + +- [Modules](#modules) + - [Manifest Module](#manifest-module) + - [Module Functionality](#module-functionality) + - [Asset Issuance](#asset-issuance) + - [Commands](#commands) + - [Update Parameters (update-params)](#update-parameters-update-params) + - [Stakeholder Payout (stakeholder-payout)](#stakeholder-payout-stakeholder-payout) + - [Proof of Authority Module](#proof-of-authority-module) + - [Module Functionality](#module-functionality-1) + - [Validator Management](#validator-management) + - [Staking Parameters Update](#staking-parameters-update) + - [Administrative Rights](#administrative-rights) + - [Commands](#commands-1) + - [Update Parameters (update-params)](#update-parameters-update-params-1) + - [Update Staking Parameters (update-staking-params)](#update-staking-parameters-update-staking-params) + - [Set Voting Power (set-power)](#set-voting-power-set-power) + - [Remove Pending Validator (remove-pending)](#remove-pending-validator-remove-pending) + - [Remove Validator (remove)](#remove-validator-remove) + - [Token Factory Module](#token-factory-module) + - [Module Functionality](#module-functionality-2) + - [Token Minting](#token-minting) + - [Token Burning](#token-burning) + - [Token Administration](#token-administration) + - [Metadata Management](#metadata-management) + - [Commands](#commands-2) + - [Burn (burn)](#burn-burn) + - [Burn From (burn-from)](#burn-from-burn-from) + - [Mint (mint)](#mint-mint) + - [Change Admin (change-admin)](#change-admin-change-admin) + - [Create Denom (create-denom)](#create-denom-create-denom) + - [Force Transfer (force-transfer)](#force-transfer-force-transfer) + - [Modify Metadata (modify-metadata)](#modify-metadata-modify-metadata) + +## Manifest Module + +The Manifest module is responsible for handling inflation and manual minting events. Below is a structured breakdown of its components and functionalities: + +### Module Functionality + +Stakeholder Management: Allows the PoA admin to designate stakeholders, who can be one or multiple manifest wallet addresses. These stakeholders are eligible to receive assets issued by the PoA admin. + +#### Asset Issuance: + +- Manual Issuance: The PoA admin can manually mint and disburse a specified amount of tokens to the stakeholders. + +- Automatic Inflation: When enabled, umfx tokens are minted every block as set in the module parameters, aiming for a predetermined total amount of tokens over a year. + +#### Commands + +##### Update Parameters (update-params): + +- Syntax: `manifestd tx manifest update-params [address:percent_share,address2:percent_share2] [inflation_on_off] [annual_total_mint]` + + - Parameters: + - `address:percent_share`: Specifies the destination wallet address and its percent share of the total rewards (to the sixth exponent). + - `inflation_on_off`: A boolean value (true or false) to toggle automatic inflation. + - `annual_total_mint`: The total amount of tokens to be minted annually (used only if automatic inflation is enabled). + + **Example:** `manifestd tx manifest update-params manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct:100_000_000 false 0umfx` + +##### Stakeholder Payout (stakeholder-payout): + +- Syntax: `manifestd tx manifest stakeholder-payout [amount]` + + - Parameters: + + - `amount`: The amount of tokens to mint from the yearly allocated inflation. + + This command will fail if automatic inflation is enabled. + + **Example:** `manifestd tx manifest stakeholder-payout 777umfx` + +## Proof of Authority Module + +The PoA module is responsible for handling admin actions like adding and removing other administrators, setting the staking parameters of the chain, controlling voting power, and allowing/blocking validators. Below is a structured breakdown of its components and functionalities: + +### Module Functionality + +The PoA admin has several capabilities for managing the chain and its validators: + +#### Validator Management: + +- Remove validators from the active set. +- Remove validators pending addition to the active set. +- Specify the voting power for each validator. +- Approve the addition of new validators. + +#### Administrative Rights: + +- Assign or revoke administrative privileges. +- Determine if validators have the ability to self-revoke. + +#### Commands + +##### Update Parameters (update-params): + +Add more chain administrators to the module and change the ability for validators to self-exit the set gracefully. + +- Syntax: `manifestd tx poa update-params [admin1,admin2,admin3,...] [allow-validator-self-exit-bool]` + + - Parameters: + - `admin1,admin2,admin3,...`: A list of admin addresses which can be multisig addresses. + - `allow-validator-self-exit-bool`: A boolean value (true or false) to allow validators to self-exit. + + **Example:** `manifestd tx poa update-params manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct,manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct false` + +##### Update Staking Parameters (update-staking-params): + +Updates the defaults of the staking module from the PoA admin. For most cases, this should never be touched when using PoA. + +- Syntax: `manifestd tx poa update-staking-params [unbondingTime] [maxVals] [maxEntries] [historicalEntries] [bondDenom] [minCommissionRate]` + + - Parameters: + + - `unbondingTime`: The time period for tokens to move from a bonded to released state. Not applicable for Proof of Authority. + - `maxVals`: The maximum number of validators in the active set who can sign blocks. Default is 100 + - `maxEntries`: The maximum number of unbonding entries a delegator can have during the unbonding time. Not applicable for Proof of Authority. + - `historicalEntries`: The number of historical staking entries to account for. Not applicable for Proof of Authority. + - `bondDenom`: The denomination for bonding and staking. Not applicable for Proof of Authority. + - `minCommissionRate`: The minimum commission rate for validators to get a percent cut of fees generated. Not applicable for Proof of Authority. + + **Example:** `manifestd tx poa update-staking-params 1814400 100 7 1000 umfx 0.01` + +##### Set Voting Power (set-power): + +Update a validators vote power weighting in the network. A higher vote power results in more blocks being signed. This also accepts pending validators into the active set as an approval from the PoA admin. + +- Syntax: `manifestd tx poa set-power [validator] [power] [--unsafe]` + + - Parameters: + + - `validator`: The validator's operator address. + - `power`: The voting power to give the validator. This is relative to the total current power of all PoA validators on the network. Uses 10^6 exponent. + + **Example:** `manifestd tx poa set-power manifestvaloper1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct 1000000` + + **NOTE**: A network of 2 validators each with 1_000_000 power will have a total power of 2_000_000. So each have 50% of the network. If one validator increases, then the others network percentage decreases, but remains at the same fixed 1_000_000 power as before. + +##### Remove Pending Validator (remove-pending): + +In PoA networks, any user (validator) can submit to the chain a transaction to signal intent of becoming a chain validator. Since the PoA admin has the final say on who becomes a validator, they can remove any pending validators from the list who they wish not to add. This command is used to remove a pending validator from the list. + +- Syntax: `manifestd tx poa remove-pending [validator]` + + - Parameters: + + - `validator`: The validator's operator address. + + **Example:** `manifestd tx poa remove-pending manifestvaloper1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct` + +##### Remove Validator (remove): + +If the PoA admin decides they no longer wish for a validator to be signing blocks on the network, they can forcably remove them from the active set for signing blocks. This command removes the validator from signing blocks. + +- Syntax: `manifestd tx poa remove [validator]` + + - Parameters: + + - `validator`: The validator's operator address. + + **Example:** `manifestd tx poa remove manifestvaloper1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct` + +## Token Factory Module + +The Token Factory module as it is implemented on the Manifest Network, allows any user to have granular control over the creation and management of tokens on the Manifest Network. The creator can mint, burn, edit, and transfer tokens to other accounts from any account. + +### Module Functionality + +#### Token Minting: + +- Create a token with a specific denom +- Mint a token with a specific amount and denom to your account +- Mint a token with a specific amount and denom to another account + +#### Token Burning: + +- Burn a token with a specific amount and denom from your account +- Burn a token with a specific amount and denom from another account + +#### Token Administration: + +- Change the admin address for a factory-created denom +- Force transfer tokens from one address to another address + +#### Metadata Management: + +- Change the base metadata for a factory-created denom + +#### Commands + +##### Burn (burn): + +- Syntax: `manifestd tx token-factory burn [amount]` + + - Parameters: + - `amount`: The amount and denom of the token you would like to burn from your account. + + **Example:** `manifestd tx tokenfactory burn 1` + +##### Burn From (burn-from): + +- Syntax: `manifestd tx token-factory burn-from [address] [amount]` + + - Parameters: + - `address`: The address of the account you would like to burn the tokens from. + - `amount`: The amount and denom of the token you would like to burn. + + **Example:** `manifestd tx tokenfactory burn-from manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct 1` + +##### Mint (mint): + +- Syntax: `manifestd tx token-factory mint [amount]` + + - Parameters: + - `amount`: The amount and denom of the token you would like to mint to your account. + + **Example:** `manifestd tx tokenfactory mint 1` + +##### Change Admin (change-admin): + +- Syntax: `manifestd tx token-factory change-admin [denom] [new-admin-address]` + + - Parameters: + - `denom`: The denom of the token that you would like to change the admin for. + - `new-admin-address`: The new admin's wallet address. + + **Example:** `manifestd tx tokenfactory change-admin manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct` + +##### Create Denom (create-denom): + +- Syntax: `manifestd tx token-factory create-denom [subdenom]` + +> _note:_ the createor of the denom is the denoms admin. + +- Parameters: + - `subdenom`: The smallest denomination for your token e.g. udenom. + +**Example:** `manifestd tx tokenfactory create-denom ` + +##### Force Transfer (force-transfer): + +- Syntax: `manifestd tx token-factory force-transfer [amount] [transfer-from-address] [transfer-to-address]` + + - Parameters: + - `amount`: The amount and denom of the token you would like to transfer. + - `transfer-from-address`: The address of the account you would like to transfer the tokens from. + - `transfer-to-address`: The address of the account you would like to transfer the tokens to. + + **Example:** `manifestd tx tokenfactory force-transfer 1 manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct` + +##### Modify Metadata (modify-metadata): + +- Syntax: `manifestd tx token-factory modify-metadata [denom] [ticker-symbol] [description] [exponent]` + + - Parameters: + - `denom`: The denom of the token you are modifying. + - `ticker-symbol`: The ticker symbol for the token. + - `description`: A description of the token. + - `exponent`: The exponent for the token e.g. how many zeros. + + **Example:** `manifestd tx tokenfactory modify-metadata utoken TOKEN "A token" 6` diff --git a/README.md b/README.md index 63ac22e..f0f44e6 100644 --- a/README.md +++ b/README.md @@ -1 +1,147 @@ -# manifest-ledger \ No newline at end of file +

Manifest Ledger

+ +

+ Lifted Initiative +

+ +

+ + codecov + + + Go Report Card + + + Discord + +

+ +## Overview + +The Manifest Network, built on the Cosmos SDK, is a blockchain tailored for decentralized AI infrastructure access. Initially employing a Proof of Authority (PoA) model it ensures a secure and efficient launch phase, with a trusted validator set managing consensus. + +While PoA offers immediate stability and control, the Manifest Network aspires for greater decentralization. The future roadmap includes evolving towards a Proof of Stake (PoS) network, utilizing the underlying CometBft consensus mechanism inherent in the Cosmos SDK. + +## Table of Contents + +- [System Requirements](#system-requirements) +- [Installation](#install--run) +- [Testing](#testing) +- [Helper](#helper) +- [Modules](./MODULE.md) +- [Validators](./network/manifest-1/POST_GENESIS.md) +- [Multi Sig Guide](./network/manifest-1/MULTI_SIG.md) +- [Contributing](./CONTRIBUTING.md) +- [Security/Bug Reporting](./SECURITY.md) + +## System Requirements + +**Minimal** + +- 4 GB RAM +- 100 GB SSD +- 3.2 GHz x4 CPU + +**Recommended** + +- 8 GB RAM +- 100 GB NVME SSD +- 4.2 GHz x6 CPU + +**Software Dependencies** + +1. The Go programming language - +2. Git distributed version control - +3. Docker - +4. GNU Make - + +**Operating System** + +- Linux (x86_64) or Linux (arm64) + +**Arch Linux:** + +``` +pacman -S go git gcc make +``` + +**Ubuntu Linux:** + +``` +sudo snap install go --classic +sudo apt-get install git gcc make jq +``` + +## Install & Run + +Clone the repository from GitHub and enter the directory: + +```bash +git clone https://github.com/liftedinit/manifest-ledger.git +cd manifest-ledger +``` + +Then run: + +```bash +# build the base binary for interaction +make install +mv $GOPATH/bin/manifestd /usr/local/bin +manifestd + +# build docker image for e2e testing +make local-image +``` + +## Testing + +There are various make commands to run tests for the modules with custom implementations + +**To test the Proof of Authority implementation run:** + +```bash +make ictest-poa +``` + +**To test the Token Factory implementation run:** + +```bash +make ictest-tokenfactory +``` + +**To test the Manifest module which includes inflation changes run:** + +```bash +make ictest-manifest +``` + +**To test the IBC implementation run:** + +```bash +make ictest-ibc +``` + +## Helper + +There are scripts for testing, installing, and initializing. Use this section to help you navigate the various scripts and their use cases. + +#### Manifest Module script + +`scripts/manifest_testing.sh` + +This is a script to assist with configuring and testing the inflation and stakeholders. To better understand the script and what exactly it is testing please refer to the [Manifest Module](#manifest-module) section. + +#### Node Initialization script + +`scripts/test_node.sh` + +This is a script to assist with initializing and configuring a node. Ensure you properly configure the environment variables within the script. + +Also in this script are examples of how you could run it + +```bash +POA_ADMIN_ADDRESS=manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct CHAIN_ID="local-1" HOME_DIR="~/.manifest" TIMEOUT_COMMIT="500ms" CLEAN=true sh scripts/test_node.sh +CHAIN_ID="local-2" HOME_DIR="~/.manifest2" CLEAN=true RPC=36657 REST=2317 PROFF=6061 P2P=36656 GRPC=8090 GRPC_WEB=8091 ROSETTA=8081 TIMEOUT_COMMIT="500ms" sh scripts/test_node.sh +``` + +The succesful executation of these commands will result in 2 ibc connected instances of manifestd running on your local machine. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..20c376b --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,25 @@ +# Security + +#TODO: add PGP KEY + +> **🚨IMPORTANT🚨**: If you find a security issue, please report it to our [security mailing list](mailto:security-operations@liftedinit.org) _PLEASE DO NOT_ create a public issue. + +## Reporting + +Please report to our security mailing list at [security-operations@liftedinit.org +](mailto:security-operations@liftedinit.org) and we shall respond to you within 72 hours. + +### + +If you want to send us encrypted data, our GPG Public key is below. [Here](https://www.gnupg.org/gph/en/manual/x110.html) are instructions on how to do it. + +``` +-----BEGIN PGP PUBLIC KEY BLOCK----- + + +-----END PGP PUBLIC KEY BLOCK---- +``` + +## Packages in scope + +- [x/manifest](/x/manifest) diff --git a/network/manifest-1/MULTI_SIG.md b/network/manifest-1/MULTI_SIG.md new file mode 100644 index 0000000..5152f48 --- /dev/null +++ b/network/manifest-1/MULTI_SIG.md @@ -0,0 +1,85 @@ +# Manifest Network Cheat Sheet + +Use this document to help you better understanding creating PoA admins and overseeing admin operations of the chain. + +## Table of Contents + +- [Multi Sig Wallets](#multi-sig-wallets) +- [PoA Admin](#creating-a-poa-admin) +- [Inflation Controls](#inflation-controls) + +## Multi Sig Wallets + +A multi-sig wallet is a type of wallet that mandates multiple signatures to authorize a transaction, enhancing security by ensuring that no individual can transfer funds without approval from other designated signers. + +This multi-sig wallet will serve as the administrator for the Proof of Authority (PoA) network. Consequently, only this multi-sig wallet will have the authority to perform PoA administrative functions, necessitating X/X signatures for each action. + +### Setting Up a Multi-Sig Wallet + +1. **Wallet Creation:** Each member of the multi-sig group must first create a wallet. This step can be executed pre-genesis using the CLI: + + ```bash + manifestd keys add [--ledger] + ``` + + The `--ledger` flag is optional for adding a ledger key. + +2. **Sharing Public Keys:** Members need to share their public keys with the group. Obtain your public key using: + + ```bash + manifestd keys show -p + ``` + + Share the output with other members. + +3. **Adding Public Keys:** Once you've collected all public keys, add them to your keyring: + + ```bash + manifestd keys add --pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A57Cxv5vgwE6pAJ9oYtnOdU4ehKixMj6gufF8jBRq4IC"}' + ``` + +4. **Creating the Multi-Sig Wallet:** With all public keys added, create the multi-sig wallet: + + ```bash + manifestd keys add --multisig --multisig-threshold + ``` + + The threshold indicates the number of signatures required to authorize a transaction. + +### Signing & Broadcasting a Multi-Sig Transaction + +1. **Generate the Transaction:** Start by generating the transaction. For example, to stake tokens: + + ```bash + manifestd tx manifest update-params manifest1aucdev30u9505dx9t6q5fkcm70sjg4rh7rn5nf:100_000_000 true 6000000000000umfx --from=obvious-1-multisig --chain-id obvious-1 --generate-only > tx.json + ``` + + This command creates a `tx.json` file to distribute to other wallet members. + +2. **Signing the Transaction:** Each member signs the `tx.json`: + + ```bash + manifestd tx sign tx.json --from=reece-testnet --chain-id=obvious-1 --multisig=obvious-1-multisig >> reece.json + ``` + + After signing, members pass their signed JSON files back to the transaction coordinator. + +3. **Combining Signatures:** The coordinating member aggregates all signatures: + + ```bash + manifestd tx multisign --from obvious-1-multisig tx.json obvious-1-multisig reece.json --chain-id obvious-1 > tx_ms.json + ``` + +4. **Broadcasting the Transaction:** With all required signatures, the final transaction can be broadcast to the network: + + ```bash + manifestd tx broadcast tx_ms.json --chain-id obvious-1 + ``` + + You can utilize this example to build any other transaction type, just be sure to replace or add any flags as necessary. + +## Module Operations + +Please refer to the [Module Documentation](../../MODULE.md) for more information on the PoA module and controlling inflation. + +Any of the transactions listed in the module documentation can be executed using the multi-sig wallet. The multi-sig wallet will be the only entity capable of executing these transactions. You must follow the process of creating, signing, and broadcasting a transaction as outlined in the previous section just be sure to replace the transaction type and flags as necessary. diff --git a/network/manifest-1/POST_GENESIS.md b/network/manifest-1/POST_GENESIS.md index 86b90ed..1f9ec8b 100644 --- a/network/manifest-1/POST_GENESIS.md +++ b/network/manifest-1/POST_GENESIS.md @@ -1,28 +1,143 @@ # Post-Genesis -### Become a validator -* Install the manifest binary -* manifestd init --chain-id manifest-1 --default-denom poastake -* Replace your genesis with the public one found in this repo -* Find peers and seeds here. -* Update your minimum-gas-prices in the app.toml -* Start the node and sync up -* Once completed, `manifestd tx poa create-validator path/to/validator.json --from keyname`. This command shows the JSON needed. -```json +## Become a validator + +### Hardware Requirements + +**Minimal** + +- 4 GB RAM +- 100 GB SSD +- 3.2 x4 GHz CPU + +**Recommended** + +- 8 GB RAM +- 100 GB NVME SSD +- 4.2 GHz x6 CPU + +**Operating System** + +- Linux (x86_64) or Linux (amd64) Recommended Arch Linux + +### Dependencies + +> Prerequisite: go1.21+, git, gcc, make, jq + +**Arch Linux:** + +``` +pacman -S go git gcc make +``` + +**Ubuntu Linux:** + +``` +sudo snap install go --classic +sudo apt-get install git gcc make jq +``` + +### Install the manifest binary + +```bash +# Clone git repository +git clone https://github.com/liftedinit/manifest-ledger.git +cd manifest-ledger +git checkout VERSION + +make install # go install ./... +# For ledger support `go install -tags ledger ./...` +manifestd config set client chain-id manifest-1 +``` + +OR + +```bash +wget +chmod +x manifestd +mv manifestd /usr/local/bin +``` + +### Generate keys + +- `manifestd keys add [key_name]` +- `manifestd keys add [key_name] --recover` to regenerate keys with your BIP39 mnemonic to add ledger key +- `manifestd keys add [key_name] --ledger` to add a ledger key + +### Configure & start your node + +- #### Intialize + `manifestd init --chain-id manifest-1 --default-denom poastake` +- #### Genesis + `cp github.com/liftedinit/manifest-ledger/network/manifest-1/genesis.json ~/.manifestd/config/genesis.json` +- #### Peers + `sed -i 's/seeds = ""/seeds = "SEED_ADDRESS"/g' ${HOME}/.manifest/config/config.toml` +- #### Minimum Gas + `sed -i 's/minimum-gas-prices = "0stake"/minimum-gas-prices = "0umfx"/g' ${HOME}/.manifest/config/app.toml` +- #### Start + **Create a systemd service file** + +```bash +cat < validator.json { - "pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"oWg2ISpLF405Jcm2vXV+2v4fnjodh6aafuIdeoW+rUw="}, - "amount": "1poastake", # ignored - "moniker": "myvalidator", - "identity": "keybase-identity", - "website": "validator's (optional) website", - "security": "validator's (optional) security contact email", - "details": "validator's (optional) details", - "commission-rate": "0.1", - "commission-max-rate": "0.2", - "commission-max-change-rate": "0.01", - "min-self-delegation": "1" # ignored + "pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"oWg2ISpLF405Jcm2vXV+2v4fnjodh6aafuIdeoW+rUw="}, + "amount": "1000000poastake", + "moniker": "validator's name", + "identity": "keybase-identity", + "website": "validator's (optional) website", + "security": "validator's (optional) security contact email", + "details": "validator's (optional) details", + "commission-rate": "0.1", + "commission-max-rate": "0.2", + "commission-max-change-rate": "0.01", + "min-self-delegation": "1" } +EOF + ``` -Following these instructions, your validator will be put into a queue for the chain admins to accept or reject. Once accepted, you will be a validator on the network. -The chain admin's will set your amount if they accept. \ No newline at end of file +You can find your pubkey information by running `manifestd tendermint show-validator` + +- #### Submit creation transaction + `manifestd tx poa create-validator path/to/validator.json --from keyname` + +**Following these instructions, your validator will be put into a queue for the chain admins to accept or reject.**. You can view this queue by running `manifestd q poa pending-validators`. + +If accepted, you will become a validator on the network with the PoA admin's desired power for you. diff --git a/network/manifest-1/README.md b/network/manifest-1/README.md index de07c28..90c6c34 100644 --- a/network/manifest-1/README.md +++ b/network/manifest-1/README.md @@ -1,35 +1,44 @@ # Mainnet Genesis TODO: + - Update PoA Admin(s) from manifest10d07y265gmmuvt4z0w9aw880jnsr700jmq3jzm - Remove manifest1hj5fveer5cjtn4wd6wstzugjfdxzl0xp8ws9ct once others are given genesis allocations # Post Genesis Validators + If you are a validator joining the network after the initial genesis launch, follow the [post genesis document here](./POST_GENESIS.md). ## Hardware Requirements + **Minimal** -* 4 GB RAM -* 100 GB SSD -* 3.2 x4 GHz CPU + +- 4 GB RAM +- 100 GB SSD +- 3.2 GHz x4 CPU **Recommended** -* 8 GB RAM -* 100 GB NVME SSD -* 4.2 GHz x6 CPU + +- 8 GB RAM +- 100 GB NVME SSD +- 4.2 GHz x6 CPU **Operating System** -* Linux (x86_64) or Linux (amd64) Recommended Arch Linux + +- Linux (x86_64) or Linux (amd64) ### Dependencies ->Prerequisite: go1.21+, git, gcc, make, jq + +> Prerequisite: go1.21+, git, gcc, make, jq **Arch Linux:** + ``` pacman -S go git gcc make ``` **Ubuntu Linux:** + ``` sudo snap install go --classic sudo apt-get install git gcc make jq @@ -45,17 +54,27 @@ git checkout VERSION make install # go install ./... # For ledger support `go install -tags ledger ./...` - manifestd config set client chain-id manifest-1 ``` +OR + +```bash +wget +chmod +x manifestd +mv manifestd /usr/local/bin +``` + ### Generate keys -* `manifestd keys add [key_name]` -* `manifestd keys add [key_name] --recover` to regenerate keys with your BIP39 mnemonic to add ledger key -* `manifestd keys add [key_name] --ledger` to add a ledger key + +- `manifestd keys add [key_name]` +- `manifestd keys add [key_name] --recover` to regenerate keys with your BIP39 mnemonic to add ledger key +- `manifestd keys add [key_name] --ledger` to add a ledger key # Validator setup instructions + ## Genesis Tx: + ```bash # Validator variables KEYNAME='validator' # your keyname @@ -98,7 +117,8 @@ echo $(manifestd tendermint show-node-id)@$(curl -s ifconfig.me):26656` ``` > Update minimum gas prices + ```bash # nano ${HOME}/.manifest/config/app.toml # minimum-gas-prices -> "0umfx" sed -i 's/minimum-gas-prices = "0stake"/minimum-gas-prices = "0umfx"/g' ${HOME}/.manifest/config/app.toml -``` \ No newline at end of file +```