Skip to content

Commit

Permalink
reorganize joining the blockchain pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristiano Teixeira committed Feb 20, 2020
1 parent 53f0dc7 commit ffbe6a8
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/go-nebulas/blockchain/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Joining the Blockchain
======================

Intent on joining the Nebulas Blockchain? Check out the following:

- `Joining the Mainnet` <mainnet.md>
- `Joining the Testnet` <testnet.md>
- `Configuration Files` <config.md>
- `Node Environment` <environment.md>
166 changes: 166 additions & 0 deletions docs/go-nebulas/blockchain/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Configuration

There are four types of configuration files in Nebulas.

* Normal node.
* Miner node.\(Miner - related configuration is increased relative to normal nodes\)
* Super node.\(Some connection limits are higher than normal nodes\)
* Sign node. \(Do not synchronize information with any node, only do signature and unlock\)

## Normal node

```text
network {
seed: ["/ip4/13.251.33.39/tcp/8680/ipfs/QmVm5CECJdPAHmzJWN2X7tP335L5LguGb9QLQ78riA9gw3"]
listen: ["0.0.0.0:8680"]
private_key: "conf/networkkey"
}
chain {
chain_id:1
datadir: "data.db"
keydir: "keydir"
genesis: "conf/genesis.conf"
signature_ciphers: ["ECC_SECP256K1"]
}
rpc {
rpc_listen: ["0.0.0.0:8784"]
http_listen: ["0.0.0.0:8785"]
http_module: ["api","admin"]
connection_limits:200
http_limits:200
}
app {
log_level: "debug"
log_file: "logs"
enable_crash_report: true
}
stats {
enable_metrics: false
}
```

## Miner node

```text
network {
seed: ["/ip4/13.251.33.39/tcp/8680/ipfs/QmVm5CECJdPAHmzJWN2X7tP335L5LguGb9QLQ78riA9gw3"]
listen: ["0.0.0.0:8680"]
private_key: "conf/networkkey"
}
chain {
chain_id: 1
datadir: "data.db"
keydir: "keydir"
genesis: "conf/genesis.conf"
coinbase: "n1EzGmFsVepKduN1U5QFyhLqpzFvM9sRSmG"
signature_ciphers: ["ECC_SECP256K1"]
start_mine:true
miner: "n1PxjEu9sa2nvk9SjSGtJA91nthogZ1FhgY"
remote_sign_server: "127.0.0.1:8694"
enable_remote_sign_server: true
}
rpc {
rpc_listen: ["127.0.0.1:8684"]
http_listen: ["0.0.0.0:8685"]
http_module: ["api","admin"]
connection_limits:200
http_limits:200
}
app {
log_level: "debug"
log_file: "logs"
enable_crash_report: true
}
stats {
enable_metrics: false
}
```

## Super node

```text
network {
seed: ["/ip4/13.251.33.39/tcp/8680/ipfs/QmVm5CECJdPAHmzJWN2X7tP335L5LguGb9QLQ78riA9gw3"]
listen: ["0.0.0.0:8680"]
private_key: "conf/networkkey"
stream_limits: 500
reserved_stream_limits: 50
}
chain {
chain_id:1
datadir: "data.db"
keydir: "keydir"
genesis: "conf/genesis.conf"
signature_ciphers: ["ECC_SECP256K1"]
}
rpc {
rpc_listen: ["0.0.0.0:8684"]
http_listen: ["0.0.0.0:8685"]
http_module: ["api"]
connection_limits:500
http_limits:500
http_cors: ["*"]
}
app {
log_level: "debug"
log_file: "logs"
enable_crash_report: true
pprof:{
http_listen: "0.0.0.0:8888"
}
}
stats {
enable_metrics: false
}
```

## Sign node

```text
network {
listen: ["0.0.0.0:8680"]
private_key: "conf/networkkey"
}
chain {
chain_id:0
datadir: "data.db"
keydir: "keydir"
genesis: "conf/genesis.conf"
signature_ciphers: ["ECC_SECP256K1"]
}
rpc {
rpc_listen: ["0.0.0.0:8684"]
http_listen: ["127.0.0.1:8685"]
http_module: ["admin"]
connection_limits:200
http_limits:200
}
app {
log_level: "debug"
log_file: "logs"
enable_crash_report: true
pprof:{
http_listen: "127.0.0.1:8888"
}
}
stats {
enable_metrics: false
}
```

56 changes: 56 additions & 0 deletions docs/go-nebulas/blockchain/environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Nebulas node environment

## Introduction

We are glad to release Nebulas Mainnet here. Please join and enjoy Nebulas Mainnet.


> [https://github.com/nebulasio/go-nebulas/tree/master](https://github.com/nebulasio/go-nebulas/tree/master)

## Hardware configuration

The nodes of the nebulas have certain requirements for machine performance. We recommend the performance of the machine has the following requirements:

```
CPU: >= 4cores(recommand 8 cores)
RAM: >= 16G
Disk: >= 600G SSD
```

## Environment

```
System: Ubuntu 18.04(recommand), other Linux is ok.
NTP: Ensure machine time synchronization
```

#### NTP
Install the NTP service to keep system time in sync.

Ubuntu install steps:

```
#install
sudo apt install ntp
#start ntp service
sudo service ntp restart
# check ntp status
ntpq -p
```

Centos install steps:

```
#install
sudo yum install ntp
#start ntp service
sudo service ntp restart
# check ntp status
ntpq -p
```


## Contribution

Feel free to join Nebulas Mainnet. If you did find something wrong, please [submit a issue](https://github.com/nebulasio/go-nebulas/issues/new) or [submit a pull request](https://github.com/nebulasio/go-nebulas/pulls) to let us know, we will add your name and url to this page soon.
116 changes: 116 additions & 0 deletions docs/go-nebulas/blockchain/mainnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# How to Join the Nebulas Mainnet

## Introduction

The Nebulas Mainnet 2.0 (Nebulas Nova) has been released. This tutorial will teach you how to join and work with the Nebulas Mainnet.

> [https://github.com/nebulasio/go-nebulas/tree/master](https://github.com/nebulasio/go-nebulas/tree/master)
### Build

The Nebulas Mainnet's executable file and dependant libraries need to be built first. Several important modules are highlighted below:

* **NBRE:** The Nebulas Blockchain Runtime Environment is the platform for running Nebulas Protocol Representation, such as the DIP, the NR, etcetera.
* **NEB:** The main process of the Nebulas Mainnet. `NEB` and `NBRE` run in standalone processes, and communicate through IPC.

Details of building the modules can be found in [tutorials](http://wiki.nebulas.io/en/latest/go-nebulas/tutorials/01-installation.html#compile-nebulas).


### Configuration

The Mainnet configuration files are in folder [`mainnet/conf`](https://github.com/nebulasio/go-nebulas/tree/master/mainnet/conf), including

### genesis.conf

All configurable information about genesis block is defined in genesis.conf, including

* **meta.chain\_id:** chain identity
* **consensus.dpos.dynasty:** the initial dynasty of validators
* **token\_distribution:** the initial allocation of tokens

> _Attention_: DO NOT change the genesis.conf.
### config.conf

All configurable information about runtime is defined in config.conf.

Please check the [`template.conf`](https://github.com/nebulasio/nebdocs/blob/master/docs/resources/conf/template.conf) to find more details about the runtime configuration.

> _Tips_: the official seed node info is as follows,
```javascript
seed:["/ip4/52.2.205.12/tcp/8680/ipfs/QmQK7W8wrByJ6So7rf84sZzKBxMYmc1i4a7JZsne93ysz5","/ip4/52.56.55.238/tcp/8680/ipfs/QmVy9AHxBpd1iTvECDR7fvdZnqXeDhnxkZJrKsyuHNYKAh","/ip4/13.251.33.39/tcp/8680/ipfs/QmVm5CECJdPAHmzJWN2X7tP335L5LguGb9QLQ78riA9gw3"]
```

#### Miner config
Nodes can participate in mining and share rewards after signing up for mining. The miner node needs to turn on the mine switch and configure both the miner address and reward address(coinbase).

miner config example:

```
chain {
# mainnet chainID
chain_id: 1
# mainnet datadir, should be different with private chain
datadir: "mainnet/data.db"
keydir: "keydir"
# mainnet genesis.conf
genesis: "mainnet/conf/genesis.conf"
# mainnet dynasty.conf
dynasty: "mainnet/conf/dynasty.conf"
# start mine
start_mine: true
# receive the mining award, must change to your address
coinbase: "n1XkoVVjswb5Gek3rRufqjKNpwrDdsnQ7Hq"
# block signature address, needs to be placed in the node's configuration `keydir`. Also make sure that the address is the node address at the time of registration
miner: "n1FF1nz6tarkDVwWQkMnnwFPuPKUaQTdptE"
#
passphrase: "passphrase"
signature_ciphers: ["ECC_SECP256K1"]
}
```

### Synchronization

Since Nebulas mainnet is running there for certain period of time, it will take quite some time to sync all the mainnet data from scratch.

For developers' convenience, we provided a offline data package, which already includes the data of more than 1 million blocks, you can download the package directly by following either link below (choose whichever is faster for you):
- [`download from AWS s3`](https://s3-us-west-1.amazonaws.com/develop-center/data/mainnet/data.db.tar.gz)
- [`download from Aliyun oss`](http://develop-center.oss-cn-zhangjiakou.aliyuncs.com/data/mainnet/data.db.tar.gz)

> Please note that, the data package should be put under the same path of "datadir" as specified in your `config.conf` file.

### API List

Main Endpoint:

| API | URL | Protocol |
| --- | :---: | :---: |
| RESTful | [https://mainnet.nebulas.io/](https://mainnet.nebulas.io/) | HTTP |

* [GetNebState](dapp-development/rpc/README.html#getnebstate) : returns nebulas client info.
* [GetAccountState](dapp-development/rpc/README.html#getaccountstate): returns the account balance and nonce.
* [Call](dapp-development/rpc/README.html#call): execute smart contract local, don't submit on chain.
* [SendRawTransaction](dapp-development/rpc/README.html#sendrawtransaction): submit the signed transaction.
* [GetTransactionReceipt](dapp-development/rpc/README.html#gettransactionreceipt): get transaction receipt info by tansaction hash.

More Nebulas APIs at [RPC](dapp-development/rpc/README.html).

## Tutorials

### English

1. [Installation](tutorials/01-installation.md) \(thanks [Victor](https://github.com/victorychain)\)
2. [Sending a Transaction](tutorials/02-transaction.md) \(thanks [Victor](https://github.com/victorychain)\)
3. [Writing Smart Contract in JavaScript](tutorials/03-smart-contracts-javascript.md) \(thanks [otto](https://github.com/ottokafka)\)
4. [Introducing Smart Contract Storage](tutorials/04-smart-contract-storage.md) \(thanks [Victor](https://github.com/victorychain)\)
5. [Interacting with Nebulas by RPC API](tutorials/05-interacting-with-nebulas-by-rpc-api.md) \(thanks [Victor](https://github.com/victorychain)\)


## Contribution

Feel free to join the Nebulas Mainnet. If you have found something wrong, please [submit an issue](https://github.com/nebulasio/go-nebulas/issues/new) or [submit a pull request](https://github.com/nebulasio/go-nebulas/pulls) to let us know, and we will add your name and URL to this page as soon as possible.

0 comments on commit ffbe6a8

Please sign in to comment.