Skip to content

Commit

Permalink
sync up recent changes (neo-project#603)
Browse files Browse the repository at this point in the history
* sync up recent changes

related to neo-project#587, neo-project#590, neo-project#594, neo-project#596, neo-project#597, neo-project#602

* minor updates

minor updates
  • Loading branch information
Celia18305 authored Aug 29, 2018
1 parent 2b3daec commit eee82ca
Show file tree
Hide file tree
Showing 9 changed files with 1,001 additions and 33 deletions.
53 changes: 50 additions & 3 deletions en-us/exchange/v2.7.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,52 @@ In general, an exchange needs to do the following:

## Deploying a NEO Node on Server

To deploy a NEO node on the exchange server, do the following:
> [!Note]
>
> For Linux system servers, it is strongly recommended to change the disk file system to the xfs system for hosting NEO-CLI, so as to ensure there is sufficient inodes for the applicationlog directory to support the storage of logs. Particularly, it is recommended to clean up unnecessary log files periodically to avoid inodes shortage.
To depoly the NEO node, do the following:

1. Add the disk and install the xfs tool:

```
apt install xfsprogs
```

2. Format the newly added disk to xfs. Here we assume the new disk path is /dev/vdb.

```
mkfs.xfs -f /dev/vdb
```

3. Go to the directory where you want to install NEO-CLI and mount the new disk using the following command:

```
cd $your path
mount $new disk path $mounting path
```

For example:

1. Install [.NET Core Runtime](https://www.microsoft.com/net/download/core#/runtime) on the server, 2.0 and the later version.
2. From Github, download the [Neo-CLI](https://github.com/neo-project/neo-cli/releases) program and enable the NEO node.
```
mount /dev/vdb /root/xfs
```

Assuming the new disk capacity is 100G, check the number of inodes and the file system format using df -iT, you will find 52.42 million inodes on the new disk.

4. If you need more space or want to increase the inodes, use the `xfs_growfs` command.

For example:Modify the inode to increase 30% space, the number of inodes will become 62.91 million.

```
cd /root && xfs_growfs -m 30 $mounting path
```

The mounted disk needs to be remounted after restarting the machine. If you want to restart the automatic mount, modify /etc/fstab.

5. Install [.NET Core Runtime](https://www.microsoft.com/net/download/core#/runtime) on the server, 2.0 and the later version.

6. From Github, download the [Neo-CLI](https://github.com/neo-project/neo-cli/releases) program and enable the NEO node.

For more information, refer to [Installation and deployment of NEO node](../node/cli/setup.md).

Expand Down Expand Up @@ -245,6 +287,11 @@ Before you can use the `getapplicationlog` api to get transaction information, y
dotnet neo-cli.dll --rpc --log
```
> [!Note]
>
> Once --rpc is turned on, the log of the corresponding block is obtained from current block height. If getting logs from 0, the log file will be massive and take up a large number of inodes under the Linux system. Moreover, it may lead to the exception of no space left on device. For exchanges that include the NEP-5 assets, only the logs captured from the release block height of the asset are needed. If only UTXO is included, you just need to capture the Log from the related block height according to your needs.
> It is highly recommended to periodically delete useless logs, such as logs 30 days ago, to avoid the packed inode.
A folder "ApplicationLogs" is generated under the root path. The complete contract log is recorded in this directory, and each NEP-5 transaction is recorded in a JSON file with the named of the transaction txid.
The following shows an example of the notification file content.
Expand Down
900 changes: 900 additions & 0 deletions en-us/exchange/v2.8.0.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion en-us/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ Here is an exhaustive library of NEO technical docs, including development examp

| Smart Contract | Document for Exchange Developers |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [Introduction](sc/introduction.md)<br />[Quick Start](sc/quickstart/overview.md)<br />[Reference](sc/reference/api.md)<br />[Samples and Tutorials](sc/tutorial/HelloWorld.md)<br />[Contract Triggers](sc/trigger.md)<br />[System Fees](sc/systemfees.md) | [Version 2.7.6](exchange/v2.7.6.md)<br />[Version 2.7.4](exchange/v2.7.4.md)<br />[Version 2.7.3](exchange/v2.7.3.md)<br />[Version 2.7.1](exchange/v2.7.1.md)<br />[Version 2.6.0](exchange/v2.6.0.md) |
| [Introduction](sc/introduction.md)<br />[Quick Start](sc/quickstart/overview.md)<br />[Reference](sc/reference/api.md)<br />[Samples and Tutorials](sc/tutorial/HelloWorld.md)<br />[Contract Triggers](sc/trigger.md)<br />[System Fees](sc/systemfees.md) | [Version 2.8.0](exchange/v2.8.0.md)<br />[Version 2.7.6](exchange/v2.7.6.md)<br />[Version 2.7.4](exchange/v2.7.4.md)<br />[Version 2.7.3](exchange/v2.7.3.md)<br />[Version 2.7.1](exchange/v2.7.1.md)<br />[Version 2.6.0](exchange/v2.6.0.md) |

<link rel="stylesheet" href="../styles/index.css">
12 changes: 8 additions & 4 deletions en-us/network/syncblocks.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Synchronizing the blockchain faster

The client must be fully synchronized before use. In order to speed up network synchronization you can download an offline package of the blockchain data up to a certain block height. This means the client will only need to sync the additional blocks from the NEO network rather than the entire blockchain.
The client must be fully synchronized before use. In order to speed up network synchronization you can download an offline package. NEO official website provides two types of offline package:

- Full offline package: contains all blockchain data since 0 block height in the format of chain.acc. It is applicable to the client running for the first time as well as the client which hasn't been synchronized up to the data range provided by increment offline packages.
- Increment offline package: contains the data in a block height range to speed up synchronization of the client to the end height of the incremental package. It is applicable to the client which has been synchronized up to the block height within the increment offline packages coverage. The incremental package format is chain.xxx.acc, where xxx is the incremental package starting height.

Suppose you are using windows, you need to do the following:

1. Close the NEO client and click [Download offline synchronized package](http://sync.ngd.network/) from the [Client Downloads](https://neo.org/download) page.

2. Download the full offline package or increment offline package according to your network.
2. Download the full offline package or increment offline package according to your network, and then place the zip package (chain.acc.zip or chain.xxx.acc.zip) under the folder where the client executive program (neo-gui.exe or neo-cli.exe) is located.

- For the full offline package, place it under the folder where the client executive program (neo-gui.exe or neo-cli.exe) is located.
- For the increment offline package, first you need to synchronize the client to the starting height of the increment offline package and then place the unzipped package under the neo-gui.exe or neo-cli.exe folder.
> [!Note]
>
> Do not change the default offline package file name, otherwise it will not work for synchronization.
3. Run the client and check the blocks downloading status.

Expand Down
23 changes: 16 additions & 7 deletions en-us/node/introduction.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# NEO node introduction
# NEO Node Introduction
Nodes that store all of the blockchain are called “full-nodes”. They are connected to the blockchain through a P2P network. All the nodes in the blockchain network are equal, they act both as a client interface and as a server.

There are two full-node programs. The first one is Neo-GUI, it has all the basic functions of a user-client including a graphical user interface and is intended for NEO users. The second one is Neo-CLI, it provides an external API for basic wallet functions and is intended for NEO developers. It will also help other nodes achieve consensus with the network and will be involved in generating new blocks.
There are two full-node programs:

The NEO [network protocol](../network/network-protocol.md) will provide a low level API for some transaction types that are not currently supported by the CLI, such as claiming GAS or sending NEO without an open wallet.
- Neo-GUI, which has all the basic functions of a user-client including a graphical user interface and is intended for NEO users.
- Neo-CLI, which provides an external API for basic wallet functions and is intended for NEO developers. It also helps other nodes achieve consensus with the network and is involved in generating new blocks.

## NEO node download address
The NEO [network protocol](../network/network-protocol.md) provides a low level API for some transaction types that are not currently supported by the CLI, such as claiming GAS or sending NEO without an open wallet.

## NEO client download address

| | Neo-GUI | Neo-CLI |
| ---- | ---------------------------------------- | ---------------------------------------- |
| Releases | [Official website](https://www.neo.org/download) or [Github](https://github.com/neo-project/neo-gui/releases) | [Github](https://github.com/neo-project/neo-cli/releases) |
| Source code | [Github](https://github.com/neo-project/neo-gui) | [Github](https://github.com/neo-project/neo-cli) |

## Comparison of GUI node and CLI node functions
## GUI node and CLI node functions comparison

| | GUI | CLI |
| --------- | ---- | ---- |
Expand Down Expand Up @@ -40,9 +43,15 @@ The NEO [network protocol](../network/network-protocol.md) will provide a low le
| JSON-RPC | ||
| The consensus of the participating blocks | ||

## Port description
## NEO-CLI security policy

To enable an external program to access the node API, you need to open the firewall port.

> [!Note]
>
> To avoid the significant security risk, a whitelist or firewall must be used to block external server requests.
If you want an external program to access the node's API, an open firewall port is required. The following is a port description that can be set to fully open or open-on-demand.
NEO-CLI does not provide the function to remotely switching on/off the wallet, and it does not verify the process when opening a wallet. Therefore, you should set your own security policies. The wallet must be kept open all the time to respond to the withdrawal requests of users. For security reasons, the wallets should be run in an independent server on which the firewall is configured properly, as shown below.

| | Main Net | Test Net |
| ------------------ | ------------ | ------------- |
Expand Down
2 changes: 2 additions & 0 deletions en-us/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@
- name: Document for Exchange Developers
href: exchange/general.md
items:
- name: v2.8.0
href: exchange/v2.8.0.md
- name: v2.7.6
href: exchange/v2.7.6.md
- name: v2.7.4
Expand Down
38 changes: 22 additions & 16 deletions zh-cn/exchange/v2.7.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,52 @@ NEO中主要有两种资产,一种是全局资产,例如:NEO、GAS等,

## 在服务器中部署 NEO 节点

NEO节点的初始安装部署包含以下步骤:
> [!Note]
>
> 强烈建议把即将安装 NEO-CLI 的磁盘文件系统改为 xfs 系统,以保证 applicationlog 所在目录有足够大的 inode 数来支持日志的存储,并且推荐定期删除无用的 log 文件以避免 inode 数不足。
1. 强烈建议把即将安装 neo-cli 的磁盘文件系统改为xfs系统,以保证 applicationlog 所在目录有足够大的 inode 数来支持日志的存储,并且推荐定期删除无 用的陈旧的 log 文件来避免 inode 数不足的情况。
NEO 节点的初始安装部署包含以下步骤:

首先添加磁盘并安装 xfs 工具:
1. 添加磁盘并安装 xfs 工具:

```
apt install xfsprogs
```

然后格式化新添加的磁盘,改为 xfs。此处 /dev/vdb 为假定新磁盘路径。
2. 格式化新添加的磁盘,改为 xfs。此处 /dev/vdb 为假定新磁盘路径。

```
mkfs.xfs -f /dev/vdb
```
进入准备安装 neo-cli 的目录,用 mount 指令挂载新磁盘


3. 进入准备安装 NEO-CLI 的目录,用 mount 指令挂载新磁盘

```
cd $your path
mount $新磁盘目录 $挂载目录
```

例:

```
mount /dev/vdb /root/xfs
```
通过 df -iT 查看inode数目和文件系统格式,此时会发现新磁盘有5242万个 inode 了。
如果需要增加空间,或者增加 inode 数目使用 xfs_growfs 命令来扩容和增加 inode

通过 df -iT 查看inode数目和文件系统格式,假设添加的磁盘容量为100G,此时会发现新磁盘有5242万个 inode 了。

4. 如果需要增加空间,或者增加 inode 数目使用 xfs_growfs 命令来扩容和增加 inode

例:修改inode至30%空间,Inode数目就会变成6291万个。

```
cd /root && xfs_growfs -m 30 $挂载目录
```

挂载的磁盘重启机器后需要重新挂载,如果想重启自动挂载需要修改/etc/fstab

2. 安装 NEO 节点的运行环境 [.NET Core Runtime](https://www.microsoft.com/net/download/core#/runtime),2.0 或以上版本。
3. 在 Github 上下载 [Neo-CLI](https://github.com/neo-project/neo-cli/releases) 程序包并启动 NEO 节点。
5. 安装 NEO 节点的运行环境 [.NET Core Runtime](https://www.microsoft.com/net/download/core#/runtime),2.0 或以上版本。

6. 在 Github 上下载 [Neo-CLI](https://github.com/neo-project/neo-cli/releases) 程序包并启动 NEO 节点。

更多详细内容,请参阅 [NEO 节点的安装部署](../node/setup.md)

Expand Down
2 changes: 1 addition & 1 deletion zh-cn/exchange/v2.8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> [!Note]
>
> 本文对应neo-cli版本为 [Neo CLI v2.8.0](https://github.com/neo-project/neo-cli/releases/tag/v2.8.0)
> 本文对应 NEO-CLI 版本为 [Neo CLI v2.8.0](https://github.com/neo-project/neo-cli/releases/tag/v2.8.0)

NEO中主要有两种资产,一种是全局资产,例如:NEO、GAS等,使用UTXO模型来管理资产。另一种是合约资产,例如:NEP-5类型的资产,使用BALANCE模型来管理资产。交易所对接时,主要处理这两种类型资产的充值、提现等操作。neo-cli作为客户端,在P2P网络中充当一个普通节点,同时,该程序也是一个跨平台的钱包,处理各种资产的相关交易。综上,交易所对接需要完成以下操作:
Expand Down
2 changes: 1 addition & 1 deletion zh-cn/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ NEO 全部的技术文档都在这里,还有众多开发示例可供参考

| 智能合约 | 交易所对接文档 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [智能合约与 NeoVM](sc/introduction.md)<br />[快速入门](sc/quickstart/overview.md)<br />[开发参考](sc/reference/api.md)<br />[合约示例](sc/tutorial/HelloWorld.md)<br />[合约触发器](sc/trigger.md)<br />[系统使用费](sc/systemfees.md) | [Version 2.7.6](exchange/v2.7.6.md)<br />[Version 2.7.4](exchange/v2.7.4.md)<br />[Version 2.7.3](exchange/v2.7.3.md)<br />[Version 2.7.1](exchange/v2.7.1.md)<br />[Version 2.6.0](exchange/v2.6.0.md) |
| [智能合约与 NeoVM](sc/introduction.md)<br />[快速入门](sc/quickstart/overview.md)<br />[开发参考](sc/reference/api.md)<br />[合约示例](sc/tutorial/HelloWorld.md)<br />[合约触发器](sc/trigger.md)<br />[系统使用费](sc/systemfees.md) | [Version 2.8.0](exchange/v2.8.0.md)<br />[Version 2.7.6](exchange/v2.7.6.md)<br />[Version 2.7.4](exchange/v2.7.4.md)<br />[Version 2.7.3](exchange/v2.7.3.md)<br />[Version 2.7.1](exchange/v2.7.1.md)<br />[Version 2.6.0](exchange/v2.6.0.md) |

<link rel="stylesheet" href="../styles/index.css">

0 comments on commit eee82ca

Please sign in to comment.