GNU bug report logs -
#52555
[RFC PATCH 0/3] Decentralized substitute distribution with ERIS
Previous Next
Full log
View this message in rfc822 format
---
guix/eris.scm | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/guix/eris.scm b/guix/eris.scm
index 4af17c2807..d56643bec4 100644
--- a/guix/eris.scm
+++ b/guix/eris.scm
@@ -54,15 +54,30 @@ (define* (try-in-order ref #:key block-refs)
(try-in-order ref #:block-refs rest))))
(() #f)))
+(define* (peer->block-ref peer #:key open-connection)
+ (case (uri-scheme peer)
+
+ ((http https)
+ (lambda (ref)
+ (eris-http-block-ref ref
+ #:host peer
+ #:open-connection open-connection)))
+
+ ;; unsupported ERIS peer URL
+ (else (lambda (_) #f))))
+
(define* (guix-eris-block-ref ref #:key open-connection)
(try-in-order
ref
#:block-refs
- (list
+ (cons
+
+ ;; first try and get block from local block store
(lambda (ref)
(eris-fs-store-ref ref
#:store-directory (%eris-block-store-directory)))
- (lambda (ref)
- (eris-http-block-ref ref
- #:host (string->uri "http://localhost:8081")
- #:open-connection open-connection)))))
+
+ ;; then try peers
+ (map (lambda (peer)
+ (peer->block-ref peer #:open-connection open-connection))
+ (%eris-peers)))))
--
2.38.1
This bug report was last modified 1 year and 168 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.