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

Commit

Permalink
Merge pull request #1597 from hyperledger/develop
Browse files Browse the repository at this point in the history
Hyperledger Iroha v1.0 beta-4 version

Signed-off-by: Nikolay Yushkevich <[email protected]>
  • Loading branch information
neewy authored Aug 2, 2018
2 parents 60075d0 + 67c450e commit 38dd0a1
Show file tree
Hide file tree
Showing 503 changed files with 18,225 additions and 9,080 deletions.
25 changes: 13 additions & 12 deletions .jenkinsci/bindings.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env groovy

def doJavaBindings(os, buildType=Release) {
def doJavaBindings(os, packageName, buildType=Release) {
def currentPath = sh(script: "pwd", returnStdout: true).trim()
def commit = env.GIT_COMMIT
def artifactsPath = sprintf('%1$s/java-bindings-%2$s-%3$s-%4$s-%5$s.zip',
Expand All @@ -20,12 +20,15 @@ def doJavaBindings(os, buildType=Release) {
-Bbuild \
-DCMAKE_BUILD_TYPE=$buildType \
-DSWIG_JAVA=ON \
-DSWIG_JAVA_PKG="$packageName" \
${cmakeOptions}
"""
def parallelismParam = (os == 'windows') ? '' : "-j${params.PARALLELISM}"
sh "cmake --build build --target irohajava -- ${parallelismParam}"
// TODO 29.05.18 @bakhtin Java tests never finishes on Windows Server 2016. IR-1380
sh "zip -j $artifactsPath build/bindings/*.java build/bindings/*.dll build/bindings/libirohajava.so"
sh "pushd build/bindings; \
zip -r $artifactsPath *.dll *.lib *.manifest *.exp libirohajava.so \$(echo ${packageName} | cut -d '.' -f1); \
popd"
if (os == 'windows') {
sh "cp $artifactsPath /tmp/${env.GIT_COMMIT}/bindings-artifact"
}
Expand Down Expand Up @@ -66,27 +69,25 @@ def doPythonBindings(os, buildType=Release) {
sh "cd build; ctest -R python --output-on-failure"
if (os == 'linux') {
sh """
protoc --proto_path=schema \
--python_out=build/bindings \
block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto
protoc --proto_path=shared_model/schema \
--python_out=build/bindings shared_model/schema/*.proto
"""
sh """
${env.PBVersion} -m grpc_tools.protoc --proto_path=schema --python_out=build/bindings \
--grpc_python_out=build/bindings endpoint.proto yac.proto ordering.proto loader.proto
${env.PBVersion} -m grpc_tools.protoc --proto_path=shared_model/schema --python_out=build/bindings \
--grpc_python_out=build/bindings shared_model/schema/endpoint.proto
"""
}
else if (os == 'windows') {
sh """
protoc --proto_path=schema \
protoc --proto_path=shared_model/schema \
--proto_path=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/buildtrees/protobuf/src/protobuf-3.5.1-win32/include \
--python_out=build/bindings \
block.proto primitive.proto commands.proto queries.proto responses.proto endpoint.proto
--python_out=build/bindings shared_model/schema/*.proto
"""
sh """
${env.PBVersion} -m grpc_tools.protoc \
--proto_path=/c/Users/Administrator/Downloads/vcpkg-master/vcpkg-master/buildtrees/protobuf/src/protobuf-3.5.1-win32/include \
--proto_path=schema --python_out=build/bindings --grpc_python_out=build/bindings \
endpoint.proto yac.proto ordering.proto loader.proto
--proto_path=shared_model/schema --python_out=build/bindings --grpc_python_out=build/bindings \
shared_model/schema/endpoint.proto
"""
}
sh """
Expand Down
7 changes: 5 additions & 2 deletions .jenkinsci/debug-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ def doDebugBuild(coverageEnabled=false) {
if (env.NODE_NAME.contains('arm7')) {
parallelism = 1
}

sh "docker network create ${env.IROHA_NETWORK}"
def iC = dPullOrBuild.dockerPullOrUpdate("${platform}-develop-build",
"${env.GIT_RAW_BASE_URL}/${env.GIT_COMMIT}/docker/develop/Dockerfile",
"${env.GIT_RAW_BASE_URL}/${previousCommit}/docker/develop/Dockerfile",
"${env.GIT_RAW_BASE_URL}/develop/docker/develop/Dockerfile",
['PARALLELISM': parallelism])

if (GIT_LOCAL_BRANCH == 'develop' && manifest.manifestSupportEnabled()) {
// push Docker image in case the current branch is develop,
// or it is a commit into PR which base branch is develop (usually develop -> master)
if ((GIT_LOCAL_BRANCH == 'develop' || CHANGE_BRANCH_LOCAL == 'develop') && manifest.manifestSupportEnabled()) {
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop-build",
["${DOCKER_REGISTRY_BASENAME}:x86_64-develop-build",
"${DOCKER_REGISTRY_BASENAME}:armv7l-develop-build",
Expand All @@ -42,6 +44,7 @@ def doDebugBuild(coverageEnabled=false) {
manifest.manifestPush("${DOCKER_REGISTRY_BASENAME}:develop-build", login, password)
}
}

docker.image('postgres:9.5').withRun(""
+ " -e POSTGRES_USER=${env.IROHA_POSTGRES_USER}"
+ " -e POSTGRES_PASSWORD=${env.IROHA_POSTGRES_PASSWORD}"
Expand Down
4 changes: 2 additions & 2 deletions .jenkinsci/docker-pull-or-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def dockerPullOrUpdate(imageName, currentDockerfileURL, previousDockerfileURL, r
def testExitCode = sh(script: "docker pull ${DOCKER_REGISTRY_BASENAME}:${imageName}", returnStatus: true)
if (testExitCode != 0) {
// image does not (yet) exist on Dockerhub. Build it
iC = docker.build("${DOCKER_REGISTRY_BASENAME}:${commit}-${BUILD_NUMBER}", "$buildOptions --no-cache -f /tmp/${env.GIT_COMMIT}/f1 /tmp/${env.GIT_COMMIT}")
iC = docker.build("${DOCKER_REGISTRY_BASENAME}:${commit}-${BUILD_NUMBER}", "$buildOptions --no-cache -f /tmp/${env.GIT_COMMIT}/f1 /tmp/${env.GIT_COMMIT}")
}
else {
// no difference found compared to both previous and reference Dockerfile
iC = docker.image("${DOCKER_REGISTRY_BASENAME}:${imageName}")
}
}
}
if (GIT_LOCAL_BRANCH ==~ /develop|master/) {
if (GIT_LOCAL_BRANCH ==~ /develop|master/ || CHANGE_BRANCH_LOCAL == 'develop') {
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
iC.push(imageName)
}
Expand Down
19 changes: 14 additions & 5 deletions .jenkinsci/doxygen.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/usr/bin/env groovy

def doDoxygen() {

sh """
doxygen Doxyfile
#rsync docs/doxygen
"""
if (env.GIT_LOCAL_BRANCH in ["master","develop"] || env.CHANGE_BRANCH_LOCAL == 'develop') {
def branch = env.CHANGE_BRANCH_LOCAL == 'develop' ? env.CHANGE_BRANCH_LOCAL : env.GIT_LOCAL_BRANCH
sh "doxygen Doxyfile"
sshagent(['jenkins-artifact']) {
sh "ssh-agent"
sh """
rsync \
-e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
-rzcv --delete \
docs/doxygen/html/* \
[email protected]:/var/nexus-efs/doxygen/${branch}/
"""
}
}
}

return this
8 changes: 6 additions & 2 deletions .jenkinsci/release-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def doReleaseBuild() {
sh "mv /tmp/${GIT_COMMIT}-${BUILD_NUMBER}/iroha.deb /tmp/${env.GIT_COMMIT}"
sh "chmod +x /tmp/${env.GIT_COMMIT}/entrypoint.sh"
iCRelease = docker.build("${DOCKER_REGISTRY_BASENAME}:${GIT_COMMIT}-${BUILD_NUMBER}-release", "--no-cache -f /tmp/${env.GIT_COMMIT}/Dockerfile /tmp/${env.GIT_COMMIT}")
if (env.GIT_LOCAL_BRANCH == 'develop') {

// push Docker image in case the current branch is develop,
// or it is a commit into PR which base branch is develop (usually develop -> master)
if (GIT_LOCAL_BRANCH == 'develop' || CHANGE_BRANCH_LOCAL == 'develop') {
iCRelease.push("${platform}-develop")
if (manifest.manifestSupportEnabled()) {
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:develop",
Expand All @@ -77,7 +80,7 @@ def doReleaseBuild() {
}
}
}
else if (env.GIT_LOCAL_BRANCH == 'master') {
else if (GIT_LOCAL_BRANCH == 'master') {
iCRelease.push("${platform}-latest")
if (manifest.manifestSupportEnabled()) {
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:latest",
Expand All @@ -98,6 +101,7 @@ def doReleaseBuild() {
}
}
}

sh "docker rmi ${iCRelease.id}"
}
return this
23 changes: 15 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.5.1)

find_program(CCACHE_PROGRAM ccache)
Expand All @@ -9,8 +12,8 @@ endif()
PROJECT(iroha C CXX)

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

SET(IROHA_SCHEMA_DIR "${PROJECT_SOURCE_DIR}/schema")
set(IROHA_SCHEMA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/schema")
set(SM_SCHEMA_DIR "${PROJECT_SOURCE_DIR}/shared_model/schema")
set(SCHEMA_OUT_DIR ${CMAKE_BINARY_DIR}/schema)
include_directories(
${PROJECT_SOURCE_DIR}/irohad
${PROJECT_SOURCE_DIR}/shared_model
${PROJECT_SOURCE_DIR}/libs
${IROHA_SCHEMA_DIR}
)

SET(IROHA_ROOT_PROJECT ON)

# Boost uses RTTI to perform some actions (such as type erasure).
# This is slow. This flag forces boost to use other methods,
# which are generally faster
add_definitions(-DBOOST_NO_RTTI)

include(FeatureSummary)
include(cmake/functions.cmake)
include(cmake/dependencies.cmake)
Expand All @@ -131,9 +140,7 @@ if(TESTING)
endif()

if (FUZZING)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_subdirectory(fuzz)
else()
message(Fuzzing with compilers other than clang does not supported yet)
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(Fuzzing with compilers other than clang is not supported yet)
endif()
endif()
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ PROJECT_BRIEF = "Iroha - A simple, decentralized ledger http://iroha.te
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.

PROJECT_LOGO = ./docs/
PROJECT_LOGO = ./docs/image_assets/iroha_logo_doxygen.png

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
Expand Down
39 changes: 28 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ properties([parameters([
choice(choices: 'Debug\nRelease', description: 'Iroha build type', name: 'build_type'),
booleanParam(defaultValue: false, description: 'Build Java bindings', name: 'JavaBindings'),
choice(choices: 'Release\nDebug', description: 'Java bindings build type', name: 'JBBuildType'),
string(defaultValue: 'jp.co.soramitsu.iroha', description: 'Java bindings package name', name: 'JBPackageName'),
booleanParam(defaultValue: false, description: 'Build Python bindings', name: 'PythonBindings'),
choice(choices: 'Release\nDebug', description: 'Python bindings build type', name: 'PBBuildType'),
choice(choices: 'python3\npython2', description: 'Python bindings version', name: 'PBVersion'),
booleanParam(defaultValue: false, description: 'Build Android bindings', name: 'AndroidBindings'),
choice(choices: '26\n25\n24\n23\n22\n21\n20\n19\n18\n17\n16\n15\n14', description: 'Android Bindings ABI Version', name: 'ABABIVersion'),
choice(choices: 'Release\nDebug', description: 'Android bindings build type', name: 'ABBuildType'),
choice(choices: 'arm64-v8a\narmeabi-v7a\narmeabi\nx86_64\nx86', description: 'Android bindings platform', name: 'ABPlatform'),
booleanParam(defaultValue: false, description: 'Build docs', name: 'Doxygen'),
booleanParam(defaultValue: true, description: 'Build docs', name: 'Doxygen'),
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')])])


Expand All @@ -34,6 +35,7 @@ pipeline {
IROHA_POSTGRES_USER = "pguser${GIT_COMMIT}"
IROHA_POSTGRES_PASSWORD = "${GIT_COMMIT}"
IROHA_POSTGRES_PORT = 5432
CHANGE_BRANCH_LOCAL = ''
}

options {
Expand All @@ -47,7 +49,13 @@ pipeline {
agent { label 'master' }
steps {
script {
if (GIT_LOCAL_BRANCH != "develop") {
// need this for develop->master PR cases
// CHANGE_BRANCH is not defined if this is a branch build
try {
CHANGE_BRANCH_LOCAL = env.CHANGE_BRANCH
}
catch(MissingPropertyException e) { }
if (GIT_LOCAL_BRANCH != "develop" && CHANGE_BRANCH_LOCAL != "develop") {
def builds = load ".jenkinsci/cancel-builds-same-job.groovy"
builds.cancelSameJobBuilds()
}
Expand Down Expand Up @@ -363,23 +371,32 @@ pipeline {
stage('Build docs') {
when {
beforeAgent true
allOf {
expression { return params.Doxygen }
expression { GIT_LOCAL_BRANCH ==~ /(master|develop)/ }
}
expression { return params.Doxygen }
}
// build docs on any vacant node. Prefer `x86_64` over
// others as nodes are more powerful
agent { label 'x86_64 || arm' }
agent { label 'x86_64' }
steps {
script {
def doxygen = load ".jenkinsci/doxygen.groovy"
docker.image("${env.DOCKER_IMAGE}").inside {
def scmVars = checkout scm
def dPullOrBuild = load ".jenkinsci/docker-pull-or-build.groovy"
def platform = sh(script: 'uname -m', returnStdout: true).trim()
def iC = dPullOrBuild.dockerPullOrUpdate(
"$platform-develop-build",
"${env.GIT_RAW_BASE_URL}/${env.GIT_COMMIT}/docker/develop/Dockerfile",
"${env.GIT_RAW_BASE_URL}/${env.GIT_PREVIOUS_COMMIT}/docker/develop/Dockerfile",
"${env.GIT_RAW_BASE_URL}/develop/docker/develop/Dockerfile",
['PARALLELISM': params.PARALLELISM])
iC.inside() {
doxygen.doDoxygen()
}
}
}
post {
cleanup {
cleanWs()
}
}
}
stage('Build bindings') {
when {
Expand Down Expand Up @@ -410,7 +427,7 @@ pipeline {
['PARALLELISM': params.PARALLELISM])
if (params.JavaBindings) {
iC.inside("-v /tmp/${env.GIT_COMMIT}/bindings-artifact:/tmp/bindings-artifact") {
bindings.doJavaBindings('linux', params.JBBuildType)
bindings.doJavaBindings('linux', params.JBPackageName, params.JBBuildType)
}
}
if (params.PythonBindings) {
Expand Down Expand Up @@ -469,7 +486,7 @@ pipeline {
script {
def bindings = load ".jenkinsci/bindings.groovy"
if (params.JavaBindings) {
bindings.doJavaBindings('windows', params.JBBuildType)
bindings.doJavaBindings('windows', params.JBPackageName, params.JBBuildType)
}
if (params.PythonBindings) {
bindings.doPythonBindings('windows', params.PBBuildType)
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

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

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

## Documentation

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

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

### Are there any example applications?

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

## Need help?

Expand Down
1 change: 0 additions & 1 deletion clean.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
rm schema/*.{cc,h}
rm -rf external
rm -rf build
rm -rf cmake-build-debug
16 changes: 1 addition & 15 deletions cmake/Modules/Finded25519.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,10 @@ find_package_handle_standard_args(ed25519 DEFAULT_MSG
)

set(URL https://github.com/hyperledger/iroha-ed25519)
if (MSVC)
# trunk/1.2 with windows-specific changes
set(VERSION 31bb9b50e01b21ea2c21d33929e20934be4665b4)
else()
set(VERSION e7188b8393dbe5ac54378610d53630bd4a180038)
endif()
set(VERSION f42953c631fae93011612f6b1ee33f1f88c3f8af)
set_target_description(ed25519 "Digital signature algorithm" ${URL} ${VERSION})

if (NOT ed25519_FOUND)
if (NOT WIN32)
find_package(Git REQUIRED)
set(PATCH_RANDOM ${GIT_EXECUTABLE} apply ${PROJECT_SOURCE_DIR})
if (NOT IROHA_ROOT_PROJECT)
set(PATCH_RANDOM ${PATCH_RANDOM}/..)
endif ()
set(PATCH_RANDOM ${PATCH_RANDOM}/patch/close.patch || true)
endif ()

externalproject_add(hyperledger_ed25519
GIT_REPOSITORY ${URL}
GIT_TAG ${VERSION}
Expand Down
Loading

0 comments on commit 38dd0a1

Please sign in to comment.