Gen6_Public_Blockchain/README.md

141 lines
4.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Gen6 Public Blockchain
A customized blockchain built using Substrate, designed to operate independently without relying on a relay chain, but keeping interoperability features.
## Technical Info
**Name:** Gen6 Public Chain
**Internal ID:** g6-solo-chain/107
**G6 SS58 Prefix:** 355
**SS58 Converter to G6 addresses:** [ss58.org](https://ss58.org/)
**Gen6 WSS API:** wss://gen6.app:443/node
**Default CHAIN_PORT:** 9944
**Default RPC_PORT:** 30301
**Explorer:** [PJS Link](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fgen6.app%3A443%2Fnode#/explorer)
**Wallets supported:** SubWallet, PolkadotJS
**Whitepaper:** [Gitbook](https://g6-networks.gitbook.io/g6-networks/)
## Getting Started with Building
Ensure all necessary dependencies are installed according to your platforms [Substrate installation guide.](https://docs.substrate.io/install/)
### Build
Use the following command to build the node without launching it:
```sh
cargo build --release
```
### Single-Node Development Chain
The following command starts a single-node development chain that doesn't
persist state:
```sh
./target/release/g6-solo-node --dev
```
To purge the development chain's state, run the following command:
```sh
./target/release/g6-solo-node purge-chain --dev
```
To start the development chain with detailed logging, run the following command:
```sh
RUST_BACKTRACE=1 ./target/release/g6-solo-node -ldebug --dev
```
### Run with docker
You need to have docker installed on your system
#### Build
```sh
docker compose -f ./docker_g6/compose_files/solo_chain/builder/docker-compose.yml up
```
#### Run
```sh
docker compose -f ./docker_g6/compose_files/solo_chain/runner/docker-compose.yml up
```
#### Run the live chain
- build the chain
- create and insert keys with the generate_validator_keys.sh from the Scripts project
You will have your secrets in a data folder. There are secrets inside which you should NOT share with anybody.
```shell
data
├── aura-sr25519.json
├── chains
│   └── gen6
│   ├── keystore
│   │   ├── 617572617c659be616ee6da553529e8e11081935a09dfd70a2556a972cd32822f916383a
│   │   └── 6772616ed81dd22ce966b9e77060292166f0904a126bd5d8b54db67f7476b0529ce2388b
│   └── network
│   └── secret_ed25519
├── grandpa-ed25519.json
├── node-key-ed25519.json
└── peer-id.txt
```
Run the blockchain
```shell
$SOLO_CHAIN_NODE_EXECUTABLE \
--base-path "$BASE_PATH" \
--chain "$RAW_CHAINSPEC_FILENAME" \
--port "$CHAIN_PORT" \
--rpc-port "$RPC_PORT" \
--validator \
--name "$NODE_NAME"
```
BASE_PATH = the path to the data folder we created with the generate script.
SOLO_CHAIN_NODE_EXECUTABLE = the path to the node executable E.g. <solo_chain_project>/target/release/g6-solo-node
RAW_CHAINSPEC_FILENAME = the raw chainspec. The live raw chainspec is stored in this project
CHAIN_PORT=9944
RPC_PORT=30301
NODE_NAME= any unique name
### Key generation
```sh
./target/release/g6-solo-node key generate --output-type json
```
Example output
```txt
{
"accountId": "0x9e6a8d5406599378f39784cb2f31f8a848d4605177da43d9e1227026a970e51c",
"networkId": "substrate",
"publicKey": "0x9e6a8d5406599378f39784cb2f31f8a848d4605177da43d9e1227026a970e51c",
"secretPhrase": "idle grid torch reflect acid cost whip verify song humble raw lion",
"secretSeed": "0xcd517bc718b16711d41182d98945867ee3eaf65b6dedfaaa1995efc1d5808073",
"ss58Address": "5FeR5LJ8jR6SRXeKXFEn61H2ztWxTw4Vvpz9vRrVdhcpuvKk",
"ss58PublicKey": "5FeR5LJ8jR6SRXeKXFEn61H2ztWxTw4Vvpz9vRrVdhcpuvKk"
}
```
Substrate supports different key types (e.g., sr25519, ed25519, or ecdsa). You can specify the key type using the --scheme flag
```sh
./target/release/g6-solo-node key generate --scheme sr25519 --output-type json
```
Generate Keys for a Specific Network
```sh
./target/release/g6-solo-node key generate --network polkadot
```
Help Command for Details: To explore all available options, use the --help flag:
```sh
./target/release/g6-solo-node key --help
```