-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
815 additions
and
1,396 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
424 changes: 424 additions & 0 deletions
424
.../Tutorials/operate-a-node/run-a-side-chain/request-side-chain-creation/index.md
Large diffs are not rendered by default.
Oops, something went wrong.
95 changes: 95 additions & 0 deletions
95
docs/Tutorials/operate-a-node/run-a-side-chain/running-a-side-chain/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.