From 11b4bfe176949926eb215e4b683c73f1f1a65313 Mon Sep 17 00:00:00 2001 From: Kelvin Steiner Date: Wed, 1 May 2024 16:45:57 -0300 Subject: [PATCH] Cleaning old files --- .editorconfig | 20 ++--- CODEOWNERS | 1 - LICENSE | 34 +++----- README.md | 83 ++++++++++++++------ .env => old/.env | 2 +- docker-compose.yml => old/docker-compose.yml | 0 {scripts => old/scripts}/docker_run.sh | 0 {scripts => old/scripts}/docker_unsudo.sh | 0 {scripts => old/scripts}/install_rust_env.sh | 0 {scripts => old/scripts}/localnet.sh | 0 {scripts => old/scripts}/localnet_setup.sh | 0 {specs => old/specs}/bro.json | 0 {specs => old/specs}/dev.json | 0 {specs => old/specs}/fam.json | 0 {specs => old/specs}/test.json | 0 support_install.sh => old/support_install.sh | 0 16 files changed, 82 insertions(+), 58 deletions(-) delete mode 100644 CODEOWNERS rename .env => old/.env (76%) rename docker-compose.yml => old/docker-compose.yml (100%) rename {scripts => old/scripts}/docker_run.sh (100%) rename {scripts => old/scripts}/docker_unsudo.sh (100%) rename {scripts => old/scripts}/install_rust_env.sh (100%) rename {scripts => old/scripts}/localnet.sh (100%) rename {scripts => old/scripts}/localnet_setup.sh (100%) rename {specs => old/specs}/bro.json (100%) rename {specs => old/specs}/dev.json (100%) rename {specs => old/specs}/fam.json (100%) rename {specs => old/specs}/test.json (100%) rename support_install.sh => old/support_install.sh (100%) diff --git a/.editorconfig b/.editorconfig index 5adac74ca..ee0c5db76 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,16 +1,16 @@ root = true [*] -indent_style=space -indent_size=2 -tab_width=2 -end_of_line=lf -charset=utf-8 -trim_trailing_whitespace=true +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true insert_final_newline = true +indent_style = space +indent_size = 4 +tab_width = 4 [*.{rs,toml}] -indent_style=tab -indent_size=tab -tab_width=4 -max_line_length=100 +max_line_length = 100 + +[Makefile] +indent_style = tab diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index 5fefbd608..000000000 --- a/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @sacha-l @lisa-parity diff --git a/LICENSE b/LICENSE index cf1ab25da..d93022fb3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,24 +1,16 @@ -This is free and unencumbered software released into the public domain. +MIT No Attribution -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. +Copyright 2024 communeai.org -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 60e8cedf0..c8c2765aa 100644 --- a/README.md +++ b/README.md @@ -5,31 +5,39 @@ [![Build Status](https://img.shields.io/travis/com/paritytech/substrate/master?label=stable)](https://travis-ci.com/paritytech/substrate) [![Coverage Status](https://img.shields.io/codecov/c/gh/paritytech/substrate?label=coverage)](https://codecov.io/gh/paritytech/substrate) -Subspace is a FRAME-based [Substrate](https://substrate.io/) blockchain node that provides the foundation for [Commune's](https://www.communeai.org/) network. It serves as the trusted base layer responsible for consensus, module advertising, and peer discovery. +Subspace is a FRAME-based [Substrate](https://substrate.io/) blockchain node +that provides the foundation for [Commune's](https://www.communeai.org/) +network. It serves as the trusted base layer responsible for consensus, module +advertising, and peer discovery. ## Table of Contents + - [Overview](#overview) - [System Requirements](#system-requirements) -- [Installation](#installation) +- [Installation](#installation) - [Usage](#usage) - [Build](#build) - [Run](#run) - [Test](#test) - [Architecture](#architecture) - [Contributing](#contributing) -- [License](#license) -- [Acknowledgements](#acknowledgements) +- [Acknowledgments](#acknowledgments) ## Overview -Subspace is built using [Substrate](https://substrate.io/), a framework for developing scalable and upgradeable blockchains. It provides the core functionality and security needed for Commune's platform: -1. Implements Commune's consensus mechanism -2. Advertises cluster modules and their IP addresses + +Subspace is built using [Substrate](https://substrate.io/), a framework for +developing scalable and upgradeable blockchains. It provides the core +functionality and security needed for Commune's platform: + +1. Implements Commune's consensus mechanism +2. Advertises cluster modules and their IP addresses 3. Enables peer discovery for nodes to connect with each other ## System Requirements -- Supported OSs: Linux, MacOS + +- Supported OSs: Linux, MacOS - Supported Architectures: x86_64 -- Memory: ~ 286MB +- Memory: ~ 286MB - Disk: ~500MB - Network: Public IPv4 address, TCP ports 9944, 30333 open @@ -38,7 +46,8 @@ Subspace is built using [Substrate](https://substrate.io/), a framework for deve 1. Complete the [basic Rust setup instructions](./docs/rust-setup.md). 2. Clone this repository: -```bash + +```sh git clone https://github.com/commune-network/subspace.git cd subspace/ ``` @@ -46,26 +55,34 @@ cd subspace/ ## Usage ### Build + To build the node without launching it, run: -```bash + +```sh cargo build --release ``` ### Run + To run a single development node with ephemeral storage: -```bash + +```sh ./target/release/node-subspace --dev ``` -This will start a Subspace node with a clean state. The node's state will be discarded on exit. + +This will start a Subspace node with a clean state. The node's state will be +discarded on exit. To retain the node's state between runs, specify a base path: -```bash + +```sh mkdir my-chain-state/ ./target/release/node-subspace --dev --base-path ./my-chain-state/ ``` Other useful commands: -```bash + +```sh # Purge chain state ./target/release/node-subspace purge-chain --dev @@ -77,35 +94,51 @@ RUST_BACKTRACE=1 ./target/release/subspace-ldebug --dev ``` ### Test + To run all tests: -```bash + +```sh cargo test --all ``` To run specific tests: -```bash + +```sh cargo test -p pallet-subspace --test test_voting ``` To run tests with detailed logs: -```bash + +```sh SKIP_WASM_BUILD=1 RUST_LOG=runtime=debug cargo test -- --nocapture ``` ## Architecture -Subspace leverages the modular and extensible architecture of Substrate. It uses FRAME pallets to encapsulate domain-specific logic such as consensus, storage, and p2p networking. + +Subspace leverages the modular and extensible architecture of Substrate. It uses +FRAME pallets to encapsulate domain-specific logic such as consensus, storage, +and p2p networking. Notable components: -- `/node`: Implementation of the Subspace node including networking, consensus, and RPC + +- `/node`: Implementation of the Subspace node including networking, consensus, and RPC - `/runtime`: The core blockchain logic responsible for validating and executing state transitions - `/pallets`: Custom FRAME pallets with Commune-specific logic -## Contributing -We welcome contributions to Subspace! Feel free to submit issues, fork the repository and send pull requests. +## Contributing -Please make sure your code follows the house coding style and passes all tests before submitting. See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for detailed guidelines. +We welcome contributions to Subspace! Feel free to submit issues, fork the +repository and send pull requests. -Join our [Discord community](https://discord.gg/communeai) to discuss the project, ask questions and meet other contributors. +Please make sure your code follows the house coding style and passes all tests +before submitting. See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for detailed +guidelines. + +Join our [Discord community](https://discord.gg/communeai) to discuss the +project, ask questions and meet other contributors. ## Acknowledgments -Special thanks to the teams at [Parity Technologies](https://www.parity.io/) and [Web3 Foundation](https://web3.foundation/) for their work on Substrate and FRAME. \ No newline at end of file + +Special thanks to the teams at [Parity Technologies](https://www.parity.io/) and +[Web3 Foundation](https://web3.foundation/) for their work on Substrate and +FRAME. diff --git a/.env b/old/.env similarity index 76% rename from .env rename to old/.env index 692ff8c81..30fae2029 100644 --- a/.env +++ b/old/.env @@ -1,3 +1,3 @@ NODE_DIR=/subspace/node CONTRACT_DIR=/subspace/contract -SUBSPACE_PATH=./ \ No newline at end of file +SUBSPACE_PATH=./ diff --git a/docker-compose.yml b/old/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to old/docker-compose.yml diff --git a/scripts/docker_run.sh b/old/scripts/docker_run.sh similarity index 100% rename from scripts/docker_run.sh rename to old/scripts/docker_run.sh diff --git a/scripts/docker_unsudo.sh b/old/scripts/docker_unsudo.sh similarity index 100% rename from scripts/docker_unsudo.sh rename to old/scripts/docker_unsudo.sh diff --git a/scripts/install_rust_env.sh b/old/scripts/install_rust_env.sh similarity index 100% rename from scripts/install_rust_env.sh rename to old/scripts/install_rust_env.sh diff --git a/scripts/localnet.sh b/old/scripts/localnet.sh similarity index 100% rename from scripts/localnet.sh rename to old/scripts/localnet.sh diff --git a/scripts/localnet_setup.sh b/old/scripts/localnet_setup.sh similarity index 100% rename from scripts/localnet_setup.sh rename to old/scripts/localnet_setup.sh diff --git a/specs/bro.json b/old/specs/bro.json similarity index 100% rename from specs/bro.json rename to old/specs/bro.json diff --git a/specs/dev.json b/old/specs/dev.json similarity index 100% rename from specs/dev.json rename to old/specs/dev.json diff --git a/specs/fam.json b/old/specs/fam.json similarity index 100% rename from specs/fam.json rename to old/specs/fam.json diff --git a/specs/test.json b/old/specs/test.json similarity index 100% rename from specs/test.json rename to old/specs/test.json diff --git a/support_install.sh b/old/support_install.sh similarity index 100% rename from support_install.sh rename to old/support_install.sh