KardiaChain Docs
  • Introduction
  • Technology
    • Consensus
    • Kardia Virtual Machine (KVM)
    • Kardia Smart Contract Markup Language
    • Peer to Peer (P2P)
    • Onchain AI
    • NF3 Chip
  • For Users
    • KardiaChain Proposer Validator Selection Process
    • Staking
      • Validators
      • Delegators
      • Disciplines and Rewards
        • Disciplines
        • Rewards
    • Transaction Fee
    • Wallets
      • MetaMask Compatible
      • KardiaChain Mobile App Wallet
      • [Deprecated] KardiaChain Web Wallet
        • [Deprecated] KardiaChain Wallet Extension
  • For Developers
    • Tutorials
      • Platform
        • Running KardiaChain node
        • Private KardiaChain Network
        • KAI Integration for Exchanges
      • Smart contract development
        • Dev environment
          • Solidity
          • IDE and tools
            • Remix
            • Hardhat
            • Truffle
        • Contract verification
      • KRC20 Tokens
        • Deploying KRC20 Token
        • KRC20 token verification
      • KRC721 Tokens
        • Deploy KRC721 tokens
      • Building DApp
        • Frontend
        • Data indexing service
    • SDK
      • Web3
      • [Deprecated] KardiaChain JS SDK
      • [Deprecated] KardiaChain Golang SDK
    • RPC
      • JSON RPC API
    • KardiaID Service
      • KardiaID Service Design
      • KardiaID Service API
  • Archived Docs
    • Golang SDK
    • Network
    • KVM
    • System requirement
    • Deployment
      • Configuration
      • Local
      • Public testnet
      • Mainnet
    • KSML
    • Staking Overview
      • Delegation period
      • Consensus
      • Delegator
        • What is a delegator ?
        • Choose validator
        • Directive of delegator
        • Risk
      • Proposer selection procedure
      • Staking rewards and distributions
        • Block reward distributed
        • Fee distributed
      • Slashing and Jail
      • Rewards mechanism
      • Validator
        • What is a validator ?
        • The different states a validator
        • The responsibility of validator
        • The incentive run a validator
        • To become validator
    • KardiaChain Metamask (extension) Wallet
Powered by GitBook
On this page
  • System Requirement:
  • Hardware requirement and Function:
  • OS Requirements:
  • Firewall:
  • Preparing Environment for KardiaChain Network
  • Installing go-kardia
  • Direct Installation
  • Docker Installation
  • Configuring KardiaChain Nodes
  • Run KardiaChain Network
  • For Direct
  • For Docker
  • KardiaChain Explorer Frontend
  • Development
  • KardiaChain Explorer Backend
  • Setup
  • Project Structure

Was this helpful?

  1. For Developers
  2. Tutorials
  3. Platform

Private KardiaChain Network

KardiaChain Official User Guide for Setting Up Local or Private BlockChain

PreviousRunning KardiaChain nodeNextKAI Integration for Exchanges

Last updated 4 years ago

Was this helpful?

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.

Linux OS:

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

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

Get Source Code

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

Direct Installation

Prerequisites

Compiling and Installing

cd $GOPATH/src/github.com/kardiachain/go-kardia/cmd
go install

Notes: the latest cmd command is now installed.

Docker Installation

Prerequisites

Install Docker following the installation guide for Linux OS

Installation Files:

Compiling and Installing

docker-compose build
docker-compose up -d

Configuring KardiaChain Nodes

Node:
  Name: node1 # Name of node
  DataDir: /root/.kardia # Location of data storage
  HTTPHost: 0.0.0.0
  HTTPPort: 8545 # RPC Port
  HTTPModules:
    - node
    - kai
    - tx
    - account
  HTTPVirtualHosts:
    - 0.0.0.0
    - localhost
    - "*"
  HTTPCors:
    - "*"
  P2P:
    PrivateKey: #Your private key
    ListenAddress: tcp://0.0.0.0:3000
    MaxPeers: 25
  LogLevel: info           # crit, error, warn, info, debug, trace
  Metrics: 1
MainChain:
  ServiceName: KARDIA
  ChainId: 1
  NetworkId: 10000
  AcceptTxs: 1       # accept tx sync process or not (1 is yes, 0 is no)
  Seeds:
    - # Seed node 1@<ip>:<port>
    - # Seed node 2@<ip>:<port>
    - # Seed node 3@<ip>:<port>
  Database:
    Dir: chaindata                           # directory stores leveldb
    Cache: 16                                # cache is used in leveldb
    Handles: 32                              # handles is used in leveldb
    Drop: 1                                  # Specify whether drop database or not (0 is no, 1 is yes)
Below is example config file to run Kardia network:

Mainnet (coming soon)
Testnet
Config file​

Local
Config file​

Previous
Deployment
Next
Local

Last updated 4 months ago
WAS THIS PAGE HELPFUL?
CONTENTS
Mainnet (coming soon)
Testnet

Notes: Following the example above to modify information which match each Node function.

Run KardiaChain Network

For Direct

./cmd --network devnet --node <path/to/kai_config_devnet_node1.yaml>
./cmd --network devnet --node <path/to/kai_config_devnet_node2.yaml>
./cmd --network devnet --node <path/to/kai_config_devnet_node3.yaml>

For Docker

docker-compose ps
docker logs -f --tail 10 node1
docker logs -f --tail 10 node2
docker logs -f --tail 10 node3

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

  • 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

You'll need go and the required environment variables set, which can be done with the following commands:

Install

Install docker

Download the following file ,

Configuration file will be stored in YAML file. Download the following config , , . Below is the example of the Config file.

All files are available at

All files are available at

Generate with repo permission and set as GITHUB_TOKEN variables in your system.

https://docs.docker.com/engine/installation/
installed
libzmq
CentOS
Ubuntu
compose
docker-compose.yaml
genesis_devnet.yaml
node1.yaml
node2.yaml
node3.yaml
https://github.com/kardiachain/kardia-explorer-frontend
https://github.com/kardiachain/kardia-explorer-backend
github_private_token