diff --git a/README.md b/README.md index 5a0d9944..8c112e5a 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,63 @@ -![stability](docs/media/header.png) +![stability](docs/media/header.jpeg) -Implementation of Stability blockchain in Substrate + Rust, a scalability solution for accessing the gas market. +Built using Substrate and Rust, the Stability blockchain serves as a scalable solution for optimized gas market access. - ⛓️ Read more about [Stability Protocol](https://stabilityprotocol.com) -- 📖 Find more resources in our [Documentation](https://stability.readme.io/docs) -- 🐦 Follow us in [Twitter](https://twitter.com/stabilityinc) +- 📖 Find more resources in our [Documentation](/docs/README.md) +- 🐦 Follow us in [Twitter](https://twitter.com/stabilityinc) and [Medium](https://medium.com/stabilitynetwork) -## Build & Run +## Building and Running -To build the chain, execute the following commands from the project root: +### Compiling the Blockchain -``` -$ cargo build --release +Navigate to the root directory of the project and run the following command to compile the Stability chain: + +```bash +cargo build --release ``` -To execute the chain, run: +### Initiating the Node -``` -$ ./target/release/stability --dev +To start the Stability chain in development mode, execute this command: + +```bash +./target/release/stability --dev ``` -The node also supports to use manual seal (to produce block manually through RPC). -This is also used by the ts-tests: +### Manual Block Sealing -``` -$ ./target/release/stability --dev --manual-seal +For manually sealing blocks via RPC, which is particularly useful for TypeScript tests, use the following command: + +```bash +./target/release/stability --dev --manual-seal ``` -For using a Dockerized solution you can follow the [instructions](docker/README.md) under the `docker/` folder. +### Docker Deployment + +For containerized deployment options, please refer to the Docker [guidelines](docker/README.md) available in the `docker/` directory. ## Architecture -The Stability Substrate chain is based on `polkadot-v0.9.36` using the `frontier` layout. -For building this chain, the next pallets have been imported: +The Stability Substrate chain is built upon Polkadot version `0.9.36` and leverages the `frontier` framework to ensure full Ethereum compatibility. Our architecture incorporates a carefully selected set of pallets, each serving a unique role in the overall functionality of the blockchain. + +### Core Pallets + +#### Consensus Mechanisms + +- **AuRa**: An adaptive and reactive consensus algorithm. +- **GRANDPA**: GHOST-based Recursive Ancestor Deriving Prefix Agreement. + +#### Ethereum Virtual Machine (EVM) + +- **pallet-evm**: Provides EVM functionalities, enabling the execution of Ethereum-based applications. +- **pallet-ethereum**: Ensures compatibility with the Ethereum API. + +### Substrate Native Pallets + +- **session**: Manages session keys and validator sets. +- **timestamp**: Responsible for on-chain timekeeping. +- **collective**: Facilitates governance functionalities. + +### Third-Party Pallets -- Consensus: _AuRa, GRANDPA_ -- EVM: _pallet-evm, pallet-ethereum, pallet-dynamic-fee_ -- Substrate: _balances, session, timestamp, collective, im-online_ -- Moonbeam: _precompile-utils, balances-erc20_ +- **Moonbeam's precompile-utils**: A utility pallet offering precompiled contract support. diff --git a/docs/ZERO-GAS-TRANSACTIONS.md b/docs/ZERO-GAS-TRANSACTIONS.md index 2a9e0fdd..176d21d7 100644 --- a/docs/ZERO-GAS-TRANSACTIONS.md +++ b/docs/ZERO-GAS-TRANSACTIONS.md @@ -5,6 +5,7 @@ - [External Private Mempool](#external-private-mempool) - [Setting up the External Mempool for Validators](#setting-up-the-external-mempool-for-validators) - [3. Other considerations](#3-other-considerations) +- [4. Diagram](#4-diagram) ## 1. Introduction @@ -22,9 +23,9 @@ The validator selects the transactions from an external private mempool. This me ```json { - "transactions": [ - "..." // signed Ethereum transaction in hexadecimal format without the 0x prefix - ] + "transactions": [ + "..." // signed Ethereum transaction in hexadecimal format without the 0x prefix + ] } ``` @@ -38,4 +39,19 @@ If you are a validator and wish to integrate this functionality, you simply need - If the external mempool takes longer than 100ms to respond, the Zero Gas Transactions will be ignored. - If the JSON format returned by the external private mempool is incorrect, the transactions will be ignored. -- It is essential that, to be processed as a Zero Gas Transaction, the `gasPriceLimit` parameter is set to 0. \ No newline at end of file +- It is essential that, to be processed as a Zero Gas Transaction, the `gasPriceLimit` parameter is set to 0. + +## 4. Diagram + +```mermaid +graph TD; + A[User] -->|Create Transaction| B[External Private Mempool] + B -->|POST HTTP Request| C[Validator Node] + D[Other Validators] -.->|Regular Transactions| C + E[Public Mempool] -->|Regular Transactions| C + C -->|Fetch Zero Gas Transactions| B + C -->|Validation Cycle| F[Blockchain] + G[Sponsor] -->|Sponsored Transactions| H[Public Mempool] + H -->|Sponsored Transactions| C + C -->|Include Zero Gas Transactions| F +``` diff --git a/docs/media/header.jpeg b/docs/media/header.jpeg new file mode 100644 index 00000000..aba6094b Binary files /dev/null and b/docs/media/header.jpeg differ diff --git a/docs/media/header.png b/docs/media/header.png deleted file mode 100644 index cbbec0de..00000000 Binary files a/docs/media/header.png and /dev/null differ