Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jul 30, 2024
2 parents b07ccb6 + a9bc03b commit b2634ed
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 141 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.
19 changes: 14 additions & 5 deletions docs/quick-start/developers/vote-contract/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,16 @@ public override ProposalList GetAllProposals(Empty input)

Once you've implemented these two methods and run the unit tests again, you should see that all test cases pass.

### Building Smart Contract

- Build the new code with the following commands inside `src` folder:

```bash title="Terminal"
dotnet build
```

You should see **BuildersDAO.dll.patched** in the directory `src/bin/Debug/net.6.0`

## Step 3 - Deploy Smart Contract

import Deploy from "../\_deploy.md"
Expand Down Expand Up @@ -964,11 +974,10 @@ useEffect(() => {

if (!DAOContract) return;

const proposalResponse =
await (DAOContract?.callViewMethod)<IProposals>(
"GetAllProposals",
""
);
const proposalResponse = await (DAOContract?.callViewMethod)<IProposals>(
"GetAllProposals",
""
);

setProposals(proposalResponse.data);
alert("Fetched Proposals");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
sidebar_position: 1
title: Operations

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

# Operations

**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.
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
---

**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.

## How to Join the Mainnet

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
---

**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.

# How to Join the Testnet

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,16 +1,14 @@
---
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
---

**Description**:
Detailed guidelines and API documentation for creating and managing side chains in the aelf blockchain ecosystem.

**Purpose**: To provide developers with step-by-step instructions and code examples for proposing, approving, and deploying side chains, enhancing scalability and customization within the aelf network.

# Creation of a Side Chain

Side chains can be created in the aelf ecosystem to enable scalability. This section introduces the process in detail.

## Side Chain Creation API
Expand All @@ -25,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 @@ -428,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.

**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

Next, we can move on to [Running a Side Chain](/quick-start/node-operators/running-a-side-chain/).
#### 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,14 +1,13 @@
---
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
---

**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.

# Simulation in the Local Environment

## Set up a Full Node

To simulate BP nodes in a local environment, you need to set up at least three nodes, as a single node cannot become a BP. BP elections occur every 7 days, but for this tutorial, we'll change the term to 120 seconds. Follow the steps below:
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b2634ed

Please sign in to comment.