diff --git a/.github/ISSUE_TEMPLATE b/.github/ISSUE_TEMPLATE index 0817d096..0fc59e45 100644 --- a/.github/ISSUE_TEMPLATE +++ b/.github/ISSUE_TEMPLATE @@ -1,21 +1,20 @@ - + -Describe the issue you're encountering in detail. +## Steps to reproduce -**Issue type**: (Select one) + -- [ ] Bug -- [ ] Question -- [ ] Improvement +## Error messages and/or screenshots -**Steps to reproduce**: + -Provide a step-by-step explanation of how to reproduce the issue. +## Proposed solution (optional) -**Error messages**: + -Include any relevant error messages, logs, or screenshots. +## Checklist -**Expected behavior**: +I confirm that I have: -What were you expecting to happen? This may seem like a silly question, but please be specific. +- [ ] Checked to see if there are any existing issue that cover this topic. +- [ ] Linked to any relevant issues across all [entropyxyz](https://github.com/entropyxyz/) repos. diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 00000000..46d574d3 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,24 @@ + + +## Description + + + + + + + + +### Content updates + + + +## Documentation updates + + + +## Checklist: + +- [ ] I have read and followed the `CONTRIBUTING.md` guidelines. +- [ ] I have run these changes through a grammar and spell checker. +- [ ] I have updated the documentation (`README.md`, `CONTRIBUTING.md` etc.) to reflect these changes. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..671395ea --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# Welcome Contributors + +We welcome contributions from developers of all experience levels. Whether you're a seasoned blockchain expert or a curious newcomer, your input is valuable to our project. + +## Table of contents + +- [Creating PRs](#creating-prs) +- [Writing the docs](#writing-the-docs) + +## Creating PRs + +Follow these steps to make a successful and impactful PR! + +### Prerequisites + +- Familiarize yourself with the docs project by reading the `README.md`. +- Ensure you have the necessary development tools installed. +- Set up a local development environment following the instructions in `README.md`. The Hugo static site generator is available for pretty much every modern OS. + +### Fork the repository + +1. Create a personal fork of this project on GitHub. +1. Clone your **forked** repository to your local machine. + +### Create a branch + +1. Create a new branch for your contribution. +1. Use a clear, descriptive branch name that reflects the purpose of your changes, like `feat/add-key-generation-method` or `update/signature-signing-error` + +### Make Your Changes + +1. Add or update documentation as needed. +1. Test your changes locally using Hugo to ensure the site renders correctly. + +### Prepare your PR + +1. Write clear, concise commit messages. +1. Describe _exactly_ what the commit does. For example: "Clarifies T of N signature verification method." +1. Run your markdown through a grammar and spell checker. +1. Ensure clarity and correctness of all written content. +1. If modifying technical documentation, verify technical accuracy. + +### Submit a Pull Request + +1. Push your changes to your fork. +1. Open a pull request against this repo. +1. Provide a clear description of your changes using the PR template provided (you'll see it when you make your PR). +1. Link all related issues. All PRs **must** close at least one existing issue. + +### Code Review Process + +1. All pull requests will undergo a thorough code review. +1. Reviewers will provide constructive feedback. +1. Be prepared to make modifications based on review comments. + +## Writing the docs + +You can find all the docs in the `/content` folder. This content directory is structured the same as the website. The only caveats: + +1. The `docs.entropy.xyz` homepage is controlled by `./content/_index.md`. +1. Section indexes, like `docs.entropy.xyz/concepts`, are automatically generated by Hugo -- you do not need to directly edit the content of these pages. The content in the sub-pages controls the page snippets in these index pages. For example, the snippet for the **Quickstart** entry in `docs.entropy.xyz/basics` is generated from the `lead` variable within `./content/basics/quickstart.md`. If a `lead` variable does not exist, Hugo generates a snippet from the main content of a sub-page. + +--- + +**Thanks for helping improve our docs!** diff --git a/README.md b/README.md index 9d69dce1..814b7be3 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ To submit a support ticket: ## Contribute -We appreciate contributions of any size from everyone, from fixing typos to proposing substantial rewrites to aid clarity. Simply make a PR with your edits, and a member of the Entropy devrel team will review everything. +We appreciate contributions of any size from everyone, from fixing typos to proposing substantial rewrites to aid clarity. Take a look at the [`CONTRIBUTING.md` doc for more details](./CONTRIBUTING.md) on how to help. ### Writing docs diff --git a/content/concepts/programs.md b/content/concepts/programs.md index 0f169859..6cb1c843 100644 --- a/content/concepts/programs.md +++ b/content/concepts/programs.md @@ -3,22 +3,31 @@ title: "Programs" lead: "The purpose of an Entropy program is to determine whether a group of nodes should generate a signature or not. Developers can create and deploy programs, but validator nodes are the only agents that will directly interact with the programs once deployed. Programs do not return any data other than a _success_ or _failed_ response." --- +## Quick summary + +1. **What are Entropy Programs**: WebAssembly (WASM) components used by signing nodes to determine whether they should generate a signature and how to generate that signature. +1. **Who uses them**: validator nodes are the only agents directly interacting with deployed programs. However, Entropy Program developers will create, test, and deploy them. End-users do not directly interact with Entropy programs. +1. **What can they do**: define which accounts can generate specific signatures and the process by which those nodes generate the signatures. Programs can contain custom hashing functions to create arbitrary signatures. +1. **What they can't do**: return any data other than success/failure responses, call external chains, access external data, or access any non-deterministic data. + +## Simple example + As a simple example, a program could be designed to check the length of a message. If the message is more than 10 characters, then the program returns `OK`, and the signing nodes create and return a valid signature to the account that submits the message. If the message is more than 10 characters, then the program fails, and no signature is created. ```mermaid flowchart LR - A[Entropy account] - B{Length > 10} - C[Signing nodes] - D[Fail] - E[Success] - - A --> | send message | B - B -- true --> E - E --> | generate signature | C - C --> | valid signature | A - - B -- false --> D + A[Entropy account] + B{Length > 10} + C[Signing nodes] + D[Fail] + E[Success] + + A --> | send message | B + B -- true --> E + E --> | generate signature | C + C --> | valid signature | A + + B -- false --> D ``` {{< callout "info" >}} @@ -78,7 +87,7 @@ The workflow is as follows: - The signing key signs the transaction and becomes the deployer key - A reference counter gets set to 0 when uploading and is used to track how many users are using a program 2. A program then gets stored in the Programs storage slot with the key being `H(bytecode + configuration_interface)`. The hash is used by a user to point to the programs they want applied to their key. Every time a program is referenced, the reference counter increments -3. Since the key is a hash, there is no editing programs (since that would change the hash) +3. Since the key is a hash, it is not possible to edit or modify programs (since that would change the hash). 4. Programs can be removed if the ref count is zero by the deploy key ## Device-proxy diff --git a/content/guides/spin-up-a-devnet.md b/content/guides/spin-up-a-devnet.md index 5818549c..ce649fb4 100644 --- a/content/guides/spin-up-a-devnet.md +++ b/content/guides/spin-up-a-devnet.md @@ -1,214 +1,172 @@ --- -title: "Spin up a devnet" -lead: "A developer network (devnet) is a private, isolated blockchain network that developers use to test and experiment with features and programs without affecting other Entropy networks or risking real-world assets. This guide will walk you through creating a local devnet on your machine." +title: "Spin up a devnet for Entropy" +lead: "A developer network (devnet) is a private blockchain network that mimics the mainnet but is isolated for testing and development purposes. This allows developers to make mistakes and iterate quickly without impacting real users or risking real-world assets. This guide will walk you through setting up a local devnet for the Entropy." --- -Developers should use a devnet when testing new features, experimenting with network parameters, or during initial development stages. However, developers should avoid using it for final production deployments, security audits requiring mainnet conditions, or when real-world economic incentives need to be tested. +A devnet is an essential tool for devs working with Entropy. It provides a safe and controlled environment to: -## Docker image +- Test new features and functionalities. +- Experiment with network parameters. +- Debug and troubleshoot issues. +- Develop and test Entropy Programs without impacting mainnet. -Spinning up a devnet using the Docker images supplied in the Entropy Core repo is the easiest way to get up and running. The requirements are fairly minimal, and everything should work straight out of the box. +This guide will cover two primary methods for setting up a local Entropy devnet: -### Prerequisites - -You need to have [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/) installed. Verify you have them both installed by running: +- [Using Docker containers]({{< relref "#docker-containers" >}}): The recommended method for most users due to its ease of use and simplicity. +- [Building from source]({{< relref "#building-from-source" >}}): For developers who require more control or are unable to use Docker. -```shell -docker version && docker compose version -``` +## Docker containers -```output -Client: - Cloud integration: v1.0.35+desktop.13 - Version: 26.1.1 +This method leverages pre-built Docker images to quickly and easily spin up a local devnet. -... +### Prerequisites -Docker Compose version v2.27.0-desktop.2 -``` +- [Docker](https://docs.docker.com/engine/install/). +- [Docker Compose](https://docs.docker.com/compose/install/). +- Basic understanding of Docker commands. ### Steps -1. Clone the Entropy Core repository and move into the new `entropy-core` directory: +1. Clone the Entropy Core repo: - ```shell - git clone https://github.com/entropyxyz/entropy-core.git - cd entropy-core - ``` + ```bash + git clone https://github.com/entropyxyz/entropy-core.git + cd entropy-core + ``` -1. Add the Alice and Bob threshold-signing services (TSS) to your local `hosts` file: +1. Start the Docker daemon: - ```shell - echo "127.0.0.1 alice-tss-server bob-tss-server" | sudo tee -a /etc/hosts - ``` + {{< tabs items="MacOS, Linux" >}} + {{< tab >}} + ```shell + sudo systemctl start docker + ``` + {{< /tab >}} - You may need to enter your computer's password when prompted. + {{< tab >}} + ```shell + dockerd + ``` + {{< /tab >}} + {{< /tabs >}} 1. Start the Docker containers: + ```bash + docker compose up --detach + ``` - ```shell - docker compose up --detach # Detaching is optional. - ``` - - ```output - [+] Running 0/17 - ⠸ bob-tss-server [⠀] Pulling - ⠏ b3d3cc4a5268 Waiting - ⠏ dec0c2d4580b Waiting - - ... - - ✔ Container entropy-devnet-local-bob-chain-node-1 Started - ✔ Container entropy-devnet-local-alice-tss-server-1 Started - ✔ Container entropy-devnet-local-bob-tss-server-1 Started - ``` - -1. Confirm that the containers are up and running: - - ```shell - docker ps - ``` - - ```output - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - 23116711e503 entropyxyz/entropy-tss "/usr/local/bin/entr…" 1 minutes ago Up 4 seconds 9615/tcp, 9944/tcp, 127.0.0.1:3001->3001/tcp, 30333/tcp entropy-devnet-local-alice-tss-server-1 - c83c2ae9da20 entropyxyz/entropy "/usr/local/bin/entr…" 1 minutes ago Up 4 seconds 3001/tcp, 9615/tcp, 30333/tcp, 127.0.0.1:9944->9944/tcp entropy-devnet-local-alice-chain-node-1 - 5088bb75951c entropyxyz/entropy-tss "/usr/local/bin/entr…" 1 minutes ago Up 4 seconds 3001/tcp, 9615/tcp, 9944/tcp, 30333/tcp, 127.0.0.1:3002->3002/tcp entropy-devnet-local-bob-tss-server-1 - 3b0048bcaa00 entropyxyz/entropy "/usr/local/bin/entr…" 1 minutes ago Up 4 seconds 3001/tcp, 9615/tcp, 30333/tcp, 127.0.0.1:9945->9944/tcp entropy-devnet-local-bob-chain-node-1 - ``` - -1. Confirm that the local devnet is functioning by using the Rust test interface within the Entropy Core repo: - - ```shell - cargo run -p entropy-test-cli -- --chain-endpoint="ws://127.0.0.1:9944" status - ``` +1. Verify container status: - ```output - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.60s - Running `target/debug/entropy-test-cli '--chain-endpoint=ws://127.0.0.1:9944' status` + ```bash + docker ps + ``` - ... + This command lists all running Docker containers. Look for containers like `entropy-devnet-local-alice-chain-node-1`. - Hash Stored by: Times used: Size in bytes: Configurable? Has auxiliary? - 0x0000…0000 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 10 300498 true true - Success: Got status - That took 224.958542ms - ``` +1. (Optional) Check server logs: - If this is the first time you are running the Rust testing interface, the `cargo` command above will take a few minutes to complete. + ```bash + docker compose logs + ``` -1. You can also verify that things are working as expected by checking the server logs: + While optional, this command shows logs from running containers which can be helpful for troubleshooting. - ```shell - docker compose logs - ``` +1. Stop all running containers: - ```output - alice-chain-node-1 | 2024-06-24 19:41:06 Unexpected status code: 204 - alice-chain-node-1 | 2024-06-24 19:41:06 💤 Idle (1 peers), best: #116 (0xd68c…bfed), finalized #113 (0x06df…be36), ⬇ 0.6kiB/s ⬆ 0.6kiB/s - alice-chain-node-1 | 2024-06-24 19:41:11 💤 Idle (1 peers), best: #116 (0xd68c…bfed), finalized #114 (0xb994…0299), ⬇ 0.6kiB/s ⬆ 0.5kiB/s - ``` + ```bash + docker stop $(docker ps -a -q) + ``` -1. To stop the network, simply use the `docker stop` command followed by the ID of each Docker container: - - ```shell - docker stop $(docker ps -a -q) - ``` - - ```output - 23116711e503 - c83c2ae9da20 - 5088bb75951c - 3b0048bcaa00 - ``` - - Alternatively, you can stop each container individually. - - ```shell - docker stop 23116711 - docker stop c83c2... - - ... - ``` - -1. That's it! - -## Build from source +## Building from Source It is possible to build the chain node and threshold-signature scheme server binaries. However, the process for spinning up a devnet with this method is slightly more involved than the Docker method outlined above. We recommend that you only follow this method if you have a specific reason to _not_ run Docker. ### Prerequisites -You must have the latest LTS version of [Rust](https://www.rust-lang.org/tools/install) installed, along with all the [Substrate dependencies](https://docs.substrate.io/install/) for your operating system. +- [Latest LTS version of Rust](https://www.rust-lang.org/) +- [Substrate dependencies](https://docs.substrate.io/install/) ### Steps -1. Clone the Entropy Core repository and move into the new `entropy-core` directory: +1. Clone the Entropy Core repository: - ```shell - git clone https://github.com/entropyxyz/entropy-core.git - cd entropy-core - ``` + ```bash + git clone https://github.com/entropyxyz/entropy-core.git + cd entropy-core + ``` -1. Build the chain node and threshold signature scheme server binaries: +1. Compile the source into an executable binary: - ```shell - cargo build --release - ``` + ```bash + cargo build --release + ``` - ```output - Downloaded asn1-rs-derive v0.4.0 - Downloaded byte-tools v0.3.1 - Downloaded const-random-macro v0.1.16 + ```output + Downloaded asn1-rs-derive v0.4.0 + Downloaded byte-tools v0.3.1 + Downloaded const-random-macro v0.1.16 - ... - ``` + ... + ``` - Cargo is downloading and compiling a lot of tooling for the binaries. This process may take upwards of 10 minutes, depending on your system. + Cargo is downloading and compiling a lot of tooling for the binaries. This process may take upwards of 10 minutes, depending on your system. 1. Run the node binary: - ```shell - ./target/release/entropy --dev --rpc-external - ``` + ```bash + ./target/release/entropy --dev --rpc-external + ``` - ```output - 2024-06-24 18:36:10 💤 Idle (0 peers), best: #4 (0xe3da…d11b), finalized #0 (0xe938…3b8f), ⬇ 0 ⬆ 0 - 2024-06-24 18:36:12 🙌 Starting consensus session on top of parent 0xe3da43079cb427b60ca77cee0fe206b933ec9df57ece549ad46a5681ea95d11b - 2024-06-24 18:36:12 🎁 Prepared block for proposing at 5 (2 ms) [hash: 0x636c606f7d66d8c25bc64956c14b1a9c209d035279ff4f7dccd629c346d81047; parent_hash: 0xe3da…d11b; extrinsics (1): [0x7f45…6999 - ``` + ```output + 2024-06-24 18:36:10 💤 Idle (0 peers), best: #4 (0xe3da…d11b), finalized #0 (0xe938…3b8f), ⬇ 0 ⬆ 0 + 2024-06-24 18:36:12 🙌 Starting consensus session on top of parent 0xe3da43079cb427b60ca77cee0fe206b933ec9df57ece549ad46a5681ea95d11b + 2024-06-24 18:36:12 🎁 Prepared block for proposing at 5 (2 ms) [hash: 0x636c606f7d66d8c25bc64956c14b1a9c209d035279ff4f7dccd629c346d81047; parent_hash: 0xe3da…d11b; extrinsics (1): [0x7f45…6999 + ``` -1. Confirm that the local devnet is functioning by using the Rust test interface within the Entropy Core repo: +4. (Optional) Test with the Rust test interface: - ```shell - cargo run -p entropy-test-cli -- --chain-endpoint="ws://127.0.0.1:9944" status + ```bash + cargo run -p entropy-test-cli -- --chain-endpoint="ws://127.0.0.1:9944" status ``` ```output Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.83s - Running `target/debug/entropy-test-cli '--chain-endpoint=ws://127.0.0.1:9944' status` + Running `target/debug/entropy-test-cli '--chain-endpoint=ws://127.0.0.1:9944' status` ... - Hash Stored by: Times used: Size in bytes: Configurable? Has auxiliary? - 0x0000…0000 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 10 300498 true true + Hash Stored by: Times used: Size in bytes: Configurable? Has auxiliary? + 0x0000…0000 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 10 300498 true true Success: Got status That took 182.155ms ``` - If this is the first time you are running the Rust testing interface, the `cargo` command above will take a few minutes to complete. - -1. That's it! +If this is the first time you are running the Rust testing interface, the `cargo` command above will take a few minutes to complete. ## Best Practices -It's important to regularly reset the network to maintain a clean testing environment, thoroughly document all configuration settings for reproducibility, and simulate various network conditions to ensure robustness. +It's important to regularly reset the network to maintain a clean testing environment, thoroughly document all configuration settings for reproducibility, and simulate various network conditions to ensure robustness. -Developers should strive to mirror the mainnet environment as closely as possible while still maintaining flexibility for rapid iteration. If you plan to share access to the devnet, it's essential to establish a clear protocol for managing and distributing test tokens, implement monitoring and logging systems to track network behaviour, and regularly update the devnet software to match planned mainnet upgrades. +Developers should strive to mirror the mainnet environment as closely as possible while still maintaining flexibility for rapid iteration. If you plan to share access to the devnet, it's essential to establish a clear protocol for managing and distributing test tokens, implement monitoring and logging systems to track network behaviour, and regularly update the devnet software to match planned mainnet upgrades. ## Troubleshooting **Cannot connect to the Docker daemon**: If you see the error message `Cannot connect to the Docker daemon at unix:///Users/johnny/.docker/run/docker.sock. Is the docker daemon running?` it's likely because your Docker daemon isn't running. Double-check that you've opened the Docker application. **I can't build from source**: there are quite a few dependencies for building Substrate-based nodes. Run through the [official Substrate documentation](https://docs.substrate.io/install/) and make sure you have everything installed. + +**Permission denied while trying to connect to the Docker daemon socket**: you likely don't have the correct permissions and user-groups set. Verify that the Docker socket file /var/run/docker.sock has the correct permissions. It should be owned by the `root` user and have appropriate permissions for the `docker` group: + + +```shell +sudo chown root:docker /var/run/docker.sock +sudo chmod 0660 /var/run/docker.sock +``` + +Also, make sure that your current user is in the `docker` group: + +```shell +sudo su +usermod -aG docker your_username +``` diff --git a/content/reference/images/entropy-status-page-dark.png b/content/reference/images/entropy-status-page-dark.png new file mode 100644 index 00000000..c4797cba Binary files /dev/null and b/content/reference/images/entropy-status-page-dark.png differ diff --git a/content/reference/images/entropy-status-page.png b/content/reference/images/entropy-status-page.png new file mode 100644 index 00000000..55b6a18e Binary files /dev/null and b/content/reference/images/entropy-status-page.png differ diff --git a/content/reference/images/polkadot-explorer-page-dark.png b/content/reference/images/polkadot-explorer-page-dark.png new file mode 100644 index 00000000..61b11077 Binary files /dev/null and b/content/reference/images/polkadot-explorer-page-dark.png differ diff --git a/content/reference/images/polkadot-explorer-page.png b/content/reference/images/polkadot-explorer-page.png new file mode 100644 index 00000000..517b927a Binary files /dev/null and b/content/reference/images/polkadot-explorer-page.png differ diff --git a/content/reference/images/uptime-entropy-page-dark.png b/content/reference/images/uptime-entropy-page-dark.png new file mode 100644 index 00000000..604feaea Binary files /dev/null and b/content/reference/images/uptime-entropy-page-dark.png differ diff --git a/content/reference/images/uptime-entropy-page.png b/content/reference/images/uptime-entropy-page.png new file mode 100644 index 00000000..06b6298b Binary files /dev/null and b/content/reference/images/uptime-entropy-page.png differ diff --git a/content/reference/tools.md b/content/reference/tools.md index 1b767460..3f76d718 100644 --- a/content/reference/tools.md +++ b/content/reference/tools.md @@ -5,18 +5,26 @@ lead: "A list of useful tools, workflows, and projects that can help developers ## Polkadot Chain Explorer +{{< image src="../images/polkadot-explorer-page.png" >}} + + + [polkadot.js.org/apps](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftestnet.entropy.xyz#/explorer) A one-size-fits-all blockchain explorer for Substrate-based chains, built by the [Polkadot.js team](https://polkadot.js.org/). ## Testnet Status +{{< image src="../images/entropy-status-page.png" >}} + [status.entropy.xyz](https://status.entropy.xyz/) A constantly updated list of registered accounts, programs, and validators. ## Uptime +{{< image src="../images/uptime-entropy-page.png" >}} + [uptime.entropy.xyz](https://entropydotxyz.statuspage.io/) The home of Entropy's real-time and historical data on system performance. diff --git a/i18n/en.yaml b/i18n/en.yaml index 87723947..dea481a0 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -2,7 +2,7 @@ backToTop: "Scroll to top" changeLanguage: "Change language" changeTheme: "Change theme" copyCode: "Copy code" -copyright: "MIT Licensed - Entropy Cryptography Inc." +copyright: "AGPL 3.0 Licensed - Entropy Cryptography Inc." dark: "Dark" editThisPage: "Edit this page on GitHub" lastUpdated: "Last updated on" diff --git a/themes/hextra/layouts/shortcodes/image.html b/themes/hextra/layouts/shortcodes/image.html new file mode 100644 index 00000000..aa3ff744 --- /dev/null +++ b/themes/hextra/layouts/shortcodes/image.html @@ -0,0 +1,16 @@ +{{ $originalSrc := .Get "src" }} +{{ $fileExt := path.Ext $originalSrc }} +{{ $fileName := strings.TrimSuffix $fileExt $originalSrc }} + +{{ $darkSrc := printf "%s-dark%s" $fileName $fileExt }} + + + + {{ .Get +