hyperledger.scm 8.4 KB

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