1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
3 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages hyperledger)
22 #:use-module (ice-9 match)
23 #:use-module (guix build-system cmake)
24 #:use-module (guix build-system go)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix licenses)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages check)
33 #:use-module (gnu packages curl)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages docker)
36 #:use-module (gnu packages golang)
37 #:use-module (gnu packages logging)
38 #:use-module (gnu packages machine-learning)
39 #:use-module (gnu packages popt)
40 #:use-module (gnu packages pretty-print)
41 #:use-module (gnu packages protobuf)
42 #:use-module (gnu packages rpc)
43 #:use-module (gnu packages tbb)
44 #:use-module (gnu packages version-control)
45 #:use-module (gnu packages web))
47 (define-public hyperledger-fabric
49 (name "hyperledger-fabric")
51 ;; While the GitHub repository is supposed to be "just a mirror," the Go
52 ;; imports refer to it explicitly.
53 (home-page "https://github.com/hyperledger/fabric")
58 ;; ‘release-…’ are branches, and move. ‘v…’ are the tags.
59 (commit (string-append "v" version))))
62 "0nmg24ishwddxm1i2vh5ah5ylmmcg0apnjbgv1hljvhl48k4pzxq"))
63 (file-name (git-file-name name version))))
64 (build-system go-build-system)
67 ("docker-cli" ,docker-cli)
71 `(#:import-path "github.com/hyperledger/fabric"
72 #:unpack-path "github.com/hyperledger/fabric"
73 ;; We don't need to install the source code for end-user applications.
75 ;; TODO: Tests require a running Docker daemon.
78 (modify-phases %standard-phases
81 ;; Only linux-amd64 and linux-ppc64le seem to be supported at the moment.
83 "-j" (number->string (parallel-job-count))
84 "-C" "src/github.com/hyperledger/fabric"
85 "release/linux-amd64")))
86 (add-after 'install 'install-commands
87 (lambda* (#:key outputs #:allow-other-keys)
88 (let ((out (assoc-ref outputs "out"))
89 (src "src/github.com/hyperledger/fabric/"))
90 (with-directory-excursion src
92 "release/linux-amd64/bin"
93 (string-append out "/bin"))
94 (install-file "LICENSE"
95 (string-append out "/share/licenses"))
96 (install-file "README.md"
97 (string-append out "/share/doc"))
98 (copy-recursively "sampleconfig"
99 (string-append out "/etc/hyperledger/fabric"))))
101 (supported-systems '("x86_64-linux"))
102 (synopsis "Platform for distributed ledger solutions")
103 (description "Hyperledger Fabric is a platform for distributed ledger
104 solutions, underpinned by a modular architecture focusing on confidentiality
105 and resiliency. It is designed to support pluggable implementations of
106 different components.")
109 (define-public hyperledger-iroha-ed25519
111 (name "hyperledger-iroha-ed25519")
113 (home-page "https://github.com/hyperledger/iroha-ed25519")
119 (file-name (git-file-name name version))
122 "0kr1zwah8mhnpfrpk3h6hdafyqdl3ixhs7czdfscqv6vxqfiabc4"))))
123 (build-system cmake-build-system)
125 `(("googletest" ,googletest)))
127 `(#:tests? #f ; Tests don't build because CMake cannot find GTest main.
128 #:configure-flags '("-DHUNTER_ENABLED=OFF"
130 ;; TODO: x86_64 should use amd64-64-24k-pic but it
131 ;; fails to link when built as a shared library.
133 "-DHASH=sha3_brainhub")))
134 (synopsis "Ed25519 digital signature algorithm")
135 (description "This repository aims to provide modularized implementation
136 of the Ed25519 digital signature algorithm which is is described in
137 RFC8032 (@url{https://tools.ietf.org/html/rfc8032}).
139 Originally Ed25519 consists of three modules:
142 @item digital signature algorithm itself
143 @item SHA512 hash function
144 @item random number generator, to generate key pairs
147 This project offers at least two different C implementations for every
148 module. Every implementation can be replaced with another one at
149 link-time. New implementations can be added as well.")
152 (define-public hyperledger-iroha
154 (name "hyperledger-iroha")
156 (home-page "https://github.com/hyperledger/iroha")
162 (file-name (git-file-name name version))
165 "014mbwq059yxwihw0mq8zgns53fsw8ckczi1lw8q9pz3pk86pa9b"))
166 (modules '((guix build utils)))
169 ;; https://github.com/hyperledger/iroha/commit/4dc710d2e9a067af866771318f673c7392797e48
170 ;; Backport unversioned fmt dependency, remove next update:
171 (substitute* "libs/logger/logger.hpp"
174 (build-system cmake-build-system)
177 '("-DTESTING=OFF" ; The tests fail to link correctly to googletest.
178 ;; Don't install the shared libraries of the dependencies:
179 "-DENABLE_LIBS_PACKAGING=OFF")
181 ;; https://iroha.readthedocs.io/en/latest/build/index.html#running-tests-optional
183 ;; https://github.com/hyperledger/iroha/blob/master/vcpkg/VCPKG_DEPS_LIST
186 ("googletest" ,googletest)
187 ("rapidjson" ,rapidjson)
193 ("grpc" ,grpc-1.16.1)
194 ("hyperledger-iroha-ed25519" ,hyperledger-iroha-ed25519)
195 ("postgresql" ,postgresql)
196 ("protobuf" ,protobuf)
199 (synopsis "Simple, decentralized ledger")
200 (description "Iroha is a distributed ledger technology (DLT). Iroha has
201 essential functionality for your asset, information and identity management
202 needs, at the same time being a crash fault-tolerant tool.
204 Iroha has the following features:
207 @item Creation and management of custom fungible assets, such as currencies,
209 @item Management of user accounts
210 @item Taxonomy of accounts based on domains in the system
211 @item The system of rights and verification of user permissions for the
212 execution of transactions and queries in the system
213 @item Validation of business rules for transactions and queries in the system
214 @item Multisignature transactions