https://github.com/ngchain/ngcore
The core daemon of ngchain network node
https://github.com/ngchain/ngcore
blockchain chain cryptocurrency defi ngin p2p random-x randomx schnorr wasm webassembly
Last synced: 5 months ago
JSON representation
The core daemon of ngchain network node
- Host: GitHub
- URL: https://github.com/ngchain/ngcore
- Owner: ngchain
- License: gpl-3.0
- Created: 2019-12-10T04:46:33.000Z (over 6 years ago)
- Default Branch: dev
- Last Pushed: 2024-05-30T05:46:23.000Z (about 2 years ago)
- Last Synced: 2024-06-21T04:47:46.779Z (almost 2 years ago)
- Topics: blockchain, chain, cryptocurrency, defi, ngin, p2p, random-x, randomx, schnorr, wasm, webassembly
- Language: Go
- Homepage: https://ngchain.org
- Size: 27.3 MB
- Stars: 11
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
core
## What is ngchain?
The ngchain is a radically updating **brand-new blockchain network**, which is not a fork of ethereum or any other
chain.
The ngchain's **goal** is to build **a blockchain engine** which acts more **auditable, scalable, security-oriented**
and supports more network tasks with vm.
The ngchain uses modern models - Vault(Block), Account, Multi-type Tx, and the traditional Block model to build the
blockchain ecosystem. And ngchain strictly follow the idea of blockchain, locking items with hash to keep engine work
safely. Not only blockchain, but Vault(Block) will also link up to be a chain for account security and powerful
functions like fast ignition, free account state and so on. So It's safe and robust like bitcoin and ethereum but more
scalable and powerful on the node's operational capacity and p2p network's speed and performance.
## Status
[](
https://goreportcard.com/report/github.com/ngchain/ngcore)



## Features
- **Fast ignition**
- Less, or **no storage cost**(mem only)
- With **humanizing** account model, users can send tx with **memorable short number**
- **High security** with Sheet and Vault(Block) model
- Powerful and scalable types of tx
- Support **Multi-Tx**, sending coins to different places in the same time
- Powerful **WASM** VM support based on account state(contract).
- **Libp2p(ipfs)** powered p2p networking
- Available **anonymous** address for saving balance
- Using the **schnorr signature**, allowing Multi-Sig when sending and receiving
- ...
## Requirements
go version >= 1.17
**NOTICE**: go build on Windows you should use `-buildmode=exe` flag (go version >= 1.15)
## Build
### Go
```bash
# go will automatically sync the dependencies
# GCC is required because of high performance db & vm
go build ./cmd/ngcore
```
## Usage
```bash
# dircetly run the binary
export GOLOG_FILE=ngcore.log # disable stderr output and write to the ngcore.log file
export GOLOG_LOG_LEVEL=debug # print more logs
./ngcore
# ngwallet is a rpc client in dart for ngin's daemon, see https://github.com/ngchain/ngwallet-dart
./ngwallet register 10086
./ngwallet transact 10010 1.5 # send 1.5 NG to account 10010
./ngwallet transact QfUnsE4CNgnpVS4oC4WEYH8u7WWAs8AwMrFBknWWqGSYwBXU 1.5 # send 1.5 NG to address QfUn...
```
If you wanna start mining(proof of work), try `--mining ` flag
```bash
./ngcore --mining 0 # zero means using all available cores
```
You can view more flags and options with `--help` flag
```bash
./ngcore --help
```
Or you can choose to run in a docker
```bash
git clone https://github.com/ngchain/ngcore && cd ngcore
sudo docker build . -t ngcore
# Run as a bootstrap node
sudo docker run -p 52520:52520 -p 52521:52521 -v .:/workspace -v ~/.ngkeys:~/.ngkeys ngcore --bootstrap true
# Run as a mining node, 0 means using all cpu cores, --in-mem will disable writing into disk and make the miner lighter
sudo docker run -p 52520:52520 -p 52521:52521 -v .:/workspace -v ~/.ngkeys:~/.ngkeys ngcore --mining 0 --in-mem
```
## Run a ngchain forknet
It's so easy to run an independent PoW chain on ngCore codebase.
1. Modify the `GenesisAddressBase58` in `./ngtypes/defaults.go` and `protocolVersion` in `./ngp2p/defaults/defaults.go`
2. Generate a new signature for genesis generate tx, and genesis block's nonce (with `ngcore gentools` toolset)
3. Run more than 2 bootstrap node with `--bootstrap` flag (without mining)
4. Write the bootstrap node to bootstrapNodes in `./ngp2p/bootstrap_nodes.go`
5. Run a mining node with `--mining 0` flag
6. Enjoy your fascinating PoW chain