hyperledger.scm 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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>
  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. (define-module (gnu packages hyperledger)
  21. #:use-module (ice-9 match)
  22. #:use-module (guix build-system cmake)
  23. #:use-module (guix build-system go)
  24. #:use-module (guix packages)
  25. #:use-module (guix download)
  26. #:use-module (guix git-download)
  27. #:use-module (guix licenses)
  28. #:use-module (gnu packages)
  29. #:use-module (gnu packages base)
  30. #:use-module (gnu packages boost)
  31. #:use-module (gnu packages check)
  32. #:use-module (gnu packages curl)
  33. #:use-module (gnu packages databases)
  34. #:use-module (gnu packages docker)
  35. #:use-module (gnu packages golang)
  36. #:use-module (gnu packages logging)
  37. #:use-module (gnu packages machine-learning)
  38. #:use-module (gnu packages popt)
  39. #:use-module (gnu packages pretty-print)
  40. #:use-module (gnu packages protobuf)
  41. #:use-module (gnu packages rpc)
  42. #:use-module (gnu packages tbb)
  43. #:use-module (gnu packages version-control)
  44. #:use-module (gnu packages web))
  45. (define-public hyperledger-fabric
  46. (package
  47. (name "hyperledger-fabric")
  48. (version "1.4.0")
  49. ;; While the GitHub repository is supposed to be "just a mirror," the Go
  50. ;; imports refer to it explicitly.
  51. (home-page "https://github.com/hyperledger/fabric")
  52. (source (origin
  53. (method git-fetch)
  54. (uri (git-reference
  55. (url home-page)
  56. ;; ‘release-…’ are branches, and move. ‘v…’ are the tags.
  57. (commit (string-append "v" version))))
  58. (sha256
  59. (base32
  60. "0nmg24ishwddxm1i2vh5ah5ylmmcg0apnjbgv1hljvhl48k4pzxq"))
  61. (file-name (git-file-name name version))))
  62. (build-system go-build-system)
  63. (native-inputs
  64. `(("which" ,which)
  65. ("docker-cli" ,docker-cli)
  66. ("git" ,git)
  67. ("curl" ,curl)))
  68. (arguments
  69. `(#:import-path "github.com/hyperledger/fabric"
  70. #:unpack-path "github.com/hyperledger/fabric"
  71. ;; We don't need to install the source code for end-user applications.
  72. #:install-source? #f
  73. ;; TODO: Tests require a running Docker daemon.
  74. #:tests? #f
  75. #:phases
  76. (modify-phases %standard-phases
  77. (replace 'build
  78. (lambda _
  79. ;; Only linux-amd64 and linux-ppc64le seem to be supported at the moment.
  80. (invoke "make"
  81. "-j" (number->string (parallel-job-count))
  82. "-C" "src/github.com/hyperledger/fabric"
  83. "release/linux-amd64")))
  84. (add-after 'install 'install-commands
  85. (lambda* (#:key outputs #:allow-other-keys)
  86. (let ((out (assoc-ref outputs "out"))
  87. (src "src/github.com/hyperledger/fabric/"))
  88. (with-directory-excursion src
  89. (copy-recursively
  90. "release/linux-amd64/bin"
  91. (string-append out "/bin"))
  92. (install-file "LICENSE"
  93. (string-append out "/share/licenses"))
  94. (install-file "README.md"
  95. (string-append out "/share/doc"))
  96. (copy-recursively "sampleconfig"
  97. (string-append out "/etc/hyperledger/fabric"))))
  98. #t)))))
  99. (supported-systems '("x86_64-linux"))
  100. (synopsis "Platform for distributed ledger solutions")
  101. (description "Hyperledger Fabric is a platform for distributed ledger
  102. solutions, underpinned by a modular architecture focusing on confidentiality
  103. and resiliency. It is designed to support pluggable implementations of
  104. different components.")
  105. (license asl2.0)))
  106. (define-public hyperledger-iroha-ed25519
  107. (package
  108. (name "hyperledger-iroha-ed25519")
  109. (version "2.0.2")
  110. (home-page "https://github.com/hyperledger/iroha-ed25519")
  111. (source (origin
  112. (method git-fetch)
  113. (uri (git-reference
  114. (url home-page)
  115. (commit version)))
  116. (file-name (git-file-name name version))
  117. (sha256
  118. (base32
  119. "0kr1zwah8mhnpfrpk3h6hdafyqdl3ixhs7czdfscqv6vxqfiabc4"))))
  120. (build-system cmake-build-system)
  121. (native-inputs
  122. `(("googletest" ,googletest)))
  123. (arguments
  124. `(#:tests? #f ; Tests don't build because CMake cannot find GTest main.
  125. #:configure-flags '("-DHUNTER_ENABLED=OFF"
  126. "-DBUILD=SHARED"
  127. ;; TODO: x86_64 should use amd64-64-24k-pic but it
  128. ;; fails to link when built as a shared library.
  129. "-DEDIMPL=ref10"
  130. "-DHASH=sha3_brainhub")))
  131. (synopsis "Ed25519 digital signature algorithm")
  132. (description "This repository aims to provide modularized implementation
  133. of the Ed25519 digital signature algorithm which is is described in
  134. RFC8032 (@url{https://tools.ietf.org/html/rfc8032}).
  135. Originally Ed25519 consists of three modules:
  136. @itemize
  137. @item digital signature algorithm itself
  138. @item SHA512 hash function
  139. @item random number generator, to generate key pairs
  140. @end itemize
  141. This project offers at least two different C implementations for every
  142. module. Every implementation can be replaced with another one at
  143. link-time. New implementations can be added as well.")
  144. (license asl2.0)))
  145. (define-public hyperledger-iroha
  146. (package
  147. (name "hyperledger-iroha")
  148. (version "1.1.1")
  149. (home-page "https://github.com/hyperledger/iroha")
  150. (source (origin
  151. (method git-fetch)
  152. (uri (git-reference
  153. (url home-page)
  154. (commit version)))
  155. (file-name (git-file-name name version))
  156. (sha256
  157. (base32
  158. "014mbwq059yxwihw0mq8zgns53fsw8ckczi1lw8q9pz3pk86pa9b"))
  159. (modules '((guix build utils)))
  160. (snippet
  161. '(begin
  162. ;; https://github.com/hyperledger/iroha/commit/4dc710d2e9a067af866771318f673c7392797e48
  163. ;; Backport unversioned fmt dependency, remove next update:
  164. (substitute* "libs/logger/logger.hpp"
  165. (("fmt::v5") "fmt"))
  166. #t))))
  167. (build-system cmake-build-system)
  168. (arguments
  169. `(#:configure-flags
  170. '("-DTESTING=OFF" ; The tests fail to link correctly to googletest.
  171. ;; Don't install the shared libraries of the dependencies:
  172. "-DENABLE_LIBS_PACKAGING=OFF")
  173. #:tests? #f
  174. ;; https://iroha.readthedocs.io/en/latest/build/index.html#running-tests-optional
  175. #:test-target "."))
  176. ;; https://github.com/hyperledger/iroha/blob/master/vcpkg/VCPKG_DEPS_LIST
  177. (native-inputs
  178. `(("fmt" ,fmt)
  179. ("googletest" ,googletest)
  180. ("rapidjson" ,rapidjson)
  181. ("rxcpp" ,rxcpp)
  182. ("spdlog" ,spdlog)))
  183. (inputs
  184. `(("boost" ,boost)
  185. ("gflags" ,gflags)
  186. ("grpc" ,grpc-1.16.1)
  187. ("hyperledger-iroha-ed25519" ,hyperledger-iroha-ed25519)
  188. ("postgresql" ,postgresql)
  189. ("protobuf" ,protobuf)
  190. ("soci" ,soci)
  191. ("tbb" ,tbb)))
  192. (synopsis "Simple, decentralized ledger")
  193. (description "Iroha is a distributed ledger technology (DLT). Iroha has
  194. essential functionality for your asset, information and identity management
  195. needs, at the same time being a crash fault-tolerant tool.
  196. Iroha has the following features:
  197. @itemize
  198. @item Creation and management of custom fungible assets, such as currencies,
  199. kilos of gold, etc.
  200. @item Management of user accounts
  201. @item Taxonomy of accounts based on domains in the system
  202. @item The system of rights and verification of user permissions for the
  203. execution of transactions and queries in the system
  204. @item Validation of business rules for transactions and queries in the system
  205. @item Multisignature transactions
  206. @end itemize\n")
  207. (license asl2.0)))