Skip to content

Commit 2429e0c

Browse files
Merge pull request hyperledger-indy#667 from dbluhm/master
Make clarifying changes in README and rhel-build Skip CI as the PR includes only docs updates
2 parents 7948672 + e7a0f83 commit 2429e0c

File tree

2 files changed

+169
-110
lines changed

2 files changed

+169
-110
lines changed

README.md

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@ in project IS (note that regular Indy tickets are in the INDY project instead...
1515
us on [Hyperledger's Rocket.Chat](https://chat.hyperledger.org/) at #indy-sdk to discuss.
1616

1717

18-
## How to install
18+
## Installation
1919
### Release channels
2020
Indy SDK release process defines the following release channels:
21-
21+
2222
* `master` - development builds for each push to master branch.
2323
* `rc` - release candidates.
2424
* `stable` - stable releases.
2525

2626
Please refer to [release workflow](doc/release-workflow.md) for more details.
27-
### Install for Ubuntu based distro (Ubuntu 16.04)
27+
28+
### Ubuntu based distributions (Ubuntu 16.04)
2829
It is recommended to install packages with APT:
29-
30+
3031
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
3132
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial {release channel}"
3233
sudo apt-get update
3334
sudo apt-get install -y libindy
3435

3536
{release channel} must be replaced with master, rc or stable to define corresponded release channel.
36-
See section "Release channels" for more details.
37-
38-
### Install for Windows
37+
See section "Release channels" for more details.
38+
39+
### Windows
3940

4041
1. follow to https://repo.sovrin.org/windows/libindy/{release-channel}.
4142
2. download last version of libindy.
4243
3. unzip archives to directory, where you want to save working library.
4344
4. After unzip you will get next structure of files:
4445

45-
4646
* `Your working directory`
4747
* `include`
4848
* `...`
@@ -52,64 +52,67 @@ See section "Release channels" for more details.
5252
* `libsodium.dll`
5353
* `libzmq.dll`
5454
* `ssleay32md.dll`
55-
55+
5656
`include` contains c-header files which contains all necessary declarations
57-
that may be need for your applications.
57+
that may be need for your applications.
5858

5959
`lib` contains all necessary binaries which contains libindy and all it's dependencies.
6060
`You must add to PATH environment variable path to lib`. It's necessary for dynamic linkage
61-
your application with libindy.
61+
your application with libindy.
6262

6363
{release channel} must be replaced with master, rc or stable to define corresponded release channel.
6464
See section "Release channels" for more details.
65-
### Install for iOS
6665

66+
### iOS
6767
See [wrapper iOS install documentation](wrappers/ios/README.md "How to install").
6868

69-
### Install for MacOS
70-
Now we haven't prebuild library in some shared place. You can build
71-
library yourself. Please refer to How-to-build section.
69+
### MacOS
70+
71+
Pre-built libraries are not provided for MacOS. Please look [here](doc/mac-build.md)
72+
for details on building from source for MacOS.
7273

73-
After build add to LD_LIBRARY_PATH and to DYLD_LIBRARY_PATH
74-
environment variables path to builded library. It's necessary
75-
for dynamic linkage your application with libindy. At first dynamic linker
76-
browse library in LD_LIBRARY_PATH, if library in your application doesn't include directory names.
77-
If library in your application include any directory name, then dynamic linker will search library
78-
in DYLD_LIBRARY_PATH(not LD_LIBRARY_PATH). So for reliability we recommend you set both this variables.
79-
80-
### Install for RHEL based distro (Amazon Linux 2017.03)
81-
Now we haven't prebuild library in some shared place. You can build
82-
library yourself. Please refer to How-to-build section.
74+
After building `libindy`, add the path containing the library the `LD_LIBRARY_PATH` and
75+
`DYLD_LIBRARY_PATH` environment variables. This is necessary for dynamically linking
76+
your application with `libindy`. The dynamic linker will first check for the library in
77+
`LD_LIBRARY_PATH` if the library in your application doesn't include directory names.
78+
If the library in your application does include any directory name, then dynamic
79+
linker will search for the library in `DYLD_LIBRARY_PATH` (not `LD_LIBRARY_PATH`)
80+
so we recommend you set both variables to be safe.
8381

84-
After build add to LD_LIBRARY_PATH environment variable path to builded library.
85-
It's necessary for dynamic linkage your application with libindy.
82+
### RHEL-based distributions (Amazon Linux 2017.03)
83+
Pre-built libraries are not provided for RHEL-based distributions. Please look [here](doc/rhel-build.md)
84+
for details on building from source for RHEL-based distributions.
85+
86+
After successfully compiling `libindy`, you will need to add the path containing `libindy.so` to the
87+
`LD_LIBRARY_PATH` environment variable. This is required for your application to link to
88+
`libindy`.
8689

8790
## How to build
8891

89-
* [Ubuntu based distro (Ubuntu 16.04)](doc/ubuntu-build.md)
90-
* [RHEL based distro (Amazon Linux 2017.03)](doc/rhel-build.md)
92+
* [Ubuntu based distributions (Ubuntu 16.04)](doc/ubuntu-build.md)
93+
* [RHEL based distributions (Amazon Linux 2017.03)](doc/rhel-build.md)
9194
* [Windows](doc/windows-build.md)
9295
* [MacOS](doc/mac-build.md)
9396

9497
## How to start local nodes pool with docker
9598

9699
Start local nodes pool on `127.0.0.1:9701-9708` with Docker:
97-
98-
```
100+
101+
```
99102
docker build -f ci/indy-pool.dockerfile -t indy_pool .
100103
docker run -itd -p 9701-9708:9701-9708 indy_pool
101-
```
102-
103-
Dockerfile `ci/indy-pool.dockerfile` supports optional pool_ip param that allows
104-
changing ip of pool nodes in generated pool configuration. The following commands
105-
allow to start local nodes pool in custom docker network and access this pool
104+
```
105+
106+
Dockerfile `ci/indy-pool.dockerfile` supports optional pool_ip param that allows
107+
changing ip of pool nodes in generated pool configuration. The following commands
108+
allow to start local nodes pool in custom docker network and access this pool
106109
by custom ip in docker network:
107-
110+
108111
```
109112
docker network create --subnet 10.0.0.0/8 indy_pool_network
110113
docker build --build-arg pool_ip=10.0.0.2 -f ci/indy-pool.dockerfile -t indy_pool .
111114
docker run -d --ip="10.0.0.2" --net=indy_pool_network indy_pool
112-
```
115+
```
113116
Note that for Windows and MacOS this approach has some issues. Docker for these OS run in
114117
their virtual environment. First command creates network for container and host can't
115118
get access to that network because container placed on virtual machine. You must appropriate set up

doc/rhel-build.md

Lines changed: 128 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,130 @@
1-
# Setup Indy SDK build environment for RHEL based distro (Amazon Linux 2017.03)
2-
3-
1. Install Rust and rustup (https://www.rust-lang.org/install.html).
4-
1. Install required native libraries and utilities available in repos:
5-
6-
```
7-
yum clean all
8-
yum upgrade -y
9-
yum groupinstall -y "Development Tools"
10-
yum install -y \
11-
wget \
12-
cmake \
13-
pkgconfig \
14-
openssl-devel \
15-
sqlite-devel
16-
```
17-
1. Build and install modern version of libsodium from sources:
18-
19-
```
20-
cd /tmp
21-
curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.12.tar.gz | tar -xz
22-
cd /tmp/libsodium-1.0.12
23-
./configure
24-
make
25-
make install
26-
rm -rf /tmp/libsodium-1.0.12
27-
28-
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
29-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
30-
```
31-
32-
1. Checkout and build the library:
33-
34-
```
35-
git checkout https://github.com/hyperledger/indy-sdk.git
36-
cd ./indy-sdk
37-
cargo build
38-
```
39-
1. Run integration tests:
40-
* Start local nodes pool on `127.0.0.1:9701-9708` with Docker:
41-
42-
```
43-
docker build -f ci/indy-pool.dockerfile -t indy_pool .
44-
docker run -itd -p 9701-9709:9701-9709 indy_pool
45-
```
46-
47-
In some environments, this approach with mapping of local ports to container ports
48-
can't be applied. Dockerfile `ci/indy-pool.dockerfile` supports optional pool_ip param
49-
that allows changing ip of pool nodes in generated pool configuration. The following
50-
commands allow to start local nodes pool in custom docker network and access this pool by
51-
custom ip in docker network:
52-
53-
```
54-
docker network create --subnet 10.0.0.0/8 indy_pool_network
55-
docker build --build-arg pool_ip=10.0.0.2 -f ci/indy-pool.dockerfile -t indy_pool .
56-
docker run -d --ip="10.0.0.2" --net=indy_pool_network indy_pool
57-
```
58-
59-
It can be usefull if we wants to launch integration tests inside another container attached to
60-
the same docker network.
61-
62-
* Run tests
63-
64-
```
65-
RUST_TEST_THREADS=1 cargo test
66-
```
67-
68-
It is possible to change ip of test pool by providing of TEST_POOL_IP environment variable:
69-
70-
```
71-
RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test
72-
```
1+
# Setup Indy SDK build environment for RHEL-based distributions
2+
These instructions have been tested on:
3+
- Amazon Linux 2017.03
4+
- Fedora 27
5+
6+
Please follow the instructions appropriate for your distribution.
7+
8+
## Building `libindy`
9+
### 1. Install Rust
10+
Installation via `rustup` is recommended. Follow
11+
[these instructions](https://www.rust-lang.org/install.html).
12+
13+
### 2. Install dependencies available in system repositories
14+
15+
For Amazon Linux 2017.03/CentOS/RHEL:
16+
```
17+
yum clean all
18+
yum upgrade -y
19+
yum groupinstall -y "Development Tools"
20+
yum install -y \
21+
wget \
22+
cmake \
23+
pkgconfig \
24+
openssl-devel \
25+
sqlite-devel
26+
```
27+
28+
For Fedora 26/27/28:
29+
```
30+
dnf clean all
31+
dnf upgrade -y
32+
dnf groupinstall -y "Development Tools"
33+
dnf install -y \
34+
wget \
35+
cmake \
36+
pkgconfig \
37+
openssl-devel \
38+
sqlite-devel
39+
```
40+
41+
### 3. Build and install a modern version of `libsodium` from source
42+
For Amazon Linux 2017.03 or other distributions without `libsodium` available in system repositories:
43+
```
44+
cd /tmp
45+
curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.12.tar.gz | tar -xz
46+
cd /tmp/libsodium-1.0.12
47+
./configure
48+
make
49+
make install
50+
rm -rf /tmp/libsodium-1.0.12
51+
52+
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
53+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
54+
```
55+
56+
For Fedora 26/27/28, `libsodium-1.0.14` is already available as a system package:
57+
```
58+
dnf install libsodium libsodium-devel
59+
```
60+
61+
### 4. Additional dependencies
62+
For Fedora 26/27/28, you may also need to install `zeromq` (`libzmq`) before being able to successfully
63+
build `libindy`:
64+
```
65+
dnf install zeromq zeromq-devel
66+
```
67+
If you discover that there are other dependencies not mentioned here, please open an issue.
68+
69+
### 5. Checkout and build the library
70+
```
71+
git checkout https://github.com/hyperledger/indy-sdk.git
72+
cd ./indy-sdk/libindy
73+
cargo build
74+
```
75+
76+
## Building `indy-cli`
77+
`indy-cli` is dependent on `libindy` and must be built before `indy-cli`.
78+
79+
After building `libindy`, run the following commands from the `indy-sdk` directory:
80+
```
81+
cd indy-cli
82+
RUSTFLAGS="-L ../libindy/target/{BUILD_TYPE}" cargo build
83+
```
84+
In the above command, substitute `{BUILD_TYPE}` with `release` or `debug` as appropriate.
85+
86+
If you have installed `libindy.so` to a system-wide location and subsequently run `ldconfig`, you do not need
87+
to specify the `RUSTFLAGS` environment variable as `rustc` should be able to find `libindy.so` without additional
88+
help.
89+
90+
If not, however, `indy-cli` needs help to be able to find `libindy.so` while being built. Setting `LD_LIBRARY_PATH`
91+
is only referenced at runtime and not at build time and is not helpful in this case. Specifying `RUSTFLAGS` in the
92+
command above will tell `rustc` to also check `../libindy/target/{BUILD_TYPE}` for libraries.
93+
94+
## Running integration tests
95+
### Starting up
96+
Start local nodes pool on `127.0.0.1:9701-9708` with Docker:
97+
98+
```
99+
docker build -f ci/indy-pool.dockerfile -t indy_pool .
100+
docker run -itd -p 9701-9709:9701-9709 indy_pool
101+
```
102+
103+
In some environments, this approach with mapping of local ports to container ports
104+
can't be applied. Dockerfile `ci/indy-pool.dockerfile` supports optional `pool_ip` param
105+
that allows changing ip of pool nodes in generated pool configuration. The following
106+
commands allow to start local nodes pool in custom docker network and access this pool by
107+
custom ip in docker network:
108+
109+
```
110+
docker network create --subnet 10.0.0.0/8 indy_pool_network
111+
docker build --build-arg pool_ip=10.0.0.2 -f ci/indy-pool.dockerfile -t indy_pool .
112+
docker run -d --ip="10.0.0.2" --net=indy_pool_network indy_pool
113+
```
114+
115+
This may be useful if you want to launch integration tests inside another container attached to
116+
the same docker network.
117+
118+
### Run tests
119+
120+
```
121+
RUST_TEST_THREADS=1 cargo test
122+
```
123+
124+
It is possible to change ip of test pool by providing of TEST_POOL_IP environment variable:
125+
126+
```
127+
RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test
128+
```
73129

74130
See [ci/amazon.dockerfile](https://github.com/hyperledger/indy-sdk/blob/master/libindy/ci/amazon.dockerfile) for example of Amazon Linux based environment creation in Docker.

0 commit comments

Comments
 (0)