博客内容为Hyperledger-indy官方部署文档的中文翻译,翻译内容系原创,转载注明来源

【说明】

(1)【撰写目的】
Hyperledger-indy的中文资料较少,希望能为初次接触Hyperledger-indy的小伙伴提供一些参考。

(2)【内容说明】
1.黑色中文为对上一行英文内容的翻译。蓝色中文为个人补充说明,用于对部署细节做进一步说明。
2.文档采用意译方式,与英文原文并不是逐字对应。
3.文档为indy-node开发环境部署官方文档的中文人工翻译。

Hyperledger

indy-node支持的是indy链功能。
按照此文档部署indy-node开发环境之后,即具备对开源项目indy-node进行运行和开发的条件。

(3)文章中如有错误,欢迎留言。Hyperledger-indy下的indy-node,indy-sdk ,aries-cloudagent-python等项目,本人均进行过部署搭建并在企业项目中进行过应用,目前的目标是可以深入了解Hyperledger-indy,挖掘更多应用实现,欢迎随时交流

英文官方文档原文地址:Dev Setup — Hyperledger Indy Node documentation

Dev Setup

开发环境部署

There are scripts that can help in setting up environment and project for developers. The scripts are in dev-setup folder.
项目源代码目录下的[dev-setup]文件夹里面包含一些脚本,这些脚本的功能是部署indy-node集群

注:macOS里面是MAC OS系统中自动创建indy-node集群的脚本,ubentu里面是ubentu系统中自动创建indy-node集群的脚本,里面没有CentOS系统中自动创建indy-node集群的脚本

Note: as of now, we provide scripts for Ubuntu only. It’s not guaranteed that the code is working on Windows.
目前仅提供Ubuntu 系统中自动部署indy-node集群的脚本。windows系统中自动部署indy-node集群的方法还处在孵化状态,不提供正式使用

文档很久没更新了,目前提供macOS和Ubuntu平台的部署脚本
开源项目管理体系中,项目提交毕业申请,并经过认证之后,才会提供正式使用

  • One needs Python 3.5 to work with the code
    使用Python3.5运行indy-node代码

  • We recommend using Python virtual environment for development
    推荐使用“python虚拟环境”进行indy-node代码的运行

  • We use pytest for unit and integration testing
    这个项目使用pytest模块实现indy-node项目的单元测试和集成测试

  • There are some dependencies that must be installed before being able to run the code
    运行indy-node之前需要先安装一些依赖 需要的依赖会在下面具体介绍

Quick Setup on Ubuntu 16.04:

介绍使用自动安装脚本在Ubuntu系统上部署indy-node

This is a Quick Setup for development on a clean Ubuntu 16.04 machine. You can also have a look at the scripts mentioned below to follow them and perform setup manually.
下面将介绍在Ubuntu 16.04系统机器上快速部署的方法。你也可以参考下面介绍的自动化脚本说明,手工进行开发环境的部署

  1. Get scripts from dev-setup-ubuntu
    脚本地址:https://github.com/hyperledger/indy-node/tree/master/dev-setup/ubuntu

  2. Run setup-dev-python.sh to setup Python3.5, pip and virtualenv
    运行脚本setup-dev-python.sh,安装Python3.5, pip以及virtualenv
    注:此处

  3. Run source ~/.bashrc to apply virtual environment wrapper installation
    执行source ~/.bashrc命令,让virtualenv虚拟环境生效

  4. Run setup-dev-depend-ubuntu16.sh to setup dependencies (libindy, libindy-crypto, libsodium)
    执行setup-dev-depend-ubuntu16.sh安装依赖(依赖包括:libindy, libindy-crypto, libsodium

  5. Fork indy-plenum and indy-node
    fork(下载 ) indy-plenum 和indy-node

  6. Go to the destination folder for the project
    进入到目标目录下

  7. Run init-dev-project.sh to clone indy-plenum and indy-node projects and create a virtualenv to work in
    运行init-dev-project.sh脚本,这个脚本会将indy-plenum 和indy-node克隆到本地,然后创建用于运行以上2个项目的虚拟环境

  8. Activate new virtualenv workon
    激活新的虚拟环境

  9. [Optionally] Install Pycharm
    该项为可选项,安装Pycharm

  10. [Optionally] Open and configure projects in Pycharm:
    该项为可选项,在Pycharm中打开项目,并做初始化配置

    • Open both indy-plenum and indy-node in one window
      在同一个窗口中打开indy-plenum 和indy-node

    • Go to File -> Settings
      点击File -> Settings

    • Configure Project Interpreter to use just created virtualenv
      配置项目的Interpreter,让项目使用我们自己安装的Python virtualenv

      • Go to Project: -> Project Interpreter
        点击Project: -> Project Interpreter

      • You’ll see indy-plenum and indy-node projects on the right side tab. For each of them:
        在右侧的面板中会看到indy-plenum和indy-node工程,对于每个工程执行以下操作

        • Click on the project just beside “Project Interpreter” drop down, you’ll see one setting icon, click on it.
          点击每个工程上的setting按钮

        • Select “Add Local”
          选择“Add Local”

        • Select existing virtualenv path as below: /bin/python3.5 For example: /home/user_name/.virtualenvs/new-virtualenv-name>/bin/python3.5
          选择已经存在虚拟环境

    • Configure Project Dependency
      配置工程依赖

      • Go to Project: -> Project Dependencies
        点击Project: -> Project Dependencies

      • Mark each project to be dependent on another one
        工程依赖于另外一个工程

    • Configure pytest
      配置pytest

      • Go to Configure Tools -> Python Integrated tools
        点击Configure Tools -> Python Integrated tools

      • You’ll see indy-plenum and indy-node projects on the right side tab. For each of them:
        右侧面板中的indy-plenum 和 indy-node工程

        • Select Py.test from the ‘Default test runner’
          点击Py.test选项,执行Default test runner

    • Press Apply
      点击执行

Detailed Setup

不使用自动部署脚本,如何部署indy-node集群

1.安装Python
2.安装Libsodium
3.安装Indy-Crypto
4.安装RocksDB
5.安装Libindy
6.配置python虚拟环境(非必要操作,直接用物理机上的python也是可以的)
7.部署indy-node并测试indy-node的部署效果

Setup Python

安装Python

One needs Python 3.5 to work with the code. You can use dev-setup/ubuntu/setup_dev_python.sh script for quick installation of Python 3.5, pip and virtual environment on Ubuntu, or follow the detailed instructions below.
可以通过dev-setup/ubuntu/setup_dev_python.sh脚本在Ubuntu上快速安装Python 3.5, pip and virtual environment,也可以根据下面的步骤手动进行安装

Ubuntu

如何在Ubuntu上安装Python3.5

  1. Run sudo add-apt-repository ppa:deadsnakes/ppa
    执行sudo add-apt-repository ppa:deadsnakes/ppa

  2. Run sudo apt-get update
    执行sudo apt-get update

  3. On Ubuntu 14, run sudo apt-get install python3.5 (python3.5 is pre-installed on most Ubuntu 16 systems; if not, do it there as well.)
    在Ubuntu 14中,使用sudo apt-get install python3.5

CentOS/Redhat

如何在CentOS或红帽上安装Python3.5

Run sudo yum install python3.5
执行sudo yum install python3.5

Mac

如何在macOS上安装Python3.5

  1. Go to python.org and from the “Downloads” menu, download the Python 3.5.0 package (python-3.5.0-macosx10.6.pkg) or later.

  2. Open the downloaded file to install it.

  3. If you are a homebrew fan, you can install it using this brew command: brew install python3

  4. To install homebrew package manager, see: brew.sh

Windows

如何在Windows上安装Python3.5

Download the latest build (pywin32-220.win-amd64-py3.5.exe is the latest build as of this writing) from here and run the downloaded executable.

Setup Libsodium

安装Libsodium

Indy also depends on libsodium, an awesome crypto library. These need to be installed separately.

Ubuntu

如何在Ubuntu上安装Libsodium系统库

  1. We need to install libsodium with the package manager. This typically requires a package repo that’s not active by default. Inspect /etc/apt/sources.list file with your favorite editor (using sudo). On ubuntu 16, you are looking for a line that says deb http://us.archive.ubuntu.com/ubuntu xenial main universe. On ubuntu 14, look for or add: deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main and deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main.

  2. Run sudo apt-get update. On ubuntu 14, if you get a GPG error about public key not available, run this command and then, after, retry apt-get update: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B9316A7BC7917B12

  3. Install libsodium; the version depends on your distro version. On Ubuntu 14, run sudo apt-get install libsodium13; on Ubuntu 16, run sudo apt-get install libsodium18

CentOS/Redhat

如何在CentOS或红帽上安装Libsodium系统库

Run sudo yum install libsodium-devel

Mac

如何在macOS上安装Libsodium系统库

Once you have homebrew installed, run brew install libsodium to install libsodium.

Windows

如何在Windows上安装Libsodium系统库

  1. Go to Index of /libsodium/releases/ and download the latest libsodium package (libsodium-1.0.8-mingw.tar.gz is the latest version as of this writing).

  2. When you extract the contents of the downloaded tar file, you will see 2 folders with the names libsodium-win32 and libsodium-win64.

  3. As the name suggests, use the libsodium-win32 if you are using 32-bit machine or libsodium-win64 if you are using a 64-bit operating system.

  4. Copy the libsodium-x.dll from libsodium-win32\bin or libsodium-win64\bin to C:\Windows\System or System32 and rename it to libsodium.dll.

Setup Indy-Crypto

安装Indy-Crypto

这里只演示了如何在Ubuntu系统上安装Indy-Crypto,想要了解在其他系统中如何安装Indy-Crypto,需要看扩展文档,扩展文档地址GitHub - hyperledger-archives/indy-crypto: Archive of Indy Crypto library. Superseded by the Hyperledger Ursa Project.) on how it can b

Indy depends on Indy-Crypto.

There is a deb package of libindy-crypto that can be used on Ubuntu:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/deb xenial master"
sudo apt-get update
sudo apt-get install libindy-crypto

See Indy-Crypto on how it can be installed on other platforms.

Setup RocksDB

Indy depends on RocksDB, an embeddable persistent key-value store for fast storage.

Indy项目使用了RocksDB数据库,RocksDB数据库是一种嵌入式持久化的数据库,以k-v对形式存储数据,RocksDB具有快速存储的特点,

Currently Indy requires RocksDB version 5.8.8 or higher. There is a deb package of RocksDB-5.8.8 and related stuff that can be used on Ubuntu 16.04 (repository configuration steps may be skipped if Indy-Crypto installation steps have been done):

# Start of repository configuration steps
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88
sudo add-apt-repository "deb https://repo.sovrin.org/deb xenial master"
# End of repository configuration steps
sudo apt-get update
sudo apt-get install libbz2-dev \zlib1g-dev \liblz4-dev \libsnappy-dev \rocksdb=5.8.8

See RocksDB on how it can be installed on other platforms.
想查看如何在其他系统中安装RocksDB,请点击这个地址:GitHub - facebook/rocksdb: A library that provides an embeddable, persistent key-value store for fast storage.

Setup Libindy

Indy needs Libindy as a test dependency.

There is a deb package of libindy that can be used on Ubuntu:

sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable"
sudo apt-get update
sudo apt-get install -y libindy
See Libindy on how it can be installed on other platforms. 想查看如何在其他系统中安装RocksDB,请点击这个地址GitHub - facebook/rocksdb: A library that provides an embeddable, persistent key-value store for fast storage.

Using a virtual environment (recommended)

We recommend creating a new Python virtual environment for trying out Indy. A virtual environment is a Python environment which is isolated from the system’s default Python environment (you can change that) and any other virtual environment you create.

You can create a new virtual environment by:

virtualenv -p python3.5 <name of virtual environment>

And activate it by:

source <name of virtual environment>/bin/activate

Optionally, you can install virtual environment wrapper as follows:

pip3 install virtualenvwrapper
echo '' >> ~/.bashrc
echo '# Python virtual environment wrapper' >> ~/.bashrc
echo 'export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3' >> ~/.bashrc
echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bashrc
echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc
source ~/.bashrc

It allows to create a new virtual environment and activate it by using

mkvirtualenv -p python3.5 <env_name>
workon <env_name>

Installing code and running tests

Activate the virtual environment.
启用Python虚拟环境

Navigate to the root directory of the source (for each project) and install required packages by
跳转到源码根目录下,安装必须的依赖包

下面的命令只是做了个命令示例,安装其他依赖包需要替换安装包名字

pip install -e .[tests]

If you are working with both indy-plenum and indy-node, then please make sure that both projects are installed with -e option, and not from pypi (have a look at the sequence at init-dev-project.sh).
如果要同时使用indy-node和indy-plenum项目,那么安装这2个项目的时候一定要使用pip install -e进行源码安装,不要使用pipy在线安装

Go to the folder with tests (either indy-plenum, indy-node/indy_node, indy-node/indy_client or indy-node/indy_common) and run tests
跳转到目标文件夹下进行测试,先面下面展示的是测试命令 需要执行该命令的目录有: indy-plenum, indy-node/indy_node, indy-node/indy_clientorindy-node/indy_common

pytest .

Hyperledger-indy 官方文档人工翻译相关推荐

  1. Pytorch官方文档英语翻译

    深度学习Pytorch-Pytorch官方文档英语翻译 1. a-e 1.1 span 跨度 1.2 blended 混合的 1.3 criterion 标准 1.4 deprecated 弃用的 1 ...

  2. Spring官方文档中文翻译

    准备做个Spring官方文档全翻译专栏以下是大目录, 本翻译是基于Spring5 Core Technologies

  3. python pymssql - pymssql模块官方文档的翻译

    译者注:译者博客(http://blog.csdn.net/lin_strong),转载请保留这条.此为pymssql模块version2.1.4官方文档的翻译,仅供学习交流使用,请勿用于商业用途. ...

  4. ElasticSearch Java High level Rest Client 官方文档中文翻译(一)

    ElasticSearch Java High level Rest Client 官方文档中文翻译 一 纯粹记录自己在看官网的es rest high level api 时的翻译笔记,可以对照着官 ...

  5. 【开源项目推荐】Android Jetpack 官方文档 中文翻译

    Jetpack 是 Android 软件组件的集合,使您可以更轻松地开发出色的 Android 应用.这些组件可帮助您遵循最佳做法.让您摆脱编写样板代码的工作并简化复杂任务,以便您将精力集中放在所需的 ...

  6. python的pymssql模块的报错_python pymssql - pymssql模块官方文档的翻译

    译者注:译者博客(http://blog.csdn.net/lin_strong),转载请保留这条.此为pymssql模块version2.1.4官方文档的翻译,仅供学习交流使用,请勿用于商业用途. ...

  7. CUDA10.0官方文档的翻译与学习之编程接口

    目录 背景 用nvcc编译 编译工作流 二进制适配性 ptx适配性 应用适配性 C/C++适配性 64位适配性 cuda c运行时 初始化 设备内存 共享内存 页锁主机内存 可移植内存 写合并内存 映 ...

  8. tez安装官方文档整理+翻译

    本文是对TEZ的官方文档[1]的翻译,重点都红色加粗标记,其他都是废话,直接跳过 Install/Deploy Instructions for Tez Replace x.y.z with the ...

  9. AsyncDisplayKit官方文档个人翻译

    迁移老文章到掘金 文档比较老了,不适用最新的2.0 AsyncDisplayKit 官方文档 最近在拆解学习AsyncDisplayKit这个很知名的轮子,发现这个轮子内容还是非常庞大的,想要分解学习 ...

最新文章

  1. 外链起到引导、推广排名的作用
  2. 从壹开始前后端分离【 .NET Core2.2 +Vue2.0 】框架之六 || API项目整体搭建 6.1 仓储+服务+抽象接口模式...
  3. 如何将SAP Multi Target应用部署到SAP云平台的Cloud Foundry环境去
  4. python 模拟登录验证码_Python模拟登陆 —— 征服验证码 3 CSDN
  5. Python 字典或JSON模拟数据库的增删改查
  6. markdown 流程图js_五分钟学会markdown基本语法
  7. 个性的留言.html,个性留言经典语录集锦
  8. 编程:中国有句俗话“三天打鱼两天晒网”,某人从1990年1月1日起三天打鱼两天晒网,编程计算他在某一天是打鱼还是晒网
  9. 【DSP】【第一篇】开始DSP学习
  10. 新款宝马MINI钥匙增加!轻松搞定,这MINI看着还可以噢
  11. 6-9 字符串匹配 - C/C++ 数组及字符串c语言c++
  12. 用TTreeview实现的一个通讯录的组别设置,
  13. [STM32] Stm32f103c8t6+RC522 实现读卡写卡功能(超详细,零基础,小白)
  14. 短网址短链接哪个好用?2021年最好的缩短链接短网址推荐
  15. 正则表达式与遇到的问题
  16. python中while True用法
  17. Xue Bin Peng获SIGGRAPH 2022最佳博士论文,太极胡渊鸣获提名
  18. idea中maven依赖引入不进来解决方法
  19. 通过高通平台简单总结的权限问题
  20. [计算机数值积分]龙贝格公式求数值积分

热门文章

  1. 一套新中控系统的功能介绍
  2. 爬虫百战(一):爬取当当网Top500本五星好评书籍
  3. 高频面试知识点总结,看看你能答对多少
  4. idea导入html项目,idea导入web项目教程
  5. KITL是怎么样工作的?
  6. 手机GPS为什么能在室内定位?
  7. css实现文本首行缩进
  8. 写了一个图片横向滚动且首尾相接的JS组件
  9. linux vi 改文件名,Linux命令符之编辑文本vi命令及修改文件名mv命令
  10. 抽象类和接口的区别、为什么用抽象类。