Skip to content

Commit 54ff345

Browse files
authored
Merge pull request #1604 from hyperledger/develop
v1.3 release
2 parents 349e7d7 + 52e0d9c commit 54ff345

File tree

119 files changed

+4091
-1281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+4091
-1281
lines changed

.github/TESTS_ALLOWED_TO_FAIL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
system_irohad_test

.github/build-iroha1.src.yml

Lines changed: 223 additions & 108 deletions
Large diffs are not rendered by default.

.github/chatops-gen-matrix.sh

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ handle_user_line(){
7373
fi
7474
shift
7575
local oses compilers cmake_opts build_types
76-
dockerpush=yes
7776

7877
while [[ $# > 0 ]] ;do
7978
case "$1" in
@@ -91,8 +90,6 @@ handle_user_line(){
9190
clang|clang-10|clang10) compilers+=" clang clang-10" ;;
9291
llvm) compilers+=" $1 " ;;
9392
msvc) compilers+=" $1 " ;;
94-
dockerpush) dockerpush=yes ;;
95-
nodockerpush) dockerpush=no ;;
9693
all|everything|beforemerge|before_merge|before-merge|readytomerge|ready-to-merge|ready_to_merge)
9794
oses=${oses:-"$ALL_oses"}
9895
build_types=${build_types:-"$ALL_build_types"}
@@ -163,13 +160,13 @@ rm -f $ignored
163160

164161

165162
to_json(){
166-
echo "{
167-
os:\"$1\",
168-
cc:\"$2\",
169-
BuildType:\"$3\",
170-
CMAKE_USE:\"$( [[ "$4" = normal ]] || echo "-DUSE_${4^^}=ON" )\",
171-
dockerpush: \"$dockerpush\"
172-
}"
163+
# echo "{
164+
# os:\"$1\",
165+
# cc:\"$2\",
166+
# BuildType:\"$3\",
167+
# CMAKE_USE:\"$( [[ "$4" = normal ]] || echo "-DUSE_${4^^}=ON" )\"
168+
# }"
169+
echo "{buildspec:\"$@\"}"
173170
}
174171
to_json_multiline(){
175172
echo [
@@ -187,9 +184,22 @@ json_include(){
187184

188185
MATRIX="$(echo "$MATRIX" | sed '/^$/d' | sort -uV)"
189186
echo "$MATRIX"
190-
echo "$MATRIX" | json_include >matrix
191-
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/' | json_include >matrix_ubuntu
192-
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /release/' | json_include >matrix_ubuntu_release
193-
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /debug/' | json_include >matrix_ubuntu_debug
194-
echo "$MATRIX" | awk -v IGNORECASE=1 '/macos/' | json_include >matrix_macos
195-
echo "$MATRIX" | awk -v IGNORECASE=1 '/windows/' | json_include >matrix_windows
187+
188+
echo "$MATRIX" >buildspec
189+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/' >buildspec_ubuntu
190+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /release/' >buildspec_ubuntu_release
191+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /debug/' >buildspec_ubuntu_debug
192+
echo "$MATRIX" | awk -v IGNORECASE=1 '/macos/' >buildspec_macos
193+
echo "$MATRIX" | awk -v IGNORECASE=1 '/windows/' >buildspec_windows
194+
## Build Docker images only with GCC-9 (mainstream compiler)
195+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /release/ && /gcc-9/' >buildspec_dockerimage_release
196+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /debug/ && /gcc-9/' >buildspec_dockerimage_debug
197+
198+
echo "$MATRIX" | json_include >matrix
199+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/' | json_include >matrix_ubuntu
200+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /release/' | json_include >matrix_ubuntu_release
201+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /debug/' | json_include >matrix_ubuntu_debug
202+
echo "$MATRIX" | awk -v IGNORECASE=1 '/macos/' | json_include >matrix_macos
203+
echo "$MATRIX" | awk -v IGNORECASE=1 '/windows/' | json_include >matrix_windows
204+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /release/ && /gcc-9/' | json_include >matrix_dockerimage_release
205+
echo "$MATRIX" | awk -v IGNORECASE=1 '/ubuntu/ && /debug/ && /gcc-9/' | json_include >matrix_dockerimage_debug

.github/workflows/build-iroha1.yml

Lines changed: 465 additions & 314 deletions
Large diffs are not rendered by default.

cmake/Modules/Findursa.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,20 @@ endif()
2727

2828
if(NOT TARGET hyperledger_ursa_build)
2929
find_package(OpenSSL REQUIRED)
30+
find_program(CARGO_BIN cargo PATHS /opt/rust/bin DOC "cargo executable for rust" REQUIRED)
3031

3132
get_filename_component(OPENSSL_ROOT_DIR ${OPENSSL_INCLUDE_DIR} DIRECTORY)
3233

33-
set(URL "https://github.com/hyperledger/ursa/")
34-
set(VERSION "d425dc2f721659f6bdec50a91d3cb9a1d21ec3f3")
35-
3634
file(MAKE_DIRECTORY ${URSA_LIB})
3735
file(MAKE_DIRECTORY ${URSA_INCL})
3836

3937
externalproject_add(hyperledger_ursa_build
40-
GIT_REPOSITORY ${URL}
41-
GIT_TAG ${VERSION}
38+
GIT_REPOSITORY "https://github.com/hyperledger/ursa/"
39+
GIT_TAG "d425dc2f721659f6bdec50a91d3cb9a1d21ec3f3"
4240
BUILD_IN_SOURCE 1
4341
BUILD_COMMAND ${CMAKE_COMMAND} -E
4442
env OPENSSL_DIR=${OPENSSL_ROOT_DIR}
45-
cargo build --release
43+
${CARGO_BIN} build --release
4644
CONFIGURE_COMMAND "" # remove configure step
4745
UPDATE_COMMAND "" # remove update step
4846
INSTALL_COMMAND "" # remove install step

cmake/dependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ find_package(rxcpp)
9898
##########################
9999
# boost #
100100
##########################
101-
find_package(Boost 1.65.0 REQUIRED
101+
find_package(Boost 1.73.0 REQUIRED
102102
COMPONENTS
103103
filesystem
104104
iostreams

docker/iroha-builder/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,21 @@ RUN cd /opt/ && \
3939
cd git-secret && make build && \
4040
PREFIX="/usr/local" make install
4141

42-
# golang stuff for iroha+burrow
42+
## golang stuff for iroha+burrow
4343
RUN curl -fL https://golang.org/dl/go1.14.2.linux-$(dpkg --print-architecture).tar.gz | tar -C /opt -xz
4444
ENV GOPATH=/opt/gopath
4545
RUN mkdir ${GOPATH}
4646
ENV PATH=${PATH}:/opt/go/bin:${GOPATH}/bin
4747
RUN go get github.com/golang/protobuf/protoc-gen-go
4848

49+
## Rust-lang stuff for iroha+ursa
50+
ENV RUSTUP_HOME=/opt/rust
51+
ENV CARGO_HOME=/opt/rust
52+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
53+
sh -s -- -y --no-modify-path --profile minimal ; \
54+
echo 'source /opt/rust/env' >>/etc/profile ; \
55+
echo 'source /opt/rust/env' >>/etc/bash.bashrc
56+
4957
## Allow access to database, trust local connections
5058
# RUN sed -i /etc/postgresql/12/main/pg_hba.conf -Ee's,(^local\s+all\s+postgres\s+)\w+,\1trust,'
5159
RUN echo " \n\

docs/source/_static/theme_overrides.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,17 @@
1212
overflow: auto !important;
1313
}
1414

15+
}
16+
17+
.toggle .header {
18+
display: block;
19+
clear: both;
20+
}
21+
22+
.toggle .header:after {
23+
content: " ▶";
24+
}
25+
26+
.toggle .header.open:after {
27+
content: " ▼";
1528
}

docs/source/build/index.rst

Lines changed: 79 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -52,45 +52,70 @@ Please choose your preferred platform below for a quick access:
5252
Docker
5353
^^^^^^
5454

55+
The idea of having up-to-date Docker images is to be able to run Iroha without the need to build it.
56+
But now you have the option to run not only the ready-to-use images but also a special **Iroha Builder** within Docker, to build Iroha the way you would like it.
57+
5558
First of all, you need to install ``docker`` and ``docker-compose``. You can
5659
read how to install it on the
5760
`Docker's website <https://www.docker.com/community-edition/>`_
5861

5962
.. note:: Please, use the latest available docker daemon and docker-compose.
6063

61-
Then you should clone the `Iroha repository <https://github.com/hyperledger/iroha>`_
62-
to the directory of your choice:
64+
Iroha Images
65+
""""""""""""
66+
67+
You can find all the Iroha Docker Images by `searching the Docker Hub <https://hub.docker.com/search?q=hyperledger%2Firoha&type=image>`_ or on `GitHub <https://github.com/orgs/hyperledger/packages?repo_name=iroha>`_.
68+
69+
There are currently the following images:
70+
71+
- ``iroha`` -- general build of Iroha 1.x;
72+
- ``iroha-burrow`` -- build that has Iroha 1.x with `Burrow integration <../integrations/index.html#hyperledger-burrow>`_;
73+
- ``iroha-ursa`` -- build that has Iroha 1.x with `Ursa integration <../https://iroha.readthedocs.io/en/develop/integrations/index.html#hyperledger-ursa>`_;
74+
- ``iroha2`` -- Iroha 2 build;
75+
- ``iroha-builder`` -- a special image that allows you to run an Iroha builder within Docker.
76+
77+
.. hint:: You can read more on running the images in the `Quick Start Guide <../getting_started/index.html>`_.
78+
79+
Each image can be used with a respective tag indicating a branch from which the image is built.
80+
All the available tags can be found on Docker Hub. `Here are all the tags <https://hub.docker.com/r/hyperledger/iroha/tags>`_ for ``iroha`` image.
81+
82+
For example, you can use ``iroha:develop`` for the development version of Iroha, or ``iroha:main`` for the release version. The same works with all the other images, too.
83+
84+
85+
Iroha Builder
86+
"""""""""""""
87+
88+
Iroha builder allows you to build Iroha with `any of the parameters available <#cmake-parameters>`_ for any other platform but to do it conveniently and securely in Docker.
89+
90+
Here are the steps:
91+
92+
1. First of all, let's run the builder:
6393

6494
.. code-block:: shell
6595
66-
git clone -b master https://github.com/hyperledger/iroha --depth=1
96+
docker run -it hyperledger/iroha-builder:latest
6797
68-
.. hint:: ``--depth=1`` option allows us to download only latest commit and
69-
save some time and bandwidth. If you want to get a full commit history, you
70-
can omit this option.
98+
On this step you will start and run the image in a container in an interactive mode. You can use any available tags, default one would be ``latest``, and developmnet tag is ``develop``. Note that you might need to perform some actions with ``sudo`` rights.
7199

72-
When it is done, you need to run the development environment. Run the
73-
``scripts/run-iroha-dev.sh`` script:
100+
2. When you are inside the container, clone Iroha repository:
74101

75102
.. code-block:: shell
76103
77-
bash scripts/run-iroha-dev.sh
104+
git clone https://github.com/hyperledger/iroha.git
78105
79-
.. hint:: Please make sure that Docker is running before executing the script.
80-
MacOS users could find a Docker icon in system tray, Linux users can use
81-
``systemctl start docker``
106+
3. When Iroha is cloned, go into Iroha folder:
82107

83-
After you execute this script, the following things will happen:
108+
.. code-block:: shell
109+
110+
cd iroha
84111
85-
#. The script will check whether you have containers with Iroha already running. Successful completion finishes with the new container shell.
112+
4. Then run the script that will build all the necessary dependencies via vcpkg:
86113

87-
#. The script will download ``hyperledger/iroha:develop-build`` and ``postgres`` images. ``hyperledger/iroha:develop-build`` image contains all development dependencies and is based on top of ``ubuntu:20.04``. ``postgres`` image is required for starting and running Iroha.
114+
.. code-block:: shell
88115
89-
#. Two containers are created and launched.
116+
./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build
90117
91-
#. The user is attached to the interactive environment for development and testing with ``iroha`` folder mounted from the host machine. Iroha folder is mounted to ``/opt/iroha`` in Docker container.
92118
93-
Now your are ready to build Iroha! Please go directly to `Building Iroha <#build-process>`_ section.
94119
95120
.. _linux-pre:
96121

@@ -110,6 +135,12 @@ Use this code to install environment dependencies on Debian-based Linux distro.
110135
build-essential ninja-build \
111136
git ca-certificates tar curl unzip cmake
112137
138+
.. Important:: If you would like to use `Burrow integration <../integrations/burrow.html>`_ you will also need GO. Install it following the instructions on `the official website <https://golang.org/doc/install>`_ and then use the following command:
139+
140+
.. code-block:: shell
141+
142+
go get github.com/golang/protobuf/protoc-gen-go
143+
113144
.. note:: If you are willing to actively develop Iroha and to build shared
114145
libraries, please consider installing the
115146
`latest release <https://cmake.org/download/>`_ of CMake.
@@ -133,6 +164,12 @@ to install all environment dependencies with Homebrew:
133164

134165
``ruby -e "$(curl -fsSL https://raw.githubusercontent.com/homebrew/install/master/install)"``
135166

167+
.. Important:: If you would like to use `Burrow integration <../integrations/burrow.html>`_ you will also need GO. Install it following the instructions on `the official website <https://golang.org/doc/install>`_ and then use the following command:
168+
169+
.. code-block:: shell
170+
171+
go get github.com/golang/protobuf/protoc-gen-go
172+
136173
Now you are ready to `install Iroha dependencies <#installing-dependencies-with-vcpkg-dependency-manager>`_.
137174

138175
.. _windows-pre:
@@ -184,12 +221,10 @@ Run in terminal:
184221
.. code-block:: shell
185222
186223
git clone https://github.com/hyperledger/iroha.git
187-
iroha/vcpkg/build_iroha_deps.sh
188-
iroha/vcpkg-build/vcpkg integrate install
224+
cd iroha
225+
./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build
189226
190-
After the installation of vcpkg you will be provided with a CMake build parameter like
191-
``-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake``.
192-
Save it somewhere for later use and move to `Building Iroha <#build-process>`_ section.
227+
And that is it! You can now move to `Building Iroha <#build-process>`_ section.
193228

194229
Windows
195230
^^^^^^^
@@ -199,11 +234,11 @@ Execute from Power Shell:
199234
.. code-block:: shell
200235
201236
git clone https://github.com/hyperledger/iroha.git
202-
powershell -ExecutionPolicy ByPass -File .\iroha\.packer\win\scripts\vcpkg.ps1 .\vcpkg .\iroha\vcpkg
237+
cd iroha
238+
powershell -ExecutionPolicy ByPass -File .\.packer\win\scripts\vcpkg.ps1 .\vcpkg .\iroha\vcpkg
203239
204-
After the installation of vcpkg you will be provided with a CMake build parameter like
205-
``-DCMAKE_TOOLCHAIN_FILE=C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake``.
206-
Save it somewhere for later use and move to `Building Iroha <#build-process>`_ section.
240+
241+
Great job! You can now move to `Building Iroha <#build-process>`_ section.
207242

208243
.. note:: If you plan to build 32-bit version of Iroha -
209244
you will need to install all the mentioned librares above
@@ -212,57 +247,44 @@ Save it somewhere for later use and move to `Building Iroha <#build-process>`_ s
212247
Build Process
213248
=============
214249

215-
Cloning the Repository
216-
^^^^^^^^^^^^^^^^^^^^^^
217-
This step is currently unnecessary since you have already cloned Iroha in the previous step.
218-
But if you want, you can clone the `Iroha repository <https://github.com/hyperledger/iroha>`_ to the
219-
directory of your choice.
250+
Building Iroha
251+
^^^^^^^^^^^^^^
220252

221-
.. code-block:: shell
253+
1. So, after the dependencies are built, we can start building Iroha itself:
222254

223-
git clone -b master https://github.com/hyperledger/iroha
224-
cd iroha
255+
.. code-block:: shell
225256
226-
.. hint:: If you have installed the prerequisites with Docker, you don't need
227-
to clone Iroha again, because when you run ``run-iroha-dev.sh`` it attaches
228-
to Iroha source code folder. Feel free to edit source code files with your
229-
host environment and build it within docker container.
257+
cmake -B build -DCMAKE_TOOLCHAIN_FILE=$PWD/vcpkg-build/scripts/buildsystems/vcpkg.cmake . -DCMAKE_BUILD_TYPE=RELEASE -GNinja -DUSE_BURROW=OFF -DUSE_URSA=OFF -DTESTING=OFF -DPACKAGE_DEB=OFF
230258
259+
The cmake parameters such as ``-DUSE_BURROW=ON`` are exactly the parameters you can choose for your very special build. You can see the full list and description of these parameters `here <#cmake-parameters>`_.
231260

232-
Building Iroha
233-
^^^^^^^^^^^^^^
234-
235-
To build Iroha, use these commands:
261+
2. Run
236262

237263
.. code-block:: shell
238264
239-
mkdir build
240-
cd build
241-
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Ninja" ..
242-
cmake --build . --target irohad -- -j<number of threads>
265+
cmake --build . --target irohad
243266
244267
.. warning:: If you want to use tests later, instead of building `irohad` target, you need to use this:
245268

246269
.. code-block:: shell
247270
248-
mkdir build
249-
cd build
250-
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Ninja" ..
251-
cmake --build . --target all -- -j<number of threads>
271+
cmake --build . --target all
272+
252273
253-
.. note:: On Docker the path to a toolchain file is ``/opt/dependencies/scripts/buildsystems/vcpkg.cmake``. In other
254-
environment please use the path you have got in previous steps.
274+
3. Check the result by running the help:
255275

256-
Number of threads will be defined differently depending on the platform:
276+
.. code-block:: shell
257277
258-
- On Linux: via ``nproc``.
259-
- On MacOS: with ``sysctl -n hw.ncpu``.
260-
- On Windows: use ``echo %NUMBER_OF_PROCESSORS%``.
278+
./build/bin/irohad --help
279+
280+
This step will show you all the parameters. And that is it!
261281

262282
.. note:: When building on Windows do not execute this from the Power Shell. Better use x64 Native tools command prompt.
263283

264284
Now Iroha is built. Although, if you like, you can build it with additional parameters described below.
265285

286+
If you are content with the results, you can move to the next step and `run an Iroha instance <../deploy/single.html>`_.
287+
266288
CMake Parameters
267289
^^^^^^^^^^^^^^^^
268290

docs/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# Add any Sphinx extension module names here, as strm2rngs. They can be
2323
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2424
# ones.
25+
26+
2527
extensions = [
2628
'sphinx.ext.autodoc',
2729
'sphinx.ext.doctest',

0 commit comments

Comments
 (0)