gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / hyperledger.scm
CommitLineData
98355069 1;;; GNU Guix --- Functional package management for GNU
37109658 2;;; Copyright © 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz>
cf311790 3;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
04ff192e 4;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
98355069
PN
5;;;
6;;; This file is part of GNU Guix.
7;;;
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.
12;;;
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.
17;;;
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/>.
20
21(define-module (gnu packages hyperledger)
22 #:use-module (ice-9 match)
04ff192e 23 #:use-module (guix build-system cmake)
98355069 24 #:use-module (guix build-system go)
98355069
PN
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)
04ff192e
PN
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages check)
98355069 33 #:use-module (gnu packages curl)
04ff192e 34 #:use-module (gnu packages databases)
98355069
PN
35 #:use-module (gnu packages docker)
36 #:use-module (gnu packages golang)
04ff192e
PN
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)
c61557b1 42 #:use-module (gnu packages rpc)
04ff192e
PN
43 #:use-module (gnu packages tbb)
44 #:use-module (gnu packages version-control)
45 #:use-module (gnu packages web))
98355069
PN
46
47(define-public hyperledger-fabric
48 (package
49 (name "hyperledger-fabric")
cf311790 50 (version "1.4.0")
98355069
PN
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")
54 (source (origin
55 (method git-fetch)
56 (uri (git-reference
57 (url home-page)
cf311790
TGR
58 ;; ‘release-…’ are branches, and move. ‘v…’ are the tags.
59 (commit (string-append "v" version))))
98355069
PN
60 (sha256
61 (base32
cf311790 62 "0nmg24ishwddxm1i2vh5ah5ylmmcg0apnjbgv1hljvhl48k4pzxq"))
98355069
PN
63 (file-name (git-file-name name version))))
64 (build-system go-build-system)
65 (native-inputs
66 `(("which" ,which)
67 ("docker-cli" ,docker-cli)
68 ("git" ,git)
69 ("curl" ,curl)))
70 (arguments
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.
74 #:install-source? #f
75 ;; TODO: Tests require a running Docker daemon.
76 #:tests? #f
77 #:phases
78 (modify-phases %standard-phases
79 (replace 'build
80 (lambda _
81 ;; Only linux-amd64 and linux-ppc64le seem to be supported at the moment.
2b613a1a
PN
82 (invoke "make"
83 "-j" (number->string (parallel-job-count))
84 "-C" "src/github.com/hyperledger/fabric"
98355069
PN
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
91 (copy-recursively
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"))))
100 #t)))))
2b613a1a 101 (supported-systems '("x86_64-linux"))
98355069 102 (synopsis "Platform for distributed ledger solutions")
2b613a1a
PN
103 (description "Hyperledger Fabric is a platform for distributed ledger
104solutions, underpinned by a modular architecture focusing on confidentiality
105and resiliency. It is designed to support pluggable implementations of
106different components.")
98355069 107 (license asl2.0)))
37109658
PN
108
109(define-public hyperledger-iroha-ed25519
110 (package
111 (name "hyperledger-iroha-ed25519")
112 (version "2.0.2")
113 (home-page "https://github.com/hyperledger/iroha-ed25519")
114 (source (origin
115 (method git-fetch)
116 (uri (git-reference
117 (url home-page)
118 (commit version)))
119 (file-name (git-file-name name version))
120 (sha256
121 (base32
122 "0kr1zwah8mhnpfrpk3h6hdafyqdl3ixhs7czdfscqv6vxqfiabc4"))))
123 (build-system cmake-build-system)
124 (native-inputs
125 `(("googletest" ,googletest)))
126 (arguments
127 `(#:tests? #f ; Tests don't build because CMake cannot find GTest main.
128 #:configure-flags '("-DHUNTER_ENABLED=OFF"
129 "-DBUILD=SHARED"
130 ;; TODO: x86_64 should use amd64-64-24k-pic but it
131 ;; fails to link when built as a shared library.
132 "-DEDIMPL=ref10"
133 "-DHASH=sha3_brainhub")))
134 (synopsis "Ed25519 digital signature algorithm")
135 (description "This repository aims to provide modularized implementation
136of the Ed25519 digital signature algorithm which is is described in
137RFC8032 (@url{https://tools.ietf.org/html/rfc8032}).
138
139Originally Ed25519 consists of three modules:
140
141@itemize
142@item digital signature algorithm itself
143@item SHA512 hash function
7230f6d5 144@item random number generator, to generate key pairs
37109658
PN
145@end itemize
146
147This project offers at least two different C implementations for every
148module. Every implementation can be replaced with another one at
149link-time. New implementations can be added as well.")
150 (license asl2.0)))
04ff192e
PN
151
152(define-public hyperledger-iroha
153 (package
154 (name "hyperledger-iroha")
155 (version "1.1.1")
156 (home-page "https://github.com/hyperledger/iroha")
157 (source (origin
158 (method git-fetch)
159 (uri (git-reference
160 (url home-page)
161 (commit version)))
162 (file-name (git-file-name name version))
163 (sha256
164 (base32
165 "014mbwq059yxwihw0mq8zgns53fsw8ckczi1lw8q9pz3pk86pa9b"))
166 (modules '((guix build utils)))
167 (snippet
168 '(begin
169 ;; https://github.com/hyperledger/iroha/commit/4dc710d2e9a067af866771318f673c7392797e48
170 ;; Backport unversioned fmt dependency, remove next update:
171 (substitute* "libs/logger/logger.hpp"
172 (("fmt::v5") "fmt"))
173 #t))))
174 (build-system cmake-build-system)
175 (arguments
176 `(#:configure-flags
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")
180 #:tests? #f
181 ;; https://iroha.readthedocs.io/en/latest/build/index.html#running-tests-optional
182 #:test-target "."))
183 ;; https://github.com/hyperledger/iroha/blob/master/vcpkg/VCPKG_DEPS_LIST
184 (native-inputs
185 `(("fmt" ,fmt)
186 ("googletest" ,googletest)
187 ("rapidjson" ,rapidjson)
188 ("rxcpp" ,rxcpp)
189 ("spdlog" ,spdlog)))
190 (inputs
45c137e3 191 `(("boost" ,boost)
04ff192e 192 ("gflags" ,gflags)
447fafe3 193 ("grpc" ,grpc-1.16.1)
04ff192e
PN
194 ("hyperledger-iroha-ed25519" ,hyperledger-iroha-ed25519)
195 ("postgresql" ,postgresql)
196 ("protobuf" ,protobuf)
197 ("soci" ,soci)
198 ("tbb" ,tbb)))
199 (synopsis "Simple, decentralized ledger")
200 (description "Iroha is a distributed ledger technology (DLT). Iroha has
201essential functionality for your asset, information and identity management
202needs, at the same time being a crash fault-tolerant tool.
203
204Iroha has the following features:
205
206@itemize
207@item Creation and management of custom fungible assets, such as currencies,
208kilos of gold, etc.
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
212execution of transactions and queries in the system
213@item Validation of business rules for transactions and queries in the system
214@item Multisignature transactions
215@end itemize\n")
216 (license asl2.0)))