[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#44199] [PATCH 0/1] An origin method for GNUnet FS URI's

From: Maxime Devos
Subject: [bug#44199] [PATCH 0/1] An origin method for GNUnet FS URI's
Date: Sat, 24 Oct 2020 21:47:17 +0200
User-agent: Evolution 3.34.2

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://)
- 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
$ 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
> 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
    (name "hello-gnunet")
    (version "2.10")
    (source (origin
              (method gnunet-fetch)
              (file-name "gnunet-hello-2.10.tar.gz")
    (build-system gnu-build-system)
    (synopsis "Hello, GNUnet world! An example of a package with a
GNUnet chk-URI origin")
     "GNU Hello prints the message \"Hello, world!\" and then
exits.  It
serves as an example of standard GNU coding practices.  As such, it
command-line arguments, multiple languages, and so on.")
    (home-page "";)
    (license gpl3+)))

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

Maxime Devos (1):
  guix: Add (guix gnunet-download).              |   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: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]