大螃嗨

好记性不如烂笔头

用户工具

站点工具


ripple瑞波

这是本文档旧的修订版!


基本信息收集

瑞波扫块

感觉瑞波好像不用扫块,原因如下:

https://developers.ripple.com/intro-to-consensus.html

Each ledger version is numbered with a ledger index and builds on a previous ledger version whose index is one less, going all the way back to a starting point called the genesis ledger with ledger index 1.¹ Like Bitcoin and other blockchain technologies, this forms a public history of all transactions and their results. Unlike many blockchain technologies, each new “block” in the XRP Ledger contains the entirety of the current state, so you don't need to collect the entire history to know what's happening now.²

通过yum在centos上安装:

  1.数字列表项目Install the Ripple RPM repository:
    $ sudo rpm -Uvh https://mirrors.ripple.com/ripple-repo-el7.rpm
  2.Install the rippled software package:
    $ sudo yum install --enablerepo=ripple-stable rippled
  3.Configure the rippled service to start on system boot:
    $ sudo systemctl enable rippled.service
  4.Start the rippled service
    $ sudo systemctl start rippled.service

关键参数设置:

  • node_size
  • node_db
  • online_delete 这两个参数和精简模式有关系
  • advisory_delete 这两个参数和精简模式有关系
  • log_level 日志级别
  • database_path
  • node_db

以下3个参数和集群配置相关摘自:https://developers.ripple.com/cluster-rippled-servers.html

对亚马逊服务器磁盘的要求,不能使用EBS,原因是读写IOPS跟不上:

Amazon Web Services (AWS) is a popular virtualized hosting environment. You can run rippled in AWS, but Ripple does not recommend using Elastic Block Storage (EBS). Elastic Block Storage's maximum number of IOPS (5,000) is insufficient for rippled's heaviest loads, despite being very expensive.

Node Size The node_size parameter determines the size of database caches. Larger database caches decrease disk I/O requirements at a cost of higher memory requirements. Ripple recommends you always use the largest database cache your available memory can support. See the following table for recommended settings.

Recommendation Available RAM for rippled node_size value Notes < 8GB tiny Not recommended 8GB low 16GB medium 32GB huge Recommended for production servers

编译节点

节点搭建步骤(系统centos7.4): $ sudo yum install -y gcc gcc-c++ wget git cmake protobuf-compiler openssl-devel $ wget http://cbs.centos.org/kojifiles/packages/protobuf/2.5.0/10.el7.centos/x86_64/protobuf-2.5.0-10.el7.centos.x86_64.rpm $ wget http://cbs.centos.org/kojifiles/packages/protobuf/2.5.0/10.el7.centos/x86_64/protobuf-devel-2.5.0-10.el7.centos.x86_64.rpm $ wget http://cbs.centos.org/kojifiles/packages/protobuf/2.5.0/10.el7.centos/x86_64/protobuf-compiler-2.5.0-10.el7.centos.x86_64.rpm $ sudo yum -y install protobuf-2.5.0-10.el7.centos.x86_64.rpm \ protobuf-compiler-2.5.0-10.el7.centos.x86_64.rpm \ protobuf-devel-2.5.0-10.el7.centos.x86_64.rpm

安装python3: $ sudo yum install centos-release-scl $ sudo yum install rh-python36

$ sudo wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz $ sudo tar -xzf boost_1_67_0.tar.gz $ cd boost_1_67_0 $ sudo ./bootstrap.sh –prefix=/usr/local/include/boost $ sudo ./b2 –build-type=complete –layout=tagged install

编译boost报错:

找到如下文件:
/app/boost_1_67_0/tools/build/src/tools/python.jam

修改如下:
includes ?= $(prefix)/include/python$(version) ;  错误

includes ?= $(prefix)/include/python$(version)m ;  正确

打开:
./bootstrap.sh

修改:PYTHON=python 为 PYTHON=python3.6

$ export BOOST_ROOT=/app/boost_1_67_0 $ sudo mkdir /app/ripples/my_build $ cd my_build

安装cmake3 $ sudo git clont https://gitlab.kitware.com/cmake/cmake.git $ cd cmake $ sudo ./bootstrap $ sudo make $ sudo make install

$ sudo /usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Release .. 先不用这条$ sudo /usr/local/bin/cmake -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/g++ .. $ scl enable devtoolset-4 bash

下面编译依赖工具库 $ sudo git clone –recursive https://github.com/ripple/validator-keys-tool.git $ cd ${YOUR_VALIDATOR_KEYS_TOOL_DIRECTORY} $ sudo mkdir -p build/gcc.debug $ cd build/gcc.debug $ sudo /usr/local/bin/cmake ../.. 先不用这条$ sudo /usr/local/bin/cmake -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/g++ ../.. $ sudo /usr/local/bin/cmake –build .

启动节点

$ ./validator-keys create_keys

 输出:Validator keys stored in /home/centos/.ripple/validator-keys.json
 

$ ./validator-keys create_token –keyfile /home/centos/.ripple/validator-keys.json

$ mkdir -p ~/.config/ripple $ cp cfg/rippled-example.cfg /etc/opt/ripple/rippled.cfg $ cp cfg/validators-example.txt /etc/opt/ripple/validators.txt $ ./rippled –conf=/etc/opt/ripple/rippled.cfg

编译安装ripple-lib

安装Node.js

$ curl –silent –location https://rpm.nodesource.com/setup_10.x | sudo bash - $ sudo yum -y install nodejs

创建封装工程

$ mkdir my_ripple_experiment && cd my_ripple_experiment $ git init https://developers.ripple.com/get-started-with-rippleapi-for-javascript.html $

ripple瑞波.1535634251.txt.gz · 最后更改: 2018/08/30 13:04 由 螃蟹