• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kagome - C++17 implementation of Polkadot Host

logo

CodeFactor codecov

Intro

KAGOME is a Polkadot Host (former Polkadot Runtime Environment) developed by Soramitsu and funded by a Web3 Foundation grant and Kusama treasury.

Status

  • Syncing node
    • Polkadot, Kusama and Rococo compatibility
  • Validating node
  • Polkadot JS apps support
  • Parachains support
    • Non-asynchronous Backing
    • Data availability
    • Approval voting
    • Disputes resolution
  • Offchain workers
  • Telemetry support
  • Prometheus metrics
  • Fast sync
  • Warp sync
    • Incoming connections
    • Outcoming connections
  • Light client protocol

More details of KAGOME development can be found within the supported features section and in projects board

Getting Started

Build

Prerequisites

For now, please refer to the Dockerfile to get a picture of what you need for a local build-environment.

git clone https://github.com/soramitsu/kagome
cd kagome

make build

You will get KAGOME binary in the build/node/ folder

Other make commands are:

make docker
make command args="gcc --version"
make release
make release_docker
make debug_docker
make clear

Using KAGOME

Obtaining database snapshot (optional)

In order to avoid syncing from scratch we are maintaining the most recent snapshot of Polkadot network for KAGOME node available for anyone here: https://drive.google.com/drive/folders/1pAZ1ongWB3_zVPKXvgOo-4aBB7ybmKy5?usp=sharing

After downloading the snapshot you can extract it in the folder where the node will be running:

unzip polkadot-node-1.zip

Execute KAGOME Polkadot full syncing node

You can synchronize with Polkadot using KAGOME and obtain an archive node that can be used to query the Polkadot network at any state.

To launch KAGOME Polkadot syncing node execute:

cd examples/polkadot/
PATH=$PATH:../../build/node/
kagome --chain polkadot.json --base-path polkadot-node-1

Note: If you start KAGOME for the first time, you can add the --sync Fast flag to synchronize using Fast sync

After this command KAGOME will connect with other nodes in the network and start importing blocks. You may play with your local node using polkadot js apps: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer

You will also be able to see your node on https://telemetry.polkadot.io/. If you need to identify it more easily you can add --name <node-name> flag to node's execution command and find your node in telemetry by typing its name.

Run kagome --help to explore other CLI flags.

Execute KAGOME validating node in development mode

The easiest way to get started with KAGOME is to run it in development mode, which is a single node network:

kagome --dev

That executes node with default accounts Alice and Bob. You can read about these accounts here.

To launch with wiping existing data you can do:

kagome --dev-with-wipe

Run KAGOME node in validator mode

To start the KAGOME validator:

cd examples/first_kagome_chain
PATH=$PATH:../../build/node/
kagome --validator --chain localchain.json --base-path base_path

This command executes a KAGOME full node with an authority role.

Run KAGOME with collator

Read this tutorial

Configuration Details

To run a KAGOME node, you need to provide it with a genesis config, cryptographic keys, and a place to store db files.

  • Example of a genesis config file can be found in examples/first_kagome_chain/localchain.json
  • Example of a base path dir can be found in examples/first_kagome_chain/base_path
  • To create database files, just provide any base path into kagome executable (mind that start with authority role requires keys to start).

Contributing Guides

Please refer to the Contributor Documentation.

Modules

  • api
    • JSON-RPC based on specification from PSP and Polkadot JS documentation. Uses HTTP and WebSockets for transport.
  • application
    • Implements logic for running KAGOME node, such as processing CLI flags and defining an execution order of different modules
  • assets
    • Artifacts needed to run in development mode
  • authority_discovery
    • Logic for finding peer information by authority id provided
  • authoriship
    • Mechanism for building blocks from extrinsics provided by the transaction pool
  • blockchain
    • Implements blockchain logic such as fork handling and block digest information processing
  • clock
    • Implements a clock interface that is used to access the system time
    • Implements timer interface that is used to schedule events
  • common
    • A set of miscellaneous primitives, data structures, and helpers that are widely used in the project to simplify development
  • consensus
    • Implementation of BABE block production mechanism
    • Implementation of Grandpa finality gadget
  • containers
    • An implementation of a container that serves as an allocator for frequently created objects
  • crypto
    • Crypto primitives implementation such as DSAs, Hashers, VRF, Random generators
  • filesystem
    • A convenient interface for working with directories in the project
  • host_api
    • Host APIs exposed by the Polkadot runtime as WASM import functions needed to handle storage, cryptography, and memory
  • injector
  • log
    • A configuration of KAGOME logger
  • macro
    • Convenience macros
  • metrics
    • Prometheus metrics to retrieve KAGOME node execution statistics
  • network
    • A set of networking substream protocols implementation on top of cpp-libp2p library
  • offchain
  • outcome
  • parachain
    • Parachains logic such as collation protocol, backing, availability and validity
  • runtime
    • Integration of Binaryen and WAVM WebAssembly engines with Host APIs
  • scale
    • Scale codec for some primitives
  • storage
    • Storage and trie interfaces with RocksDB implementation
  • subscription
    • Subscription engine
  • telemetry
  • transaction_pool
    • Pool of transactions to be included into the block
  • utils
    • Utils such as profiler, pruner, thread pool

You can find more information about the components by checking reference documentation. Check out tutorials and more examples in official documentation: https://kagome.readthedocs.io/

KAGOME in media

More Repositories

1

fearless-Android

Fearless Wallet is a mobile wallet designed for the decentralized future on the Kusama and Polkadot networks.
Kotlin
85
star
2

fearless-iOS

Fearless Wallet is a mobile wallet designed for the decentralized future on the Kusama and Polkadot networks.
Swift
82
star
3

iroha-wallet-js

Sample wallet application for Iroha
JavaScript
27
star
4

fearless-utils-Android

fearless-utils-Android
Kotlin
19
star
5

iroha-demo-javascript

Sample web application using Hyperledger Iroha to send/receive/view point transactions.
JavaScript
11
star
6

iroha-helpers

Some functions which will help you to interact with Hyperledger Iroha
JavaScript
11
star
7

iroha-demo-ios

Sample iOS point application for Hyperledger Iroha
Swift
10
star
8

fearless-utils

The goal of the repo is to contain some static information (informative jsons, token icons, etc)
9
star
9

nakayoshi

chatbot to connect all-in-one messengers
Scala
8
star
10

soramitsu-js-ui-library

Javascript UI library used by SORAMITSU
SCSS
8
star
11

fearless-utils-iOS

fearless-utils-iOS
Swift
7
star
12

Capital-iOS

iOS module to reuse for implementing payment solutions on Hyperledger Iroha blockchain
Swift
5
star
13

fearless-web

Wallet for the Kusama Network
HTML
5
star
14

sora-didresolver

Java
5
star
15

iroha-demo-android

Sample Android point application for Hyperledger Iroha.
Java
5
star
16

gradle-sora-plugin

Groovy
4
star
17

scale-codec-js-library

Pure JavaScript implementation of SCALE-codec
TypeScript
4
star
18

iroha-gateway

[WIP] REST Interface for Iroha (https://github.com/hyperledger/iroha)
Go
3
star
19

ursa_key_utils

Rust
3
star
20

1code-rust

Rust version of https://github.com/soramitsu/1code-java
Rust
3
star
21

magellan-android

Designing a Better World Through Decentralized Technologies
Kotlin
3
star
22

localized_docs

Localised documentation for Hyperledger Iroha
Python
2
star
23

hunter-binary-cache

This repository is used to store hunter binary cache for Soramitsu Repositories.
2
star
24

sumeragi

Kotlin
2
star
25

iroha-ed25519.js

warchant/ed25519 compiled with Emscripten and wrapper for it.
JavaScript
2
star
26

iroha-go

[WIP] Go library for Hyperledger Iroha. Progress is here https://github.com/soramitsu/iroha-go/issues/6
Go
2
star
27

1code-java

Stable binary serialization method for arbitrary key-value data structures
Java
2
star
28

fearless-subquery

Designing a Better World Through Decentralized Technologies
TypeScript
1
star
29

robinhood-ios

Swift
1
star
30

iroha-katacoda

Iroha Katacoda sandbox
Python
1
star
31

iroha2-java-dsl

1
star
32

iroha-point-ios

A sample app for Hyperledger Iroha, called Iroha Point, for token exchanges between Iroha accounts
Swift
1
star
33

soramitsu-iroha-balancer

Designing a Better World Through Decentralized Technologies
Kotlin
1
star
34

soranet-dashboard-web

This repository is managed by Terraform!
Vue
1
star
35

soramitsu-UIkit-android

Designing a Better World Through Decentralized Technologies
Kotlin
1
star
36

iroha-counterparty

2-way peg based on counterparty.io platform
1
star
37

cologne

Designing a Better World Through Decentralized Technologies
1
star
38

fmt-subs

Helps with complex printf-style formatting.
TypeScript
1
star
39

iroha2-block-explorer-web

Designing a Better World Through Decentralized Technologies
Vue
1
star
40

x-networking-old

Designing a Better World Through Decentralized Technologies
Objective-C
1
star
41

sora-sdk

Java library for SORA
Java
1
star
42

vue-kakuyaku

Toolkit to handle async operations in Vue.
TypeScript
1
star
43

yozhik

Bot which closes issues at Github.
Rust
1
star
44

iroha2-block-explorer-backend

Designing a Better World Through Decentralized Technologies
Rust
1
star
45

crypto-iOS

Lib includes crypto functions for Decentralized Identifiers protocol: https://w3c-ccg.github.io/did-spec/
Swift
1
star