Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit 38dd0a1

Browse files
authored
Merge pull request #1597 from hyperledger/develop
Hyperledger Iroha v1.0 beta-4 version Signed-off-by: Nikolay Yushkevich <n.yushkevich@hotmail.com>
2 parents 60075d0 + 67c450e commit 38dd0a1

File tree

503 files changed

+18225
-9080
lines changed

Some content is hidden

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

503 files changed

+18225
-9080
lines changed

.jenkinsci/bindings.groovy

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env groovy
22

3-
def doJavaBindings(os, buildType=Release) {
3+
def doJavaBindings(os, packageName, buildType=Release) {
44
def currentPath = sh(script: "pwd", returnStdout: true).trim()
55
def commit = env.GIT_COMMIT
66
def artifactsPath = sprintf('%1$s/java-bindings-%2$s-%3$s-%4$s-%5$s.zip',
@@ -20,12 +20,15 @@ def doJavaBindings(os, buildType=Release) {
2020
-Bbuild \
2121
-DCMAKE_BUILD_TYPE=$buildType \
2222
-DSWIG_JAVA=ON \
23+
-DSWIG_JAVA_PKG="$packageName" \
2324
${cmakeOptions}
2425
"""
2526
def parallelismParam = (os == 'windows') ? '' : "-j${params.PARALLELISM}"
2627
sh "cmake --build build --target irohajava -- ${parallelismParam}"
2728
// TODO 29.05.18 @bakhtin Java tests never finishes on Windows Server 2016. IR-1380
28-
sh "zip -j $artifactsPath build/bindings/*.java build/bindings/*.dll build/bindings/libirohajava.so"
29+
sh "pushd build/bindings; \
30+
zip -r $artifactsPath *.dll *.lib *.manifest *.exp libirohajava.so \$(echo ${packageName} | cut -d '.' -f1); \
31+
popd"
2932
if (os == 'windows') {
3033
sh "cp $artifactsPath /tmp/${env.GIT_COMMIT}/bindings-artifact"
3134
}
@@ -66,27 +69,25 @@ def doPythonBindings(os, buildType=Release) {
6669
sh "cd build; ctest -R python --output-on-failure"
6770
if (os == 'linux') {
6871
sh """
69-
protoc --proto_path=schema \
70-
--python_out=build/bindings \
71-
block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto
72+
protoc --proto_path=shared_model/schema \
73+
--python_out=build/bindings shared_model/schema/*.proto
7274
"""
7375
sh """
74-
${env.PBVersion} -m grpc_tools.protoc --proto_path=schema --python_out=build/bindings \
75-
--grpc_python_out=build/bindings endpoint.proto yac.proto ordering.proto loader.proto
76+
${env.PBVersion} -m grpc_tools.protoc --proto_path=shared_model/schema --python_out=build/bindings \
77+
--grpc_python_out=build/bindings shared_model/schema/endpoint.proto
7678
"""
7779
}
7880
else if (os == 'windows') {
7981
sh """
80-
protoc --proto_path=schema \
82+
protoc --proto_path=shared_model/schema \
8183
--proto_path=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/buildtrees/protobuf/src/protobuf-3.5.1-win32/include \
82-
--python_out=build/bindings \
83-
block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto
84+
--python_out=build/bindings shared_model/schema/*.proto
8485
"""
8586
sh """
8687
${env.PBVersion} -m grpc_tools.protoc \
8788
--proto_path=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/buildtrees/protobuf/src/protobuf-3.5.1-win32/include \
88-
--proto_path=schema --python_out=build/bindings --grpc_python_out=build/bindings \
89-
endpoint.proto yac.proto ordering.proto loader.proto
89+
--proto_path=shared_model/schema --python_out=build/bindings --grpc_python_out=build/bindings \
90+
shared_model/schema/endpoint.proto
9091
"""
9192
}
9293
sh """

.jenkinsci/debug-build.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ def doDebugBuild(coverageEnabled=false) {
1717
if (env.NODE_NAME.contains('arm7')) {
1818
parallelism = 1
1919
}
20+
2021
sh "docker network create ${env.IROHA_NETWORK}"
2122
def iC = dPullOrBuild.dockerPullOrUpdate("${platform}-develop-build",
2223
"${env.GIT_RAW_BASE_URL}/${env.GIT_COMMIT}/docker/develop/Dockerfile",
2324
"${env.GIT_RAW_BASE_URL}/${previousCommit}/docker/develop/Dockerfile",
2425
"${env.GIT_RAW_BASE_URL}/develop/docker/develop/Dockerfile",
2526
['PARALLELISM': parallelism])
26-
27-
if (GIT_LOCAL_BRANCH == 'develop' && manifest.manifestSupportEnabled()) {
27+
// push Docker image in case the current branch is develop,
28+
// or it is a commit into PR which base branch is develop (usually develop -> master)
29+
if ((GIT_LOCAL_BRANCH == 'develop' || CHANGE_BRANCH_LOCAL == 'develop') && manifest.manifestSupportEnabled()) {
2830
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop-build",
2931
["${DOCKER_REGISTRY_BASENAME}:x86_64-develop-build",
3032
"${DOCKER_REGISTRY_BASENAME}:armv7l-develop-build",
@@ -42,6 +44,7 @@ def doDebugBuild(coverageEnabled=false) {
4244
manifest.manifestPush("${DOCKER_REGISTRY_BASENAME}:develop-build", login, password)
4345
}
4446
}
47+
4548
docker.image('postgres:9.5').withRun(""
4649
+ " -e POSTGRES_USER=${env.IROHA_POSTGRES_USER}"
4750
+ " -e POSTGRES_PASSWORD=${env.IROHA_POSTGRES_PASSWORD}"

.jenkinsci/docker-pull-or-build.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ def dockerPullOrUpdate(imageName, currentDockerfileURL, previousDockerfileURL, r
3838
def testExitCode = sh(script: "docker pull ${DOCKER_REGISTRY_BASENAME}:${imageName}", returnStatus: true)
3939
if (testExitCode != 0) {
4040
// image does not (yet) exist on Dockerhub. Build it
41-
iC = docker.build("${DOCKER_REGISTRY_BASENAME}:${commit}-${BUILD_NUMBER}", "$buildOptions --no-cache -f /tmp/${env.GIT_COMMIT}/f1 /tmp/${env.GIT_COMMIT}")
41+
iC = docker.build("${DOCKER_REGISTRY_BASENAME}:${commit}-${BUILD_NUMBER}", "$buildOptions --no-cache -f /tmp/${env.GIT_COMMIT}/f1 /tmp/${env.GIT_COMMIT}")
4242
}
4343
else {
4444
// no difference found compared to both previous and reference Dockerfile
4545
iC = docker.image("${DOCKER_REGISTRY_BASENAME}:${imageName}")
4646
}
4747
}
4848
}
49-
if (GIT_LOCAL_BRANCH ==~ /develop|master/) {
49+
if (GIT_LOCAL_BRANCH ==~ /develop|master/ || CHANGE_BRANCH_LOCAL == 'develop') {
5050
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
5151
iC.push(imageName)
5252
}

.jenkinsci/doxygen.groovy

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
#!/usr/bin/env groovy
22

33
def doDoxygen() {
4-
5-
sh """
6-
doxygen Doxyfile
7-
#rsync docs/doxygen
8-
"""
4+
if (env.GIT_LOCAL_BRANCH in ["master","develop"] || env.CHANGE_BRANCH_LOCAL == 'develop') {
5+
def branch = env.CHANGE_BRANCH_LOCAL == 'develop' ? env.CHANGE_BRANCH_LOCAL : env.GIT_LOCAL_BRANCH
6+
sh "doxygen Doxyfile"
7+
sshagent(['jenkins-artifact']) {
8+
sh "ssh-agent"
9+
sh """
10+
rsync \
11+
-e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
12+
-rzcv --delete \
13+
docs/doxygen/html/* \
14+
ubuntu@docs.iroha.tech:/var/nexus-efs/doxygen/${branch}/
15+
"""
16+
}
17+
}
918
}
1019

1120
return this

.jenkinsci/release-build.groovy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def doReleaseBuild() {
5656
sh "mv /tmp/${GIT_COMMIT}-${BUILD_NUMBER}/iroha.deb /tmp/${env.GIT_COMMIT}"
5757
sh "chmod +x /tmp/${env.GIT_COMMIT}/entrypoint.sh"
5858
iCRelease = docker.build("${DOCKER_REGISTRY_BASENAME}:${GIT_COMMIT}-${BUILD_NUMBER}-release", "--no-cache -f /tmp/${env.GIT_COMMIT}/Dockerfile /tmp/${env.GIT_COMMIT}")
59-
if (env.GIT_LOCAL_BRANCH == 'develop') {
59+
60+
// push Docker image in case the current branch is develop,
61+
// or it is a commit into PR which base branch is develop (usually develop -> master)
62+
if (GIT_LOCAL_BRANCH == 'develop' || CHANGE_BRANCH_LOCAL == 'develop') {
6063
iCRelease.push("${platform}-develop")
6164
if (manifest.manifestSupportEnabled()) {
6265
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop",
@@ -77,7 +80,7 @@ def doReleaseBuild() {
7780
}
7881
}
7982
}
80-
else if (env.GIT_LOCAL_BRANCH == 'master') {
83+
else if (GIT_LOCAL_BRANCH == 'master') {
8184
iCRelease.push("${platform}-latest")
8285
if (manifest.manifestSupportEnabled()) {
8386
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:latest",
@@ -98,6 +101,7 @@ def doReleaseBuild() {
98101
}
99102
}
100103
}
104+
101105
sh "docker rmi ${iCRelease.id}"
102106
}
103107
return this

CMakeLists.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
cmake_minimum_required(VERSION 3.5.1)
25

36
find_program(CCACHE_PROGRAM ccache)
@@ -9,8 +12,8 @@ endif()
912
PROJECT(iroha C CXX)
1013

1114
SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
12-
SET(CMAKE_CXX_FLAGS "-std=c++1y -Wall")
13-
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
15+
SET(CMAKE_CXX_FLAGS "-std=c++14 -Wall -fdiagnostics-color=always")
16+
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wno-error=deprecated-declarations")
1417
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wextra -Wno-unused-parameter -Wno-deprecated-declarations -O0")
1518
SET(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
1619
SET(CMAKE_INSTALL_RPATH "../lib")
@@ -100,16 +103,22 @@ message(STATUS "-DSUPPORT_PYTHON2=${SUPPORT_PYTHON2}")
100103
message(STATUS "-DSWIG_CSHARP=${SWIG_CSHARP}")
101104
message(STATUS "-DSWIG_NODE=${SWIG_NODE}")
102105

103-
SET(IROHA_SCHEMA_DIR "${PROJECT_SOURCE_DIR}/schema")
106+
set(IROHA_SCHEMA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/schema")
107+
set(SM_SCHEMA_DIR "${PROJECT_SOURCE_DIR}/shared_model/schema")
108+
set(SCHEMA_OUT_DIR ${CMAKE_BINARY_DIR}/schema)
104109
include_directories(
105110
${PROJECT_SOURCE_DIR}/irohad
106111
${PROJECT_SOURCE_DIR}/shared_model
107112
${PROJECT_SOURCE_DIR}/libs
108-
${IROHA_SCHEMA_DIR}
109113
)
110114

111115
SET(IROHA_ROOT_PROJECT ON)
112116

117+
# Boost uses RTTI to perform some actions (such as type erasure).
118+
# This is slow. This flag forces boost to use other methods,
119+
# which are generally faster
120+
add_definitions(-DBOOST_NO_RTTI)
121+
113122
include(FeatureSummary)
114123
include(cmake/functions.cmake)
115124
include(cmake/dependencies.cmake)
@@ -131,9 +140,7 @@ if(TESTING)
131140
endif()
132141

133142
if (FUZZING)
134-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
135-
add_subdirectory(fuzz)
136-
else()
137-
message(Fuzzing with compilers other than clang does not supported yet)
143+
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
144+
message(Fuzzing with compilers other than clang is not supported yet)
138145
endif()
139146
endif()

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ PROJECT_BRIEF = "Iroha - A simple, decentralized ledger http://iroha.te
5151
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
5252
# the logo to the output directory.
5353

54-
PROJECT_LOGO = ./docs/
54+
PROJECT_LOGO = ./docs/image_assets/iroha_logo_doxygen.png
5555

5656
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
5757
# into which the generated documentation will be written. If a relative path is

Jenkinsfile

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ properties([parameters([
99
choice(choices: 'Debug\nRelease', description: 'Iroha build type', name: 'build_type'),
1010
booleanParam(defaultValue: false, description: 'Build Java bindings', name: 'JavaBindings'),
1111
choice(choices: 'Release\nDebug', description: 'Java bindings build type', name: 'JBBuildType'),
12+
string(defaultValue: 'jp.co.soramitsu.iroha', description: 'Java bindings package name', name: 'JBPackageName'),
1213
booleanParam(defaultValue: false, description: 'Build Python bindings', name: 'PythonBindings'),
1314
choice(choices: 'Release\nDebug', description: 'Python bindings build type', name: 'PBBuildType'),
1415
choice(choices: 'python3\npython2', description: 'Python bindings version', name: 'PBVersion'),
1516
booleanParam(defaultValue: false, description: 'Build Android bindings', name: 'AndroidBindings'),
1617
choice(choices: '26\n25\n24\n23\n22\n21\n20\n19\n18\n17\n16\n15\n14', description: 'Android Bindings ABI Version', name: 'ABABIVersion'),
1718
choice(choices: 'Release\nDebug', description: 'Android bindings build type', name: 'ABBuildType'),
1819
choice(choices: 'arm64-v8a\narmeabi-v7a\narmeabi\nx86_64\nx86', description: 'Android bindings platform', name: 'ABPlatform'),
19-
booleanParam(defaultValue: false, description: 'Build docs', name: 'Doxygen'),
20+
booleanParam(defaultValue: true, description: 'Build docs', name: 'Doxygen'),
2021
string(defaultValue: '4', description: 'How much parallelism should we exploit. "4" is optimal for machines with modest amount of memory and at least 4 cores', name: 'PARALLELISM')])])
2122

2223

@@ -34,6 +35,7 @@ pipeline {
3435
IROHA_POSTGRES_USER = "pguser${GIT_COMMIT}"
3536
IROHA_POSTGRES_PASSWORD = "${GIT_COMMIT}"
3637
IROHA_POSTGRES_PORT = 5432
38+
CHANGE_BRANCH_LOCAL = ''
3739
}
3840

3941
options {
@@ -47,7 +49,13 @@ pipeline {
4749
agent { label 'master' }
4850
steps {
4951
script {
50-
if (GIT_LOCAL_BRANCH != "develop") {
52+
// need this for develop->master PR cases
53+
// CHANGE_BRANCH is not defined if this is a branch build
54+
try {
55+
CHANGE_BRANCH_LOCAL = env.CHANGE_BRANCH
56+
}
57+
catch(MissingPropertyException e) { }
58+
if (GIT_LOCAL_BRANCH != "develop" && CHANGE_BRANCH_LOCAL != "develop") {
5159
def builds = load ".jenkinsci/cancel-builds-same-job.groovy"
5260
builds.cancelSameJobBuilds()
5361
}
@@ -363,23 +371,32 @@ pipeline {
363371
stage('Build docs') {
364372
when {
365373
beforeAgent true
366-
allOf {
367-
expression { return params.Doxygen }
368-
expression { GIT_LOCAL_BRANCH ==~ /(master|develop)/ }
369-
}
374+
expression { return params.Doxygen }
370375
}
371376
// build docs on any vacant node. Prefer `x86_64` over
372377
// others as nodes are more powerful
373-
agent { label 'x86_64 || arm' }
378+
agent { label 'x86_64' }
374379
steps {
375380
script {
376381
def doxygen = load ".jenkinsci/doxygen.groovy"
377-
docker.image("${env.DOCKER_IMAGE}").inside {
378-
def scmVars = checkout scm
382+
def dPullOrBuild = load ".jenkinsci/docker-pull-or-build.groovy"
383+
def platform = sh(script: 'uname -m', returnStdout: true).trim()
384+
def iC = dPullOrBuild.dockerPullOrUpdate(
385+
"$platform-develop-build",
386+
"${env.GIT_RAW_BASE_URL}/${env.GIT_COMMIT}/docker/develop/Dockerfile",
387+
"${env.GIT_RAW_BASE_URL}/${env.GIT_PREVIOUS_COMMIT}/docker/develop/Dockerfile",
388+
"${env.GIT_RAW_BASE_URL}/develop/docker/develop/Dockerfile",
389+
['PARALLELISM': params.PARALLELISM])
390+
iC.inside() {
379391
doxygen.doDoxygen()
380392
}
381393
}
382394
}
395+
post {
396+
cleanup {
397+
cleanWs()
398+
}
399+
}
383400
}
384401
stage('Build bindings') {
385402
when {
@@ -410,7 +427,7 @@ pipeline {
410427
['PARALLELISM': params.PARALLELISM])
411428
if (params.JavaBindings) {
412429
iC.inside("-v /tmp/${env.GIT_COMMIT}/bindings-artifact:/tmp/bindings-artifact") {
413-
bindings.doJavaBindings('linux', params.JBBuildType)
430+
bindings.doJavaBindings('linux', params.JBPackageName, params.JBBuildType)
414431
}
415432
}
416433
if (params.PythonBindings) {
@@ -469,7 +486,7 @@ pipeline {
469486
script {
470487
def bindings = load ".jenkinsci/bindings.groovy"
471488
if (params.JavaBindings) {
472-
bindings.doJavaBindings('windows', params.JBBuildType)
489+
bindings.doJavaBindings('windows', params.JBPackageName, params.JBBuildType)
473490
}
474491
if (params.PythonBindings) {
475492
bindings.doPythonBindings('windows', params.PBBuildType)

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/960/badge)](https://bestpractices.coreinfrastructure.org/projects/960)
5-
[![codecov](https://codecov.io/gh/hyperledger/iroha/branch/master/graph/badge.svg)](https://codecov.io/gh/hyperledger/iroha)
65
[![Snap Status](https://build.snapcraft.io/badge/hyperledger/iroha.svg)](https://build.snapcraft.io/user/hyperledger/iroha)
7-
[![Build Status](https://jenkins.soramitsu.co.jp/buildStatus/icon?job=iroha/iroha-hyperledger/master)](https://jenkins.soramitsu.co.jp/job/iroha/iroha-hyperledger/master)
6+
[![Build Status](https://jenkins.soramitsu.co.jp/buildStatus/icon?job=iroha/iroha-hyperledger/master)](https://jenkins.soramitsu.co.jp/job/iroha/job/iroha-hyperledger/job/master/)
87
[![Throughput Graph](https://graphs.waffle.io/hyperledger/iroha/throughput.svg)](https://waffle.io/hyperledger/iroha/metrics/throughput)
98

109
Blockchain platform Hyperledger Iroha is designed for simple creation and management of assets. This is a distributed ledger of transactions.
@@ -25,7 +24,7 @@ Among the non-functional requirements can be noted a high degree of network faul
2524

2625
## Documentation
2726

28-
Our documentation is hosted at ReadTheDocs service here: [http://iroha.readthedocs.io](http://iroha.readthedocs.io/en/).
27+
Our documentation is hosted at ReadTheDocs service here: [http://iroha.readthedocs.io](http://iroha.readthedocs.io).
2928
We have documentation in several languages available and you are welcome to contribute on [POEditor website](https://poeditor.com/join/project/SFpZw7o33o)!
3029

3130
### How to explore Iroha really fast?
@@ -42,7 +41,7 @@ Yes, in [Java](http://iroha.readthedocs.io/en/latest/guides/libraries/java.html)
4241

4342
### Are there any example applications?
4443

45-
[Android point app](https://github.com/soramitsu/iroha-demo-android) and [JavaScript wallet](https://github.com/soramitsu/iroha-wallet-js).
44+
[Android point app](https://github.com/hyperledger/iroha-android/tree/master/iroha-android-sample) and [JavaScript wallet](https://github.com/soramitsu/iroha-wallet-js).
4645

4746
## Need help?
4847

clean.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
rm schema/*.{cc,h}
32
rm -rf external
43
rm -rf build
54
rm -rf cmake-build-debug

0 commit comments

Comments
 (0)