Skip to content

Commit

Permalink
Update Diagrams and README (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
deblanco authored Oct 8, 2023
1 parent 6fd3d5d commit a80fd8b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 26 deletions.
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.

0 comments on commit a80fd8b

Please sign in to comment.