all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#44199] [PATCH 0/1] An origin method for GNUnet FS URI's
@ 2020-10-24 19:47 Maxime Devos
  2020-10-24 19:54 ` [bug#44199] [PATCH 1/1] guix: Add (guix gnunet-download) Maxime Devos
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Maxime Devos @ 2020-10-24 19:47 UTC (permalink / raw)
  To: 44199

[-- Attachment #1: Type: text/plain, Size: 3727 bytes --]

This patch defines a `gnunet-fetch' method, allowing for downloading
files from GNUnet by their GNUnet chk-URI.

This patch does not provide:
- a service configuration
- downloading substitutes from GNUnet
- fall-back to non-P2P (e.g. http://) or other P2P (e.g. ipfs://)
  systems
- downloading directories over GNUnet
- actual packages definitions using this method

Some issues and questions:
- (guix build gnunet) would call call-with-temporary-output-file
  from (guix utils), which isn't available when building derivations,
  so it has been copied to (guix build gnunet).  Is there any
  particular reason for call-with-temporary-output-file to be in
  (guix utils) and not (guix build utils)?
- Would it be possible somehow for url-fetch to support gnunet://fs/chk
  URIs? That way we could fall-back unto non-P2P URLs, which would be
  useful to bootstrap a P2P distribution from a non-P2P system.
- No timeouts have been implemented, so gnunet-download may spin
  forever if a source isn't available on GNUnet FS.

Some problematic points:
- (guix gnunet-download) calls gnunet-config from $PATH,
  to figure out connection details for (guix build gnunet)
- (guix build gnunet) requires the GNUnet FS daemon to bind
  to loopback, whereas a standard GNUnet setup would have
  the daemon bound to a Unix socket.

Example usage:

First make the GNUnet FS daemon accessible to Guix:
$ guix install gnunet
$ gnunet-config -s fs -o port -V 2094
$ gnunet-arm -s

Then publish the source tarball of the package to the GNUnet FS system:
$ guix environment --ad-hoc wget -- wget 
https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
$ gnunet-publish hello-2.10.tar.gz

The output should look like this:

> Publishing `$PWD/hello-2.10.tar.gz' done.
> URI is
> `gnunet://fs/chk/TY48PGS5RVX643NT2B7GDNFCBT4DWG692PF4YNHERR96K6MSFRZ4
> ZWRPQ4KVKZV29MGRZTWAMY9ETTST4B6VFM47JR2JS5PWBTPVXB0.8A9HRYABJ7HDA7B0P
> 37VG6D593>

The following test package can now be compiled:

$ cat > example.scm <<EOF
(define-module (example)
  #:use-module ((guix licenses)
                #:select (gpl3+))
  #:use-module (gnu packages)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (guix gnunet-download)
  #:use-module (guix build-system gnu)
  #:export (hello/gnunet))

(define-public hello/gnunet
  (package
    (name "hello-gnunet")
    (version "2.10")
    (source (origin
              (method gnunet-fetch)
              (uri
"gnunet://fs/chk/TY48PGS5RVX643NT2B7GDNFCBT4DWG692PF4YNHERR96K6MSFRZ4ZW
RPQ4KVKZV29MGRZTWAMY9ETTST4B6VFM47JR2JS5PWBTPVXB0.8A9HRYABJ7HDA7B0>
              (file-name "gnunet-hello-2.10.tar.gz")
              (sha256
               (base32
                "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i")
)))
    (build-system gnu-build-system)
    (synopsis "Hello, GNUnet world! An example of a package with a
GNUnet chk-URI origin")
    (description
     "GNU Hello prints the message \"Hello, world!\" and then
exits.  It
serves as an example of standard GNU coding practices.  As such, it
supports
command-line arguments, multiple languages, and so on.")
    (home-page "https://www.gnu.org/software/hello/")
    (license gpl3+)))
hello/gnunet
EOF

$ ./pre-inst-env guix build -f example.scm

Maxime Devos (1):
  guix: Add (guix gnunet-download).

 Makefile.am              |   2 +
 doc/guix.texi            |   7 +++
 guix/build/gnunet.scm    | 113 +++++++++++++++++++++++++++++++++++++++
 guix/gnunet-download.scm |  89 ++++++++++++++++++++++++++++++
 4 files changed, 211 insertions(+)
 create mode 100644 guix/build/gnunet.scm
 create mode 100644 guix/gnunet-download.scm




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-01-27 13:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-24 19:47 [bug#44199] [PATCH 0/1] An origin method for GNUnet FS URI's Maxime Devos
2020-10-24 19:54 ` [bug#44199] [PATCH 1/1] guix: Add (guix gnunet-download) Maxime Devos
2020-10-27 13:39 ` [bug#44199] [PATCH 0/1] An origin method for GNUnet FS URI's zimoun
2020-10-27 18:50   ` Maxime Devos
2020-11-16  0:35     ` zimoun
2020-11-18 20:28       ` Maxime Devos
2020-11-18 22:40         ` zimoun
2020-11-01  0:05   ` Maxime Devos
2020-11-15 21:13 ` Ludovic Courtès
2020-11-18 19:14   ` Maxime Devos
2020-11-18 22:42     ` zimoun
2021-01-27 13:07 ` [bug#44199] Info: Rehash Project Maxime Devos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.