Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AelfHarsh committed Jun 26, 2024
1 parent 5a53cbe commit 8124d48
Show file tree
Hide file tree
Showing 9 changed files with 815 additions and 1,396 deletions.
4 changes: 0 additions & 4 deletions docs/Tutorials/operate-a-node/run-a-side-chain/index.md

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
sidebar_position: 1
title: Run a Side Chain
---


# Running a Side Chain (After its Release)

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.

For more information about side chain creation, refer to the document in the [request-side-chain section](request-new-side-chain).

## 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`.

#### appsettings.json

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

#### appsettings.SideChain.MainNet.json

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

```bash
dotnet ../AElf.Launcher.dll
```

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

```bash
aelf-command get-blk-height -e http://127.0.0.1:1235
```
52 changes: 52 additions & 0 deletions docs/Tutorials/operate-a-node/run-aelf-on-cloud/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,55 @@
sidebar_position: 4
title: Run aelf on Cloud
---


# Getting Started with Google Cloud

This guide will walk you through the steps required to run an aelf node on Google Cloud Platform (GCP).

## Step 1: Launch aelf Image

1. Go to the [Google Cloud Marketplace](https://console.cloud.google.com/marketplace) and search for "aelf blockchain for enterprise".

![image](../../../../static/img/gcp-step1.png)

2. Find the aelf image and click on "LAUNCH ON COMPUTE ENGINE".

![image](../../../../static/img/gcp-step2-b.png)

3. Keep the default settings and click "DEPLOY" at the bottom left of the page.

![image](../../../../static/img/gcp-deployed.png)

## Step 2: Access and Start the Chain

1. Login to the launched VM instance via SSH. You can do this by clicking the SSH drop-down and selecting "Open in browser window".

![image](../../../../static/img/gcp-ssh-select.png)

2. In the SSH session, execute `sudo bash` to elevate your privileges.

3. Start the chain with one of the following commands:

- Run it in the foreground:
```bash
cd /opt/aelf-node && docker-compose up
```
- Or run it in the background:
```bash
cd /opt/aelf-node && docker-compose up -d
```

![image](../../../../static/img/gcp-docker-compose.png)

## Step 3: Verify Chain Status

1. To verify that the node is working, use the following command to send an HTTP request and get the current chain status:

```bash
curl -X GET "http://127.0.0.1:8001/api/blockChain/chainStatus" -H "accept: text/plain; v=1.0"
```

![image](../../../../static/img/gcp-curl-chain-stat.png)

2. If everything is working normally, you should see the chain status increase with each request.
Loading

0 comments on commit 8124d48

Please sign in to comment.