Private KardiaChain Network
KardiaChain Official User Guide for Setting Up Local or Private BlockChain

System Requirement:

Recommending using Cloud compute service with the following requirements.

Hardware requirement and Function:

Function
Nodes
CPU (Cores)
RAM (GB)
SSD Storage (GB)
KardiaChain Network-BlockChain Network-Backend-DB-Explorer
6
16
8
512
Kubernetes Services
1
16
64
1,000
Frontend
1
4
8
256
Elastic Search
3
4
8
512
DB+Caching
3
4
8
512

OS Requirements:

Operating system: CentOS or Ubuntu (manual compiling and build) or with Docker Compose installed.
Internet Requirement:
Bandwidth: 1GBps

Firewall:

Port open: TCP/UDP 3000 (internet exposure), TCP 8545 (for JSON RPC).

Preparing Environment for KardiaChain Network

When the system or cloud instance is ready, proceeding with the following steps for preparing the environment.

Installing go-kardia

From Source

You'll need go installed and the required environment variables set, which can be done with the following commands:
1
export GOPATH=$HOME/go
2
export PATH=$PATH:$GOPATH/bin
3
Copied!

Get Source Code

1
git clone https://github.com/kardiachain/go-kardia.git $GOPATH
Copied!

Direct Installation

Prerequisites

Install libzmq

Compiling and Installing

1
cd $GOPATH/src/github.com/kardiachain/go-kardia/cmd
2
go install
3
Copied!
Notes: the latest cmd command is now installed.

Docker Installation

Prerequisites

Install Docker following the installation guide for Linux OS
Install docker compose

Installation Files:

Download the following file docker-compose.yaml, genesis_devnet.yaml

Compiling and Installing

1
docker-compose build
2
docker-compose up -d
Copied!

Configuring KardiaChain Nodes

Configuration file will be stored in YAML file. Download the following config node1.yaml, node2.yaml, node3.yaml. Below is the example of the Config file.
1
Node:
2
Name: node1 # Name of node
3
DataDir: /root/.kardia # Location of data storage
4
HTTPHost: 0.0.0.0
5
HTTPPort: 8545 # RPC Port
6
HTTPModules:
7
- node
8
- kai
9
- tx
10
- account
11
HTTPVirtualHosts:
12
- 0.0.0.0
13
- localhost
14
- "*"
15
HTTPCors:
16
- "*"
17
P2P:
18
PrivateKey: #Your private key
19
ListenAddress: tcp://0.0.0.0:3000
20
MaxPeers: 25
21
LogLevel: info # crit, error, warn, info, debug, trace
22
Metrics: 1
23
MainChain:
24
ServiceName: KARDIA
25
ChainId: 1
26
NetworkId: 10000
27
AcceptTxs: 1 # accept tx sync process or not (1 is yes, 0 is no)
28
Seeds:
29
- # Seed node [email protected]<ip>:<port>
30
- # Seed node [email protected]<ip>:<port>
31
- # Seed node [email protected]<ip>:<port>
32
Database:
33
Dir: chaindata # directory stores leveldb
34
Cache: 16 # cache is used in leveldb
35
Handles: 32 # handles is used in leveldb
36
Drop: 1 # Specify whether drop database or not (0 is no, 1 is yes)
37
Below is example config file to run Kardia network:
38
39
Mainnet (coming soon)
40
Testnet
41
Config file​
42
43
Local
44
Config file​
45
46
Previous
47
Deployment
48
Next
49
Local
50
51
Last updated 4 months ago
52
WAS THIS PAGE HELPFUL?
53
CONTENTS
54
Mainnet (coming soon)
55
Testnet
56
Copied!
Notes: Following the example above to modify information which match each Node function.

Run KardiaChain Network

For Direct

1
./cmd --network devnet --node <path/to/kai_config_devnet_node1.yaml>
2
./cmd --network devnet --node <path/to/kai_config_devnet_node2.yaml>
3
./cmd --network devnet --node <path/to/kai_config_devnet_node3.yaml>
Copied!

For Docker

1
docker-compose ps
Copied!
1
docker logs -f --tail 10 node1
2
docker logs -f --tail 10 node2
3
docker logs -f --tail 10 node3
Copied!
Notes: logs showed the status of each node.

KardiaChain Explorer Frontend

Development

Prerequisites

NodeJs v12.18.4

Start Developing

  • Clone from the above project link
  • Run npm install
  • Run npm start

Build

Run npm run build

KardiaChain Explorer Backend

Setup

  • Generate github_private_token with repo permission and set as GITHUB_TOKEN variables in your system.
  • Run make all
  • Checkout Makefile for more command and use what you need

Project Structure

  • --- api: define API for FE
  • --- cfg: define base configuration
  • --- cmd: all entry point here
  • --- contracts: ERC20 and smc
  • --- deployments: docker-compose and dockerfile for deploy/develop
  • --- features: BDD |--- kardia: kardia client implement
  • --- metrics: custom metrics for tracking/monitor
  • --- scripts: scripting for execute
  • --- server: logic/db server
  • --- tools: tools for develop
  • --- types
  • --- utils: collections utilities function
Last modified 7mo ago