From: Maxime Devos <maxime.devos@student.kuleuven.be>
To: 44199@debbugs.gnu.org
Subject: [bug#44199] [PATCH 0/1] An origin method for GNUnet FS URI's
Date: Sat, 24 Oct 2020 21:47:17 +0200 [thread overview]
Message-ID: <5c72bcb9c86934deda97d952eb5cd459e615b313.camel@student.kuleuven.be> (raw)
[-- 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 --]
next reply other threads:[~2020-10-24 20:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-24 19:47 Maxime Devos [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c72bcb9c86934deda97d952eb5cd459e615b313.camel@student.kuleuven.be \
--to=maxime.devos@student.kuleuven.be \
--cc=44199@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).