Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Diagrams and README #127

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 45 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
24 changes: 20 additions & 4 deletions docs/ZERO-GAS-TRANSACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
]
}
```

Expand All @@ -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.
- 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
```
Binary file added docs/media/header.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/header.png
Binary file not shown.
Loading