Skip to content

Commit 13dcbed

Browse files
committed
Merge branch 'development' into cross-execution
2 parents 87007cb + 7538a57 commit 13dcbed

11 files changed

+592
-156
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Custom Configurations
2+
3+
## Sovereign network customisations
4+
5+
The Sovereign Chain SDK is built with flexibility in mind, allowing you to tailor it to your specific needs. This page highlights various customizations you can apply to make your network unique.
6+
7+
### config.toml
8+
9+
- `GeneralSettings.ChainID` - defines your unique chain identifier
10+
- `EpochStartConfig.RoundsPerEpoch` - defines how many round are in each epoch
11+
12+
### economics.toml
13+
14+
- `GlobalSettings.GenesisTotalSupply` - total native ESDT supply at genesis
15+
- `GlobalSettings.YearSettings` - adjust the inflation rate each year
16+
- `FeeSettings` - adjust the fee settings as needed
17+
18+
### ratings.toml
19+
20+
- `General` - adjust the rating parameters as needed
21+
22+
### systemSmartContractsConfig.toml
23+
24+
- `ESDTSystemSCConfig.ESDTPrefix` - the prefix for all issued tokens
25+
- `ESDTSystemSCConfig.BaseIssuingCost` - base cost for issuing a token
26+
- `StakingSystemSCConfig.NodeLimitPercentage` [[docs](https://docs.multiversx.com/validators/staking-v4/#how-does-the-dynamic-node-limitation-work)]
27+
28+
### sovereignConfig.toml
29+
30+
- `GenesisConfig.NativeESDT` - Native ESDT identifier for the Sovereign Chain
31+
32+
### prefs.toml
33+
34+
The `OverridableConfigTomlValues` will overwrite the parameters in the config files. Make sure that your new config parameters are not overwritten by this file.
35+
36+
:::note
37+
These are just a few examples that you can adjust to make the Sovereign Chain unique. All the files you could adjust when creating a Sovereign Chain can be found in the [deployment guide](/sovereign/distributed-setup#step-4-edit-the-sovereign-configuration).
38+
:::
39+
40+
:::note
41+
We will continue to add configurations for features such as token-less chains, gas-less chains, and other customizations at a later stage, following their implementation.
42+
:::

docs/sovereign/deployment.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/sovereign/distributed-setup.md

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
# Distributed Setup
2+
3+
## Create distributed Sovereign Chain configuration
4+
5+
This guide will help you deploy a public Sovereign Chain with real validators, enabling a truly decentralized setup. At its core, blockchain technology—and Sovereign Chains in particular—are designed to operate in a decentralized manner, powered by multiple independent validators. This ensures transparency, security, and resilience, as no single entity has control over the entire system. Unlike other guides we’ve provided, which focus on local setups, this solution emphasizes decentralization by involving multiple stakeholders in the validation process. By following the steps below, the owner can create the Sovereign Chain configuration for the network:
6+
7+
### Step 1: Get the ```mx-chain-go``` Repository
8+
9+
Before proceeding, ensure that a **SSH key** for GitHub is configured on your machine.
10+
11+
1. Clone the GitHub repository:
12+
```bash
13+
git clone [email protected]:multiversx/mx-chain-go.git
14+
```
15+
16+
2. Checkout the specific Sovereign Chain SDK branch and navigate to testnet directory:
17+
```bash
18+
cd mx-chain-go && git fetch && git checkout d699ffd && cd scripts/testnet
19+
```
20+
21+
:::info
22+
`d699ffd` is the commit hash we recommend to be used. If you want to use the latest version you can use the branch `feat/chain-go-sdk`.
23+
:::
24+
25+
### Step 2: Seeder Build
26+
27+
Build and run the seed node
28+
```bash
29+
cd cmd/seednode
30+
go build
31+
./seednode -rest-api-interface 127.0.0.1:9091 -log-level *:DEBUG -log-save
32+
```
33+
34+
You should have an output similar to the one displayed below. The highlighted part is important and will be used later.
35+
36+
| Seednode addresses: |
37+
|---------------------------------------------------------------------------------------------|
38+
| `/ip4/`127.0.0.1`/tcp/10000/p2p/16Uiu2HAmSY5NpuqC8UuFHunJensFbBc632zWnMPCYfM2wNLuvAvL` |
39+
| `/ip4/`192.168.10.100`/tcp/10000/p2p/16Uiu2HAmSY5NpuqC8UuFHunJensFbBc632zWnMPCYfM2wNLuvAvL` |
40+
41+
:::info
42+
All the validator nodes will have to connect to this seed node.
43+
:::
44+
45+
### Step 3: Sovereign node build
46+
47+
Build the sovereign node
48+
```bash
49+
cd ..
50+
cd cmd/sovereignnode/
51+
go build -v -ldflags="-X main.appVersion=v0.0.1"
52+
```
53+
54+
:::info
55+
Use your own custom version instead of `v0.0.1`.
56+
:::
57+
58+
### Step 4: Edit the sovereign configuration
59+
60+
Node configs can be found in `cmd/node/config`. Below are the files and folders:
61+
```
62+
gasSchedules folder
63+
genesisContracts folder
64+
genesis.json*
65+
genesisSmartContracts.json
66+
nodesSetup.json*
67+
api.toml
68+
config.toml
69+
economics.toml
70+
enableEpochs.toml
71+
enableRounds.toml
72+
external.toml
73+
fullArchiveP2P.toml
74+
p2p.toml
75+
prefs.toml
76+
ratings.toml
77+
systemSmartContractsConfig.toml
78+
```
79+
80+
_Note: Files marked with * will be discussed later in the document._
81+
82+
Sovereign configs can be found in `cmd/sovereignnode/config`
83+
```
84+
economics.toml
85+
enableEpochs.toml
86+
prefs.toml
87+
sovereignConfig.toml
88+
```
89+
90+
#### Minimum recommended changes
91+
92+
1. Move the config files from `/node/config` into `/sovereignnode/config`, except _economics.toml_, _enableEpochs.toml_, _prefs.toml_.
93+
2. Config changes:
94+
1. **config.toml**
95+
1. GeneralSettings.ChainID
96+
2. EpochStartConfig.RoundsPerEpoch
97+
2. **p2p.toml**
98+
1. KadDhtPeerDiscovery:InitialPeerList = `[/ip4/PUBLIC_IP/tcp/10000/p2p/16Uiu2HAmSY5NpuqC8UuFHunJensFbBc632zWnMPCYfM2wNLuvAvL]`
99+
- PUBLIC_IP is the IP of the machine where seed node is running, the other part is seed node address
100+
3. **systemSmartContractsConfig.toml**
101+
1. ESDTSystemSCConfig.ESDTPrefix
102+
2. StakingSystemSCConfig.NodeLimitPercentage [[docs](https://docs.multiversx.com/validators/staking-v4/#how-does-the-dynamic-node-limitation-work)]
103+
4. **sovereignConfig.toml**
104+
1. GenesisConfig.NativeESDT
105+
3. Other changes:
106+
- Use the [custom configuration](/sovereign/custom-configurations) page to see more configs we recommend to be changed
107+
108+
### Step 5: Genesis configuration
109+
110+
#### `genesis.json`
111+
112+
This file should contain all the genesis addresses that will be funded and will be validators. Adjust as needed.
113+
114+
:::note
115+
The sum of `supply` should be equal to `GenesisTotalSupply` from economics.toml
116+
:::
117+
118+
Example with 2 validators:
119+
```
120+
[
121+
{
122+
"address": "erd1a2jq3rrqa0heta0fmlkrymky7yj247mrs54g6fyyx8dm45menkrsmu3dez",
123+
"supply": "10000000000000000000000000",
124+
"balance": "9997500000000000000000000",
125+
"stakingvalue": "2500000000000000000000",
126+
"delegation": {
127+
"address": "",
128+
"value": "0"
129+
}
130+
},
131+
{
132+
"address": "erd1pn564xpwk4anq9z50th3ae99vplsf7d2p55cnugf00eu0gcq6gdqcg7ytx",
133+
"supply": "10000000000000000000000000",
134+
"balance": "9997500000000000000000000",
135+
"stakingvalue": "2500000000000000000000",
136+
"delegation": {
137+
"address": "",
138+
"value": "0"
139+
}
140+
}
141+
]
142+
```
143+
144+
#### `nodesSetup.json`
145+
146+
This file contains all the initial nodes. Adjust as needed.
147+
148+
:::note
149+
- `consensusGroupSize` should be equal to `minNodesPerShard`
150+
- each node pair contains one genesis address associated with a validator public key
151+
- `startTime` should be a timestamp from the future, the time when the network will start
152+
- `roundDuration` is the duration in milliseconds per round
153+
- `metaChainConsensusGroupSize` and `metaChainMinNodes` should always be 0
154+
:::
155+
156+
Example:
157+
```
158+
{
159+
"startTime": 1733138599,
160+
"roundDuration": 6000,
161+
"consensusGroupSize": 2,
162+
"minNodesPerShard": 2,
163+
"metaChainConsensusGroupSize": 0,
164+
"metaChainMinNodes": 0,
165+
"hysteresis": 0,
166+
"adaptivity": false,
167+
"initialNodes": [
168+
{
169+
"pubkey": "6a1ee46baa8da9279f53addbfbc61a525604eb42d964bd3a25bf7f34097c3b3a31706728718ccdbe3d43386c37ec3011df6ceb4188e14025ab149bd568cafaba18a78b51e71c24046c5276a187a6c1d6da83e30590a6025875b8f6df8984ec05",
170+
"address": "erd1a2jq3rrqa0heta0fmlkrymky7yj247mrs54g6fyyx8dm45menkrsmu3dez",
171+
"initialRating": 0
172+
},
173+
{
174+
"pubkey": "40f3857218333f0b2ba8592fc053cbaebec8e1335f95957c89f6c601ce0758372ba31c30700f10f25202d8856bb948055f9f0ef53dea57b62f013ee01c9dc0346a2b3543f2b4d423166ee1981b310f2549fb879d4cd89de6c392d902a823d116",
175+
"address": "erd1pn564xpwk4anq9z50th3ae99vplsf7d2p55cnugf00eu0gcq6gdqcg7ytx",
176+
"initialRating": 0
177+
}
178+
]
179+
}
180+
```
181+
182+
___
183+
184+
:::note
185+
At this point, a `config` folder should be created that will contain all the .toml files and genesis configuration. This folder should be shared with the other validators so they will be able to join the network.
186+
:::
187+
188+
## Join a Sovereign Chain as validator/observer
189+
190+
### Sovereign validator setup
191+
192+
Each validator should have:
193+
- **walletKey.pem** - wallet that will be funded at genesis [[docs](/validators/key-management/wallet-keys)]
194+
- **validatorKey.pem** (or **allValidatorsKey.pem** if multi key node) - validator key [[docs](/validators/key-management/validator-keys/#how-to-generate-a-new-key)]
195+
- **config** folder - received from Sovereign Chain creator
196+
197+
### Sovereign validator/observer node start
198+
199+
The following commands will start the sovereign validator node with the configuration from **config** folder and with the **validatorKey** (or multi key from **allValidatorsKey**).
200+
Adjust the flags as needed. You can find all the available flags in `/mx-chain-go/cmd/sovereignnode/flags.go`
201+
202+
#### # single key
203+
```
204+
./sovereignnode --validator-key-pem-file ./config/validatorKey.pem --profile-mode --log-save --log-level *:INFO --log-logger-name --log-correlation --use-health-service --rest-api-interface :8080 --working-directory ~/my_validator_node
205+
```
206+
207+
#### # multi key
208+
```
209+
./sovereignnode --all-validator-keys-pem-file ./config/allValidatorsKey.pem --profile-mode --log-save --log-level *:INFO --log-logger-name --log-correlation --use-health-service --rest-api-interface :8080 --working-directory ~/my_validator_node
210+
```
211+
212+
#### # observer
213+
```
214+
./sovereignnode --profile-mode --log-save --log-level *:INFO --log-logger-name --log-correlation --use-health-service --rest-api-interface :8080 --working-directory ~/my_observer_node
215+
```
216+
217+
### Staking transaction
218+
219+
Before staking, a node is a mere observer. After staking, the node becomes a validator, which means that it will be eligible for consensus and will earn rewards. You can find the documentation how to make the staking transaction with mxpy [here](/validators/staking#staking-through-mxpy).
220+
221+
## Deploy services
222+
223+
You can find the documentation on how to deploy services [here](/sovereign/services).

0 commit comments

Comments
 (0)