Skip to content

Commit

Permalink
fix: quick start section
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jul 30, 2024
1 parent 0826ede commit a9bc03b
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 130 deletions.
11 changes: 5 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ aelf is a high-performance, cloud-native, layer-1 blockchain with Mainnet nodes
- [Lottery Game](/quick-start/developers/lottery-game-smart-contract/) contract
- [Vote](/quick-start/developers/vote-contract/) contract
- For node operators
- [Operations](/quick-start/node-operators/operations/)
- [Run a testnet](/quick-start/node-operators/run-a-testnet-node/) node
- [Run a mainnet](/quick-start/node-operators/run-a-mainnet-node/) node
- [Simulate](/quick-start/node-operators/simulation-in-local-environment/) in your local environment
- [Create](/quick-start/node-operators/creation-of-a-side-chain/) a side chain
- [Run](/quick-start/node-operators/running-a-side-chain/) a side chain
- [Simulate](/quick-start/node-operators/simulating-a-bp-node/) a BP node
- [Set up](/quick-start/node-operators/set-up-a-node-on-testnet/) a node on testnet
- [Set up](/quick-start/node-operators/set-up-a-node-on-mainnet/) a node on mainnet
- [Apply](/quick-start/node-operators/apply-to-be-a-bp/) to be a BP
- [Set up](/quick-start/node-operators/set-up-a-side-chain/) a side chain

</article>

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/cross-chain/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Side chains are isolated but still need a way to interact with each other. To en
The following sections of this documentation will provide:

- An overview of the [architecture](/learn/cross-chain/architecture/) of aelf's side chains.
- A guide explaining how to set up a [main-chain](/quick-start/node-operators/run-a-mainnet-node) and a [side chain](/quick-start/node-operators/running-a-side-chain/) node.
- A guide explaining how to set up a [main-chain](/quick-start/node-operators/set-up-a-node-on-mainnet) and a [side chain](/quick-start/node-operators/set-up-a-side-chain/) node.
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
---
sidebar_position: 1
title: Operations

sidebar_position: 4
title: Apply to be a BP
description: Participate in BP election
---

**Description**: Guidelines for setting up nodes and participating in the Block Producer (BP) election process in the aelf blockchain ecosystem.

**Purpose**: To provide step-by-step instructions for users to become Block Producers, participate in BP elections, and understand the voting and election outcomes within the aelf network.

# Operations

## Steps to Become a BP

1. Set up nodes.
Expand All @@ -28,7 +26,7 @@ title: Operations

### Set up Nodes

aelf doesn't have light nodes, so all nodes are full nodes. [Click here](/quick-start/node-operators/run-a-mainnet-node/) to learn how to set up a full node.
aelf doesn't have light nodes, so all nodes are full nodes. [Click here](/quick-start/node-operators/set-up-a-node-on-mainnet/) to learn how to set up a full node.

**Note:** To become a BP, you need to run individual nodes for both MainChain aelf and all the SideChains.

Expand All @@ -54,4 +52,4 @@ BPs are elected every seven days, starting at 7:23 (UTC) every Thursday. If your

## Simulate in Local Environment

To try setting up a node and running as a BP locally, follow the instructions [here](/quick-start/node-operators/simulation-in-local-environment/) to simulate it in the local environment.
To try setting up a node and running as a BP locally, follow the instructions [here](/quick-start/node-operators/simulating-a-bp-node/) to simulate it in the local environment.
96 changes: 0 additions & 96 deletions docs/quick-start/node-operators/running-a-side-chain/index.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
---
sidebar_position: 2
title: Run a Mainnet Node
sidebar_position: 3
title: Set up a node on mainnet
description: Configuration, deployment & maintenance
---

## How to Join the Mainnet

**Description**: Instructions on how to join the aelf mainnet by setting up and running a node using Docker or binaries, along with necessary configuration and database setup.

**Purpose**: To guide users through the process of configuring, deploying, and maintaining an aelf mainnet node, ensuring proper setup for node communication and blockchain synchronization.

There are two ways to run an aelf node: using Docker (recommended) or running binaries from GitHub. Before starting, you need to install some tools and frameworks. Command line instructions are provided for most dependencies. For complex needs, see the [environment setup](/tools/smart-contract-templates/development-environment/) section.
There are two ways to run an aelf node: using Docker (recommended) or running binaries from GitHub. Before starting, you need to install some tools and frameworks. Command line instructions are provided for most dependencies. For complex needs, see the [environment setup](/tools/setup-local-environment/node-operator/) section.

### Steps to Set Up a Node

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
---
sidebar_position: 1
title: Run a Testnet Node
sidebar_position: 2
title: Set up a node on testnet
description: How to join Testnet
---

# How to Join the Testnet

**Description**: Instructions for setting up and running an aelf testnet node using Docker or binaries, including database setup and configuration.

**Purpose**: To provide detailed guidance on configuring, deploying, and maintaining an aelf testnet node, facilitating testing and development of decentralized applications.

You can run an aelf node using Docker (recommended) or GitHub binaries.
Before starting, install the necessary tools and frameworks. Detailed instructions are in the [environment setup](/tools/smart-contract-templates/development-environment/) section.
Before starting, install the necessary tools and frameworks. Detailed instructions are in the [environment setup](/tools/setup-local-environment/node-operator/) section.

## Steps to Set Up a Node:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
sidebar_position: 4
title: Creation of a Side Chain
description: How to create a side chain ?
sidebar_position: 5
title: Set up a side chain
description: Proposing, approving & deploying side chains
---
# Creation of a Side Chain

**Description**:
Detailed guidelines and API documentation for creating and managing side chains in the aelf blockchain ecosystem.
Expand All @@ -24,7 +23,7 @@ Upon creating a new proposal for the side chain, the `ProposalCreated` event con

Once the side chain is created, the `SideChainCreatedEvent` containing the chain ID will be fired.

The side chain node can be launched once it is created on the main chain. Ensure the side chain ID from the creation result is configured correctly before launching the side chain node. Make sure the cross-chain communication context is correctly set, as the side chain node will request main chain node for chain initialization data. For more details, check the [side chain node running tutorial](/quick-start/node-operators/running-a-side-chain/).
The side chain node can be launched once it is created on the main chain. Ensure the side chain ID from the creation result is configured correctly before launching the side chain node. Make sure the cross-chain communication context is correctly set, as the side chain node will request main chain node for chain initialization data.

## Side Chain Types

Expand Down Expand Up @@ -427,6 +426,91 @@ createSideChain().then(() => {

**Note**: Replace the placeholders in the script with actual values and logic for your use case.

## Running a Side Chain

**Description**: A tutorial on how to configure and run a side chain node in the aelf blockchain ecosystem after its creation has been approved.

Next, we can move on to [Running a Side Chain](/quick-start/node-operators/running-a-side-chain/).
**Purpose**: To guide developers through the setup and launch process of a side chain node, ensuring correct configuration and successful integration with the main chain.

This tutorial explains how to run a side chain node after it has been approved by the producers and released by the creator. After creating the side chain, producers need to run a side chain node.

### Prerequisites

- You already have a main-chain node running.
- The creation of the side chain has been approved and released.

### Important Note

The key-pair (account) used for mining on the side chain must be the same as the one used on the main-chain node. Both production nodes need to be launched with the same key-pair.

### Side Chain Configuration

#### Configuration Files

Two configuration files must be placed in the configuration folder of the side chain, from which you will launch the node:

- `appsettings.json`
- `appsettings.SideChain.MainNet.json`

#### Chain ID and Settings

After the release of the side chain creation request, the ChainId of the new side chain will be accessible in the SideChainCreatedEvent logged by the transaction that released it.

In this example, we will set up the side chain node with ChainId `tDVV` (1866392 converted to base58), connecting to Redis `db2`, and using web API port `1235`. Don’t forget to change the `account`, `password`, and `initial miner`.


```json title="appsettings.json"
{
"ChainId": "tDVV",
"ChainType": "SideChain",
"NetType": "MainNet",
"ConnectionStrings": {
"BlockchainDb": "redis://localhost:6379?db=2",
"StateDb": "redis://localhost:6379?db=2"
},
"Account": {
"NodeAccount": "YOUR PRODUCER ACCOUNT",
"NodeAccountPassword": "YOUR PRODUCER PASSWORD"
},
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://*:1235/"
}
}
},
"Consensus": {
"MiningInterval": 4000,
"StartTimestamp": 0
}
}
```

```json title="appsettings.SideChain.MainNet.json"
{
"CrossChain": {
"Grpc": {
"ParentChainServerPort": 5010,
"ListeningPort": 5000,
"ParentChainServerIp": "127.0.0.1"
},
"ParentChainId": "AELF"
}
}
```

Change `ParentChainServerIp` and `ParentChainServerPort` depending on the listening address of your mainchain node.

### Launching the Side Chain Node

Open a terminal and navigate to the folder where you created the side chain configuration:

```sh title="Terminal"
dotnet ../AElf.Launcher.dll
```

You can try out a few commands from another terminal to check if everything is fine, for example:

```sh title="Terminal"
aelf-command get-blk-height -e http://127.0.0.1:1235
```
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
sidebar_position: 3
title: Simulation in the Local Environment
sidebar_position: 1
title: Simulating a BP node
description: Running BP nodes in a local environment
---

# Simulation in the Local Environment

**Description**: A guide for simulating a block producer (BP) election and running BP nodes in a local environment within the aelf blockchain ecosystem.

**Purpose**: To instruct developers on how to set up, configure, and manage multiple nodes, participate in BP elections, and perform key operations for local environment simulations.
Expand Down

0 comments on commit a9bc03b

Please sign in to comment.