Add diag calls.

This commit is contained in:
Jaidyn Levesque 2019-06-06 23:07:49 -05:00
parent 4e947ecb6e
commit cf43d4006d
2 changed files with 37 additions and 2 deletions

View File

@ -414,13 +414,13 @@
(ipfs-call "dht/get" `(("arg" ,key))) (ipfs-call "dht/get" `(("arg" ,key)))
(gethash "Addrs" (car (gethash "Responses"result))))) (gethash "Addrs" (car (gethash "Responses"result)))))
;; STRING [:BOOLEAN] → NIL || (NIL STRING) ;; STRING [:BOOLEAN] → NIL
(defun dht-provide (key &key (recursive nil)) (defun dht-provide (key &key (recursive nil))
"Announce to the network that you're providing the given values. "Announce to the network that you're providing the given values.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-provide" /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-provide"
(ipfs-call "dht/provide" `(("arg" ,key)("recursive" ,recursive)))) (ipfs-call "dht/provide" `(("arg" ,key)("recursive" ,recursive))))
;; STRING STRING → NIL || (NIL STRING) ;; STRING STRING → NIL
(defun dht-put (key value) (defun dht-put (key value)
"Write a key-value pair to the routing system. "Write a key-value pair to the routing system.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-put" /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-put"
@ -436,6 +436,35 @@
;; —————————————————————————————————————
;; DIAG CALLS
;; NIL → ALIST || (NIL STRING)
(defun diag-cmds ()
"List commands run on this IPFS node.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-cmds"
(mapcar #'re-hash-table-alist (ipfs-call "diag/cmds" '())))
;; NIL → STRING
(defun diag-cmds-clear ()
"Clear inactive requests from the log.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-cmds-clear"
(ipfs-call "diag/cmds/clear" '()))
;; NUMBER → STRING
(defun diag-cmds-set-time (time)
"Set how long to keep inactive requests in the log.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-cmds-set-time"
(ipfs-call "diag/cmds/set-time" `(("arg" ,time))))
;; NIL → STRING
(defun diag-sys ()
"Print system diagnostic info.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-sys"
(ipfs-call "diag/sys" '()))
;; ————————————————————————————————————— ;; —————————————————————————————————————
;; VERSION CALLS ;; VERSION CALLS

View File

@ -56,6 +56,12 @@
:dht-put :dht-put
:dht-query :dht-query
;; diag calls
:diag-cmds
:diag-cmds-clear
:diag-cmds-set-time
:diag-sys
;; version calls ;; version calls
:version :version
:version-deps)) :version-deps))