DHT-FINDPROVS fails (several issues...) #2

Open
opened 2020-12-22 16:51:23 -06:00 by stacksmith · 8 comments
stacksmith commented 2020-12-22 16:51:23 -06:00 (Migrated from github.com)
(dht-findprovs "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG" )
The value
  NIL
is not of type
  HASH-TABLE
when binding HASH-TABLE
   [Condition of type TYPE-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {10030E0B73}>)

Backtrace:
  0: (SB-IMPL::GETHASH3 "Addrs" NIL NIL) [external]
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (DHT-FINDPROVS "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG") #<NULL-LEXENV>)
  2: (EVAL (DHT-FINDPROVS "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG"))
 --more--

There are several problems, aside from the obvious one of DHT-FINDPROVS not working. Let's start by issuing the undrlying API call more directly:

(ipfs-call "dht/findprovs" '(("arg" "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG") ("num-providers" "20")))
#<HASH-TABLE :TEST EQUAL :COUNT 4 {1004101803}>
IPFS> 

The returned hashtable consists of:

--------------------
Count: 4
Size: 7
Test: EQUAL
Rehash size: 1.5
Rehash threshold: 1.0
[clear hashtable]
Contents: 
"Extra" = "" [remove entry]
"ID" = "Qma4h23DHjqY456dJwCn3utMQhSavERztgcVnhrjZS5znR" [remove entry]
"Responses" = NIL [remove entry]
"Type" = 7 [remove entry] 
  1. DHT-FINDPROVS tries to extract key Addrs, which does not exist. Perhaps "ID" is more appropriate...
  2. Only one ID is returned, even though num-providers is 20 (I tried both as a string "20" and number 20). The CLI command returns a whole bunch of these...

What happened here?

``` (dht-findprovs "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG" ) The value NIL is not of type HASH-TABLE when binding HASH-TABLE [Condition of type TYPE-ERROR] Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [*ABORT] Return to SLIME's top level. 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {10030E0B73}>) Backtrace: 0: (SB-IMPL::GETHASH3 "Addrs" NIL NIL) [external] 1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (DHT-FINDPROVS "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG") #<NULL-LEXENV>) 2: (EVAL (DHT-FINDPROVS "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG")) --more-- ``` There are several problems, aside from the obvious one of `DHT-FINDPROVS` not working. Let's start by issuing the undrlying API call more directly: ``` (ipfs-call "dht/findprovs" '(("arg" "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG") ("num-providers" "20"))) #<HASH-TABLE :TEST EQUAL :COUNT 4 {1004101803}> IPFS> ``` The returned hashtable consists of: ``` -------------------- Count: 4 Size: 7 Test: EQUAL Rehash size: 1.5 Rehash threshold: 1.0 [clear hashtable] Contents: "Extra" = "" [remove entry] "ID" = "Qma4h23DHjqY456dJwCn3utMQhSavERztgcVnhrjZS5znR" [remove entry] "Responses" = NIL [remove entry] "Type" = 7 [remove entry] ``` 1. DHT-FINDPROVS tries to extract key `Addrs`, which does not exist. Perhaps "ID" is more appropriate... 2. Only one ID is returned, even though `num-providers` is 20 (I tried both as a string "20" and number 20). The CLI command returns a whole bunch of these... What happened here?
stacksmith commented 2020-12-22 17:49:09 -06:00 (Migrated from github.com)

On a hunch I stuck in a (format t "~A" (flexi-streams:octets-to-string result)) to output the result of the api call, and it returns a shitload of stuff...

{"Extra":"","ID":"12D3KooWJUQ2Xk9TUqWKNPBDSr6Cfj5XVTKB2ZzQHZmANmuARotU","Responses":null,"Type":7}
{"Extra":"","ID":"QmcbTjrtTQj94uKxQkHmKq9nGfXnaQar36QwKbJDa9pMLg","Responses":null,"Type":7}
{"Extra":"","ID":"QmaY8pZtpSUugRwjDmnEngENPQMq9ipCXZw432kR4Ugxgn","Responses":null,"Type":7}
{"Extra":"","ID":"QmSb8vSark1ZhHv7m5TDgQFcVHYoZtebpACWBPk14BUFiD","Responses":null,"Type":7}
{"Extra":"","ID":"QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv","Responses":null,"Type":0}
{"Extra":"","ID":"QmQg3un1fwoQXYR221wQS2S5NFVVgARgjB4JrFmYNpeQTA","Responses":null,"Type":7}
{"Extra":"","ID":"Qmcrv6s2ThaJfNafs1E2w89SYLJnM3X5YJa5HJHX43qap7","Responses":null,"Type":7}
{"Extra":"","ID":"12D3KooWCXYFMWFLWBRWzULXpUB6QRP5ytGZhxrCkVx4p3r3C6Kd","Responses":null,"Type":7}
{"Extra":"","ID":"QmVFEyseBFB3jv9CJL8YWRN3PhduwGsFVPqiH1eDdoZmEU","Responses":null,"Type":7}
{"Extra":"","ID":"QmPEambM2Hfq53oTUgub842koJC5LQxALJvTV4pMLUhLDZ","Responses":null,"Type":7}
{"Extra":"","ID":"QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv","Responses":[{"Addrs":["/ip4/54.158.134.9/tcp/4001","/ip4/54.158.134.9/udp/4001/quic","/ip4/172.31.17.20/tcp/4001","/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip4/172.31.17.20/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/54.158.134.9/udp/4001/quic","/ip4/54.158.134.9/tcp/4001","/ip4/172.31.17.20/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/172.31.17.20/tcp/4001"],"ID":"12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3"},{"Addrs":["/ip4/207.189.196.12/tcp/51942","/ip4/127.0.0.1/tcp/51942","/ip4/207.189.196.12/tcp/51942","/ip4/127.0.0.1/tcp/51942"],"ID":"QmVJir9HuBWVzWQQvXfLndwQY62YrytVdxdvrXghWDexLY"},{"Addrs":["/ip4/138.68.224.240/udp/14316/quic","/ip4/138.68.224.240/tcp/30052","/ip4/10.244.11.61/tcp/30052","/ip4/127.0.0.1/tcp/30052","/ip4/10.244.11.61/udp/30052/quic","/ip4/127.0.0.1/udp/30052/quic","/ip4/138.68.224.240/udp/30052/quic","/ip4/138.68.224.240/udp/30052/quic","/ip4/138.68.224.240/udp/14316/quic","/ip4/138.68.224.240/tcp/30052","/ip4/10.244.11.61/tcp/30052","/ip4/127.0.0.1/tcp/30052","/ip4/10.244.11.61/udp/30052/quic","/ip4/127.0.0.1/udp/30052/quic"],"ID":"12D3KooWL4GSzPWh3gCaMYAEqKDRzR7485XMhPJnkqdVvPauxuBh"},{"Addrs":["/ip4/139.59.118.153/tcp/4001","/ip4/10.15.0.6/tcp/4001","/ip4/10.130.30.8/tcp/4001","/ip6/2400:6180:0:d0::4a6b:4001/tcp/4001","/ip4/139.59.118.153/tcp/4001","/ip4/10.15.0.6/tcp/4001","/ip4/10.130.30.8/tcp/4001","/ip6/2400:6180:0:d0::4a6b:4001/tcp/4001"],"ID":"QmewAL3LSmm6LutHZQzCyyHnPhzD6D8HaEnoTRhhsgZmwT"},{"Addrs":["/ip4/10.244.12.86/tcp/32268","/ip4/10.244.12.86/udp/32268/quic","/ip4/206.189.69.105/udp/32268/quic","/ip4/206.189.69.105/udp/22666/quic","/ip4/206.189.69.105/tcp/32268","/ip4/127.0.0.1/tcp/32268","/ip4/127.0.0.1/udp/32268/quic","/ip4/206.189.69.105/tcp/32268","/ip4/127.0.0.1/tcp/32268","/ip4/127.0.0.1/udp/32268/quic","/ip4/10.244.12.86/tcp/32268","/ip4/10.244.12.86/udp/32268/quic","/ip4/206.189.69.105/udp/32268/quic","/ip4/206.189.69.105/udp/22666/quic"],"ID":"12D3KooWL9FFNHCTJXYTJp12cpzK1D56TV3ytMk9eiGYoHTTK7g2"},{"Addrs":["/ip6/::1/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/192.168.0.18/tcp/4001","/ip4/180.115.231.110/tcp/1737","/ip6/::1/tcp/4001","/ip4/180.115.231.110/tcp/1737","/ip4/127.0.0.1/tcp/4001","/ip4/192.168.0.18/tcp/4001"],"ID":"QmWyXvLQ3GjR14korCbCDkWNrDxmSDww7zwy666mFa4WEL"},{"Addrs":["/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/51.15.44.84/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/51.15.44.84/tcp/4001"],"ID":"QmWgTDkh3FyWGQvkoRHYCC9cXpVapZdJushiXL29uDhKpj"},{"Addrs":["/ip4/87.250.9.250/tcp/40061","/ip4/127.0.0.1/tcp/40061","/ip4/87.250.9.250/tcp/40061","/ip4/127.0.0.1/tcp/40061"],"ID":"QmXEpNkoKsgCiUgahE2xK1LLc2sWHadHwQYKM8heBGgCM9"},{"Addrs":["/ip4/172.16.0.6/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/106.53.65.50/tcp/4001","/ip6/::1/tcp/4001","/ip4/172.16.0.6/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/106.53.65.50/tcp/4001"],"ID":"QmXLNGDen5zujDdtCJknN8fU7FUt4JKeK6ZvMz4bDkBPGr"},{"Addrs":["/ip4/192.168.10.104/tcp/42871","/ip4/76.190.151.191/tcp/42871","/ip4/127.0.0.1/tcp/42871","/ip4/127.0.0.1/tcp/42871","/ip4/192.168.10.104/tcp/42871","/ip4/76.190.151.191/tcp/42871"],"ID":"QmewxQ7GAaBnarMRH1zd6qF5r7gx3C6UNG1cUZjySUbRbW"},{"Addrs":["/ip4/61.85.31.188/tcp/53511","/ip4/127.0.0.1/tcp/53511","/ip4/61.85.31.188/tcp/53511","/ip4/127.0.0.1/tcp/53511"],"ID":"QmUghLop23aVBcv5aRNeVnbeYhNShQexdJcQ8CspVEd6yw"},{"Addrs":["/ip4/192.168.0.131/tcp/42835","/ip4/127.0.0.1/tcp/42835","/ip4/45.74.242.206/tcp/54524","/ip4/192.168.0.131/tcp/42835","/ip4/127.0.0.1/tcp/42835","/ip4/45.74.242.206/tcp/54524"],"ID":"QmPAQdK7kcKWeGUxPuLMgB84dWVhNbodeGGgCrQZpLy6XY"},{"Addrs":["/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip4/212.227.249.191/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip4/212.227.249.191/tcp/4001","/ip4/212.227.249.191/tcp/4001","/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip4/212.227.249.191/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/127.0.0.1/tcp/4001"],"ID":"QmcZrBqWBYV3RGsPuhQX11QzpKAQ8SYfMYL1dGXuPmaDYF"},{"Addrs":["/ip4/104.211.23.151/tcp/4001","/ip4/104.211.23.151/tcp/4001"],"ID":"12D3KooWHP7rcNmWrCv4fLETUUgm8TyJi3MVPu524oFesQFXD3xQ"},{"Addrs":["/ip4/172.31.57.88/tcp/42937","/ip4/172.31.57.88/udp/43710/quic","/ip4/127.0.0.1/tcp/42937","/ip4/127.0.0.1/udp/43710/quic","/ip4/3.84.222.217/udp/43710/quic","/ip4/3.84.222.217/tcp/42937","/ip4/3.84.222.217/tcp/42937","/ip4/172.31.57.88/tcp/42937","/ip4/172.31.57.88/udp/43710/quic","/ip4/127.0.0.1/tcp/42937","/ip4/127.0.0.1/udp/43710/quic","/ip4/3.84.222.217/udp/43710/quic"],"ID":"12D3KooWLypZpJgixtBrREJ84HbUnYd9D4jQdBeowZQFy8W9x3F8"},{"Addrs":["/ip4/96.28.60.159/tcp/44977","/ip4/127.0.0.1/tcp/44977","/ip4/127.0.0.1/tcp/44977","/ip4/96.28.60.159/tcp/44977"],"ID":"QmYkCBsfLosjzsBUtx6KDgSLJN6kd3JPa5bazYEatftPgK"},{"Addrs":["/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/192.168.2.51/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/98.128.230.155/udp/4001/quic","/ip4/98.128.230.155/tcp/4001","/ip4/192.168.2.51/tcp/4001","/ip4/98.128.230.155/udp/4001/quic","/ip4/192.168.2.51/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/192.168.2.51/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/98.128.230.155/tcp/4001"],"ID":"12D3KooWA44eezTF4qjiKJ14KVKEgu7WN4ypZC5VLfRfvmUdDtdK"},{"Addrs":["/ip4/127.0.0.1/tcp/4001","/ip4/172.31.0.2/tcp/4001","/ip4/223.200.155.59/tcp/64417","/ip4/127.0.0.1/tcp/4001","/ip4/172.31.0.2/tcp/4001","/ip4/223.200.155.59/tcp/64417"],"ID":"QmUx1i6hiQDVTLqysbHfFRi1ig5X28MQzFP4p8wsCXeWU6"},{"Addrs":["/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/172.31.19.245/tcp/4001","/ip4/172.31.19.245/udp/4001/quic","/ip4/18.218.250.68/tcp/4001","/ip4/18.218.250.68/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip4/172.31.19.245/udp/4001/quic","/ip4/18.218.250.68/tcp/4001","/ip4/18.218.250.68/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/172.31.19.245/tcp/4001"],"ID":"QmZeXmfSsz6CHCPHjfLAdmKHuzV1oiPYgLKgTLpfpJ4nhm"},{"Addrs":["/ip4/34.74.155.182/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/34.74.155.182/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001"],"ID":"QmRAPZYEGyZxuWzN19MDNYXt6XmGr6B5vwcqCuYArCZBJZ"}],"Type":1}
{"Extra":"","ID":"12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3","Responses":null,"Type":0}
{"Extra":"","ID":"","Responses":[{"Addrs":["/ip4/45.113.32.180/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/192.168.1.7/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip4/103.40.249.242/tcp/4001","/ip4/103.40.249.242/tcp/20111","/ip6/::1/udp/4001/quic","/ip4/45.113.32.180/tcp/52610","/ip4/192.168.1.7/tcp/4001","/ip4/45.113.32.180/udp/1447/quic","/ip6/::1/tcp/4001","/ip4/45.113.32.180/udp/4001/quic","/ip4/103.40.249.242/udp/4001/quic"],"ID":"12D3KooWDd2WUiFK29Y3byUPAwQmMYC9QDp1e3UmnmAwwTEGvKfk"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWA5HzYN4VcNkvPxT31qJWx92MF5Qzb1a9AsTetinuNKzs"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWADaUtfpf7hahJooJoxB9fNgMcb7kXRUWkvFmPT1kxb5Q"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":["/ip4/194.156.99.251/tcp/4001","/ip4/194.156.99.251/tcp/54346"],"ID":"12D3KooWB5nAjGFhwJqtBuwLSNfEhFBvZrURdxtib7aHdhHZFwCm"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWBdW6dYGB7i34UvipVtgnToEFQH9dr2B91usfBA4AQxTK"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWCQx1kaJpQHMnYWd2isntkn4uej1YSNpNjgShGwFEeyJi"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWHjDiPvWWUNxLZWz3hzbodth4c5GZ45AkWYbWXNDdRbrg"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWExM3AvSYUxgSyHVRvfxHPCaM5PgYNCLZBMc54eWQzMJ3"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWF7GeAYDjUpPXKJCPo6GrNeTAYxcPx54vfLddbLyPQ2qm"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWFGJeNYZ2EPFGk6YCTL2y8oqWXsPxqb5hB1jeMBuNP5Rg"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWG152XtuC4VrbNFKoxheuWQB2wGQ7ETrubMn8ytGBZFqK"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWGM2bMa6p3up2y5xuESZiA4srXUUjdYdcTmTtnTjLyyzY"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWGbhUKsu5aEBrkGsbW4zTQ8YRGKUBLupSsBwE1G2kAsYC"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWGyVABBGz4dapgMJmK5vTX9iTznCtbYGc6aaRooZX1oD8"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":["/ip4/132.145.76.242/tcp/4001","/ip4/10.0.0.2/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/10.0.0.2/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/132.145.76.242/udp/4001/quic"],"ID":"12D3KooWHH2iDTb6MxDrtUGdFMuikVeyobaZPoARB2d9HJ9iMo2V"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWHKn6fHgCbMtQYw2ZVYe5agXp1vutUhajHuwgegZW9gvG"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWN2MMNdanfQ9gFgv4YEVGxWCs2h4VcmaJmxWJgPf3sM7Y"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":["/ip6/::1/udp/4001/quic","/ip6/::1/tcp/4001","/ip4/51.75.127.200/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/51.75.127.200/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic"],"ID":"12D3KooWK4JdWzsKR5THsrgyoVGgG2gBRLFww2pkjVQ5zSC3K12R"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWKFKByZhyxtdD9Am13KfsLyEcugfrCcGwnQzCJQZTcJM1"}],"Type":4}
{"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWSRsuHTHXg5t4J1kVaTb6T1a5XmEjsNqbiezGbGK8uDD5"}],"Type":4}

YASON:PARSE only parses the first JSON expression...

Gah.

On a hunch I stuck in a `(format t "~A" (flexi-streams:octets-to-string result))` to output the result of the api call, and it returns a shitload of stuff... ``` {"Extra":"","ID":"12D3KooWJUQ2Xk9TUqWKNPBDSr6Cfj5XVTKB2ZzQHZmANmuARotU","Responses":null,"Type":7} {"Extra":"","ID":"QmcbTjrtTQj94uKxQkHmKq9nGfXnaQar36QwKbJDa9pMLg","Responses":null,"Type":7} {"Extra":"","ID":"QmaY8pZtpSUugRwjDmnEngENPQMq9ipCXZw432kR4Ugxgn","Responses":null,"Type":7} {"Extra":"","ID":"QmSb8vSark1ZhHv7m5TDgQFcVHYoZtebpACWBPk14BUFiD","Responses":null,"Type":7} {"Extra":"","ID":"QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv","Responses":null,"Type":0} {"Extra":"","ID":"QmQg3un1fwoQXYR221wQS2S5NFVVgARgjB4JrFmYNpeQTA","Responses":null,"Type":7} {"Extra":"","ID":"Qmcrv6s2ThaJfNafs1E2w89SYLJnM3X5YJa5HJHX43qap7","Responses":null,"Type":7} {"Extra":"","ID":"12D3KooWCXYFMWFLWBRWzULXpUB6QRP5ytGZhxrCkVx4p3r3C6Kd","Responses":null,"Type":7} {"Extra":"","ID":"QmVFEyseBFB3jv9CJL8YWRN3PhduwGsFVPqiH1eDdoZmEU","Responses":null,"Type":7} {"Extra":"","ID":"QmPEambM2Hfq53oTUgub842koJC5LQxALJvTV4pMLUhLDZ","Responses":null,"Type":7} {"Extra":"","ID":"QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv","Responses":[{"Addrs":["/ip4/54.158.134.9/tcp/4001","/ip4/54.158.134.9/udp/4001/quic","/ip4/172.31.17.20/tcp/4001","/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip4/172.31.17.20/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/54.158.134.9/udp/4001/quic","/ip4/54.158.134.9/tcp/4001","/ip4/172.31.17.20/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/172.31.17.20/tcp/4001"],"ID":"12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3"},{"Addrs":["/ip4/207.189.196.12/tcp/51942","/ip4/127.0.0.1/tcp/51942","/ip4/207.189.196.12/tcp/51942","/ip4/127.0.0.1/tcp/51942"],"ID":"QmVJir9HuBWVzWQQvXfLndwQY62YrytVdxdvrXghWDexLY"},{"Addrs":["/ip4/138.68.224.240/udp/14316/quic","/ip4/138.68.224.240/tcp/30052","/ip4/10.244.11.61/tcp/30052","/ip4/127.0.0.1/tcp/30052","/ip4/10.244.11.61/udp/30052/quic","/ip4/127.0.0.1/udp/30052/quic","/ip4/138.68.224.240/udp/30052/quic","/ip4/138.68.224.240/udp/30052/quic","/ip4/138.68.224.240/udp/14316/quic","/ip4/138.68.224.240/tcp/30052","/ip4/10.244.11.61/tcp/30052","/ip4/127.0.0.1/tcp/30052","/ip4/10.244.11.61/udp/30052/quic","/ip4/127.0.0.1/udp/30052/quic"],"ID":"12D3KooWL4GSzPWh3gCaMYAEqKDRzR7485XMhPJnkqdVvPauxuBh"},{"Addrs":["/ip4/139.59.118.153/tcp/4001","/ip4/10.15.0.6/tcp/4001","/ip4/10.130.30.8/tcp/4001","/ip6/2400:6180:0:d0::4a6b:4001/tcp/4001","/ip4/139.59.118.153/tcp/4001","/ip4/10.15.0.6/tcp/4001","/ip4/10.130.30.8/tcp/4001","/ip6/2400:6180:0:d0::4a6b:4001/tcp/4001"],"ID":"QmewAL3LSmm6LutHZQzCyyHnPhzD6D8HaEnoTRhhsgZmwT"},{"Addrs":["/ip4/10.244.12.86/tcp/32268","/ip4/10.244.12.86/udp/32268/quic","/ip4/206.189.69.105/udp/32268/quic","/ip4/206.189.69.105/udp/22666/quic","/ip4/206.189.69.105/tcp/32268","/ip4/127.0.0.1/tcp/32268","/ip4/127.0.0.1/udp/32268/quic","/ip4/206.189.69.105/tcp/32268","/ip4/127.0.0.1/tcp/32268","/ip4/127.0.0.1/udp/32268/quic","/ip4/10.244.12.86/tcp/32268","/ip4/10.244.12.86/udp/32268/quic","/ip4/206.189.69.105/udp/32268/quic","/ip4/206.189.69.105/udp/22666/quic"],"ID":"12D3KooWL9FFNHCTJXYTJp12cpzK1D56TV3ytMk9eiGYoHTTK7g2"},{"Addrs":["/ip6/::1/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/192.168.0.18/tcp/4001","/ip4/180.115.231.110/tcp/1737","/ip6/::1/tcp/4001","/ip4/180.115.231.110/tcp/1737","/ip4/127.0.0.1/tcp/4001","/ip4/192.168.0.18/tcp/4001"],"ID":"QmWyXvLQ3GjR14korCbCDkWNrDxmSDww7zwy666mFa4WEL"},{"Addrs":["/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/51.15.44.84/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/51.15.44.84/tcp/4001"],"ID":"QmWgTDkh3FyWGQvkoRHYCC9cXpVapZdJushiXL29uDhKpj"},{"Addrs":["/ip4/87.250.9.250/tcp/40061","/ip4/127.0.0.1/tcp/40061","/ip4/87.250.9.250/tcp/40061","/ip4/127.0.0.1/tcp/40061"],"ID":"QmXEpNkoKsgCiUgahE2xK1LLc2sWHadHwQYKM8heBGgCM9"},{"Addrs":["/ip4/172.16.0.6/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/106.53.65.50/tcp/4001","/ip6/::1/tcp/4001","/ip4/172.16.0.6/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/106.53.65.50/tcp/4001"],"ID":"QmXLNGDen5zujDdtCJknN8fU7FUt4JKeK6ZvMz4bDkBPGr"},{"Addrs":["/ip4/192.168.10.104/tcp/42871","/ip4/76.190.151.191/tcp/42871","/ip4/127.0.0.1/tcp/42871","/ip4/127.0.0.1/tcp/42871","/ip4/192.168.10.104/tcp/42871","/ip4/76.190.151.191/tcp/42871"],"ID":"QmewxQ7GAaBnarMRH1zd6qF5r7gx3C6UNG1cUZjySUbRbW"},{"Addrs":["/ip4/61.85.31.188/tcp/53511","/ip4/127.0.0.1/tcp/53511","/ip4/61.85.31.188/tcp/53511","/ip4/127.0.0.1/tcp/53511"],"ID":"QmUghLop23aVBcv5aRNeVnbeYhNShQexdJcQ8CspVEd6yw"},{"Addrs":["/ip4/192.168.0.131/tcp/42835","/ip4/127.0.0.1/tcp/42835","/ip4/45.74.242.206/tcp/54524","/ip4/192.168.0.131/tcp/42835","/ip4/127.0.0.1/tcp/42835","/ip4/45.74.242.206/tcp/54524"],"ID":"QmPAQdK7kcKWeGUxPuLMgB84dWVhNbodeGGgCrQZpLy6XY"},{"Addrs":["/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip4/212.227.249.191/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip4/212.227.249.191/tcp/4001","/ip4/212.227.249.191/tcp/4001","/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip4/212.227.249.191/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/127.0.0.1/tcp/4001"],"ID":"QmcZrBqWBYV3RGsPuhQX11QzpKAQ8SYfMYL1dGXuPmaDYF"},{"Addrs":["/ip4/104.211.23.151/tcp/4001","/ip4/104.211.23.151/tcp/4001"],"ID":"12D3KooWHP7rcNmWrCv4fLETUUgm8TyJi3MVPu524oFesQFXD3xQ"},{"Addrs":["/ip4/172.31.57.88/tcp/42937","/ip4/172.31.57.88/udp/43710/quic","/ip4/127.0.0.1/tcp/42937","/ip4/127.0.0.1/udp/43710/quic","/ip4/3.84.222.217/udp/43710/quic","/ip4/3.84.222.217/tcp/42937","/ip4/3.84.222.217/tcp/42937","/ip4/172.31.57.88/tcp/42937","/ip4/172.31.57.88/udp/43710/quic","/ip4/127.0.0.1/tcp/42937","/ip4/127.0.0.1/udp/43710/quic","/ip4/3.84.222.217/udp/43710/quic"],"ID":"12D3KooWLypZpJgixtBrREJ84HbUnYd9D4jQdBeowZQFy8W9x3F8"},{"Addrs":["/ip4/96.28.60.159/tcp/44977","/ip4/127.0.0.1/tcp/44977","/ip4/127.0.0.1/tcp/44977","/ip4/96.28.60.159/tcp/44977"],"ID":"QmYkCBsfLosjzsBUtx6KDgSLJN6kd3JPa5bazYEatftPgK"},{"Addrs":["/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/192.168.2.51/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/98.128.230.155/udp/4001/quic","/ip4/98.128.230.155/tcp/4001","/ip4/192.168.2.51/tcp/4001","/ip4/98.128.230.155/udp/4001/quic","/ip4/192.168.2.51/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/192.168.2.51/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/98.128.230.155/tcp/4001"],"ID":"12D3KooWA44eezTF4qjiKJ14KVKEgu7WN4ypZC5VLfRfvmUdDtdK"},{"Addrs":["/ip4/127.0.0.1/tcp/4001","/ip4/172.31.0.2/tcp/4001","/ip4/223.200.155.59/tcp/64417","/ip4/127.0.0.1/tcp/4001","/ip4/172.31.0.2/tcp/4001","/ip4/223.200.155.59/tcp/64417"],"ID":"QmUx1i6hiQDVTLqysbHfFRi1ig5X28MQzFP4p8wsCXeWU6"},{"Addrs":["/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/172.31.19.245/tcp/4001","/ip4/172.31.19.245/udp/4001/quic","/ip4/18.218.250.68/tcp/4001","/ip4/18.218.250.68/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip4/172.31.19.245/udp/4001/quic","/ip4/18.218.250.68/tcp/4001","/ip4/18.218.250.68/udp/4001/quic","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/172.31.19.245/tcp/4001"],"ID":"QmZeXmfSsz6CHCPHjfLAdmKHuzV1oiPYgLKgTLpfpJ4nhm"},{"Addrs":["/ip4/34.74.155.182/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/34.74.155.182/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001"],"ID":"QmRAPZYEGyZxuWzN19MDNYXt6XmGr6B5vwcqCuYArCZBJZ"}],"Type":1} {"Extra":"","ID":"12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3","Responses":null,"Type":0} {"Extra":"","ID":"","Responses":[{"Addrs":["/ip4/45.113.32.180/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/192.168.1.7/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip4/103.40.249.242/tcp/4001","/ip4/103.40.249.242/tcp/20111","/ip6/::1/udp/4001/quic","/ip4/45.113.32.180/tcp/52610","/ip4/192.168.1.7/tcp/4001","/ip4/45.113.32.180/udp/1447/quic","/ip6/::1/tcp/4001","/ip4/45.113.32.180/udp/4001/quic","/ip4/103.40.249.242/udp/4001/quic"],"ID":"12D3KooWDd2WUiFK29Y3byUPAwQmMYC9QDp1e3UmnmAwwTEGvKfk"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWA5HzYN4VcNkvPxT31qJWx92MF5Qzb1a9AsTetinuNKzs"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWADaUtfpf7hahJooJoxB9fNgMcb7kXRUWkvFmPT1kxb5Q"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":["/ip4/194.156.99.251/tcp/4001","/ip4/194.156.99.251/tcp/54346"],"ID":"12D3KooWB5nAjGFhwJqtBuwLSNfEhFBvZrURdxtib7aHdhHZFwCm"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWBdW6dYGB7i34UvipVtgnToEFQH9dr2B91usfBA4AQxTK"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWCQx1kaJpQHMnYWd2isntkn4uej1YSNpNjgShGwFEeyJi"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWHjDiPvWWUNxLZWz3hzbodth4c5GZ45AkWYbWXNDdRbrg"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWExM3AvSYUxgSyHVRvfxHPCaM5PgYNCLZBMc54eWQzMJ3"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWF7GeAYDjUpPXKJCPo6GrNeTAYxcPx54vfLddbLyPQ2qm"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWFGJeNYZ2EPFGk6YCTL2y8oqWXsPxqb5hB1jeMBuNP5Rg"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWG152XtuC4VrbNFKoxheuWQB2wGQ7ETrubMn8ytGBZFqK"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWGM2bMa6p3up2y5xuESZiA4srXUUjdYdcTmTtnTjLyyzY"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWGbhUKsu5aEBrkGsbW4zTQ8YRGKUBLupSsBwE1G2kAsYC"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWGyVABBGz4dapgMJmK5vTX9iTznCtbYGc6aaRooZX1oD8"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":["/ip4/132.145.76.242/tcp/4001","/ip4/10.0.0.2/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip6/::1/tcp/4001","/ip4/10.0.0.2/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic","/ip6/::1/udp/4001/quic","/ip4/132.145.76.242/udp/4001/quic"],"ID":"12D3KooWHH2iDTb6MxDrtUGdFMuikVeyobaZPoARB2d9HJ9iMo2V"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWHKn6fHgCbMtQYw2ZVYe5agXp1vutUhajHuwgegZW9gvG"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWN2MMNdanfQ9gFgv4YEVGxWCs2h4VcmaJmxWJgPf3sM7Y"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":["/ip6/::1/udp/4001/quic","/ip6/::1/tcp/4001","/ip4/51.75.127.200/tcp/4001","/ip4/127.0.0.1/tcp/4001","/ip4/51.75.127.200/udp/4001/quic","/ip4/127.0.0.1/udp/4001/quic"],"ID":"12D3KooWK4JdWzsKR5THsrgyoVGgG2gBRLFww2pkjVQ5zSC3K12R"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWKFKByZhyxtdD9Am13KfsLyEcugfrCcGwnQzCJQZTcJM1"}],"Type":4} {"Extra":"","ID":"","Responses":[{"Addrs":null,"ID":"12D3KooWSRsuHTHXg5t4J1kVaTb6T1a5XmEjsNqbiezGbGK8uDD5"}],"Type":4} ``` YASON:PARSE only parses the first JSON expression... Gah.
stacksmith commented 2020-12-22 18:31:16 -06:00 (Migrated from github.com)

YASON:PARSE ignores all but the first response. To be honest, the responses should have been encoded as an array...
IPFS> (yason:parse "{ \"a\" : 2 } { up-yours} ")
I don't feel like preparsing the input to yason:parse (it would require comma separators and surrounding braces).

YASON:PARSE ignores all but the first response. To be honest, the responses should have been encoded as an array... ```IPFS> (yason:parse "{ \"a\" : 2 } { up-yours} ")``` I don't feel like preparsing the input to yason:parse (it would require comma separators and surrounding braces).
stacksmith commented 2020-12-22 19:01:22 -06:00 (Migrated from github.com)
(defun ipfs-call1 (call arguments &key (parameters nil) (want-stream nil)
			   (method :POST))
  "Make an IPFS HTTP API call. Quite commonly used.
   Some calls return strings/raw data, and others return JSON.
   When strings/arbitrary data are recieved, they're returned verbatim.
   But, when JSON is returned, it is parsed into a hashtable.
   If the JSON is 'error JSON', I.E., it signals that an error has been
   recieved, two values are returned: NIL and the string-error-message."
  (let ((result
	  (drakma:http-request
	    (make-call-url *api-host* *api-root* call arguments)
	    :method method
	    :url-encoder #'ipfs::url-encode
	    :parameters parameters
	    :want-stream want-stream)))

    (cond (want-stream result)
	  ((stringp result) result)
	  ((vectorp result)
	   (format t "~A" (yason:parse (flexi-streams:octets-to-string result)
				       :object-as :alist))
	   (let ((string (flexi-streams:octets-to-string result) ))
	     (with-input-from-string (stream string)
	       (loop while (peek-char t stream nil)		;(listen stream)
		     collect (yason:parse stream :object-as :alist)))
	 )))))

A first whack. I convert the string to a stream, then go into a loop asking YASON to parse until EOF... Oh, and YASON can deliver an ALIST without an extra step of going to a hashtable and back to an ALIST...

Now the output is complete (and a bit long-winded):

((("Type" . 7) ("Responses")
  ("ID" . "12D3KooWJUQ2Xk9TUqWKNPBDSr6Cfj5XVTKB2ZzQHZmANmuARotU")
  ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "QmcbTjrtTQj94uKxQkHmKq9nGfXnaQar36QwKbJDa9pMLg") ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "QmaY8pZtpSUugRwjDmnEngENPQMq9ipCXZw432kR4Ugxgn") ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "QmSb8vSark1ZhHv7m5TDgQFcVHYoZtebpACWBPk14BUFiD") ("Extra" . ""))
 (("Type" . 0) ("Responses")
  ("ID" . "QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv") ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "QmQg3un1fwoQXYR221wQS2S5NFVVgARgjB4JrFmYNpeQTA") ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "Qmcrv6s2ThaJfNafs1E2w89SYLJnM3X5YJa5HJHX43qap7") ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "12D3KooWCXYFMWFLWBRWzULXpUB6QRP5ytGZhxrCkVx4p3r3C6Kd")
  ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "QmVFEyseBFB3jv9CJL8YWRN3PhduwGsFVPqiH1eDdoZmEU") ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "QmPEambM2Hfq53oTUgub842koJC5LQxALJvTV4pMLUhLDZ") ("Extra" . ""))
 (("Type" . 1)
  ("Responses"
   (("ID" . "12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3")
    ("Addrs" "/ip4/54.158.134.9/tcp/4001" "/ip4/54.158.134.9/udp/4001/quic"
     "/ip4/172.31.17.20/tcp/4001" "/ip6/::1/tcp/4001"
     "/ip4/127.0.0.1/udp/4001/quic" "/ip4/172.31.17.20/udp/4001/quic"
     "/ip6/::1/udp/4001/quic" "/ip4/127.0.0.1/tcp/4001"
     "/ip4/54.158.134.9/tcp/4001" "/ip4/172.31.17.20/udp/4001/quic"
     "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic"
     "/ip4/172.31.17.20/tcp/4001" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001"
     "/ip4/54.158.134.9/udp/4001/quic"))
   (("ID" . "QmVJir9HuBWVzWQQvXfLndwQY62YrytVdxdvrXghWDexLY")
    ("Addrs" "/ip4/207.189.196.12/tcp/51942" "/ip4/127.0.0.1/tcp/51942"))
   (("ID" . "QmdWZRzS5QNJXTvUpLdrQ126WSDH5oHpZVo68GG7ggoGir")
    ("Addrs" "/ip6/::1/tcp/4001" "/ip4/180.116.170.87/tcp/6756"
     "/ip4/127.0.0.1/tcp/4001" "/ip4/192.168.0.118/tcp/4001"))
   (("ID" . "QmWyXvLQ3GjR14korCbCDkWNrDxmSDww7zwy666mFa4WEL")
    ("Addrs" "/ip4/192.168.0.18/tcp/4001" "/ip4/180.115.231.110/tcp/1737"
     "/ip6/::1/tcp/4001" "/ip4/127.0.0.1/tcp/4001"))
   (("ID" . "12D3KooWM3RqXZdQ4dXRuKiPxC9KaGq348pC28kdY1frjYkx26JT")
    ("Addrs" "/ip4/149.202.76.157/tcp/4001" "/ip4/127.0.0.1/tcp/4001"
     "/ip6/::1/tcp/4001" "/ip4/149.202.76.157/udp/4001/quic"
     "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic"
     "/ip6/2001:41d0:d:359d::/tcp/4001"
     "/ip6/2001:41d0:d:359d::/udp/4001/quic"))
   (("ID" . "12D3KooWBoZSafzTKHysRda9CZPxkwRVef2QbdbrdNEibvyG57K9")
    ("Addrs" "/ip4/159.65.73.69/udp/30753/quic" "/ip4/10.244.10.65/tcp/30753"
     "/ip4/127.0.0.1/tcp/30753" "/ip4/10.244.10.65/udp/30753/quic"
     "/ip4/127.0.0.1/udp/30753/quic" "/ip4/159.65.73.69/tcp/30753"
     "/ip4/159.65.73.69/udp/20814/quic"))
   (("ID" . "QmcZDoT5svpNfsARB4ZPsbLYo88WiTpZhZUCE9hZZC43wB")
    ("Addrs" "/ip4/127.0.0.1/tcp/42914" "/ip4/192.168.1.120/tcp/42914"
     "/ip4/73.150.107.80/tcp/42914"))
   (("ID" . "12D3KooWHP7rcNmWrCv4fLETUUgm8TyJi3MVPu524oFesQFXD3xQ")
    ("Addrs" "/ip4/104.211.23.151/tcp/4001"))
   (("ID" . "QmUUAx3VWQcWiWV6vmTDPUtQzooppzMy47WSBfGgW1pLnJ")
    ("Addrs" "/ip4/192.168.0.19/tcp/4001" "/ip4/172.17.0.1/tcp/4001"
     "/ip4/63.226.63.33/tcp/14550"))
   (("ID" . "12D3KooWLypZpJgixtBrREJ84HbUnYd9D4jQdBeowZQFy8W9x3F8")
    ("Addrs" "/ip4/172.31.57.88/udp/43710/quic" "/ip4/127.0.0.1/tcp/42937"
     "/ip4/127.0.0.1/udp/43710/quic" "/ip4/3.84.222.217/udp/43710/quic"
     "/ip4/3.84.222.217/tcp/42937" "/ip4/172.31.57.88/tcp/42937"))
   (("ID" . "12D3KooWDtDgQDTm8BM65G6QvpR9cPDYTh2Jeon1nuFGMG5e5K5p")
    ("Addrs" "/ip6/::1/udp/4001/quic"
     "/ip6/2605:a601:aa2f:1f00:8d02:ff80:bc14:eda9/tcp/4001"
     "/ip4/136.49.200.163/tcp/61843" "/ip4/127.0.0.1/tcp/4001"
     "/ip6/::1/tcp/4001" "/ip4/192.168.1.100/udp/4001/quic"
     "/ip4/136.49.200.163/udp/61843/quic"
     "/ip6/2605:a601:aa2f:1f00:8d02:ff80:bc14:eda9/udp/4001/quic"
     "/ip4/127.0.0.1/udp/4001/quic" "/ip4/192.168.1.100/tcp/4001"))
   (("ID" . "QmZeXmfSsz6CHCPHjfLAdmKHuzV1oiPYgLKgTLpfpJ4nhm")
    ("Addrs" "/ip4/18.218.250.68/tcp/4001" "/ip4/18.218.250.68/udp/4001/quic"
     "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001"
     "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic"
     "/ip4/172.31.19.245/tcp/4001" "/ip4/172.31.19.245/udp/4001/quic"))
   (("ID" . "12D3KooWK8GPZ2gDw1LfDMHSJb1qty7rfqY6VUofU7kNEv2mXMbX")
    ("Addrs" "/ip4/104.244.72.144/tcp/8081/ws" "/ip6/::1/tcp/8081/ws"
     "/ip6/::1/udp/4001/quic" "/ip6/::1/tcp/4001"
     "/ip4/104.244.72.144/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic"
     "/ip4/127.0.0.1/tcp/4001" "/ip4/127.0.0.1/tcp/8081/ws"
     "/ip4/104.244.72.144/tcp/4001"))
   (("ID" . "QmRAPZYEGyZxuWzN19MDNYXt6XmGr6B5vwcqCuYArCZBJZ")
    ("Addrs" "/ip4/34.74.155.182/tcp/4001" "/ip4/127.0.0.1/tcp/4001"
     "/ip6/::1/tcp/4001"))
   (("ID" . "12D3KooWCay869Sz7JBbVz5uRqMtGUBHpCA5gsVSRxB1Vm4CRBHj")
    ("Addrs" "/ip4/206.189.69.143/tcp/30523" "/ip4/127.0.0.1/tcp/30523"
     "/ip4/10.244.10.227/udp/30523/quic" "/ip4/206.189.69.143/udp/26487/quic"
     "/ip4/127.0.0.1/udp/30523/quic" "/ip4/206.189.69.143/udp/30523/quic"
     "/ip4/10.244.10.227/tcp/30523"))
   (("ID" . "QmTAR67GpY4LKp5ccUvQ5Qb54UAygqQSBgakwF7dPVs752")
    ("Addrs" "/ip4/127.0.0.1/tcp/34306" "/ip4/117.146.52.62/tcp/34306"))
   (("ID" . "QmSQcMgxVHYgngAbix58j7rmRfB7y6nGrzivQ7otFk6RYN")
    ("Addrs" "/ip4/127.0.0.1/tcp/58764" "/ip4/24.90.4.9/udp/12660/quic"
     "/ip4/10.20.163.77/udp/55563/quic" "/ip6/::1/tcp/58765"
     "/ip6/fe80::5a58:8dd:d756:de65/tcp/58765" "/ip4/10.20.163.77/tcp/58764"
     "/ip4/24.90.4.9/tcp/64379" "/ip4/24.90.4.9/tcp/30817"
     "/ip4/127.0.0.1/udp/55563/quic" "/ip6/::1/udp/55564/quic"
     "/ip6/fe80::5a58:8dd:d756:de65/udp/55564/quic"
     "/ip4/24.90.4.9/udp/39088/quic"))
   (("ID" . "QmfVWUd6LbTmh6Xhwhj6EbEwn6iKbnsvxc994iT1rjmxa3")
    ("Addrs" "/ip4/119.237.111.166/tcp/37622" "/ip4/127.0.0.1/tcp/37622"))
   (("ID" . "Qmf64UEGazB2fZZpQDGXhHFsWYoygM8kKm5rPtZ8svDtsd")
    ("Addrs" "/ip4/127.0.0.1/tcp/33459" "/ip4/109.162.44.65/tcp/33459"))
   (("ID" . "QmW5FPWs3gtgHUMDGYk4W1JfSN1dBvqtPYwfkTi4Bg66pc")
    ("Addrs" "/ip4/127.0.0.1/tcp/4001" "/ip4/96.44.156.195/tcp/4001"
     "/ip6/::1/tcp/4001")))
  ("ID" . "QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv") ("Extra" . ""))
 (("Type" . 7) ("Responses")
  ("ID" . "12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3")
  ("Extra" . ""))
 (("Type" . 0) ("Responses")
  ("ID" . "12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3")
  ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWDd2WUiFK29Y3byUPAwQmMYC9QDp1e3UmnmAwwTEGvKfk") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWA5HzYN4VcNkvPxT31qJWx92MF5Qzb1a9AsTetinuNKzs") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWADaUtfpf7hahJooJoxB9fNgMcb7kXRUWkvFmPT1kxb5Q") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWB5nAjGFhwJqtBuwLSNfEhFBvZrURdxtib7aHdhHZFwCm") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWBdW6dYGB7i34UvipVtgnToEFQH9dr2B91usfBA4AQxTK") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWCQx1kaJpQHMnYWd2isntkn4uej1YSNpNjgShGwFEeyJi") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWHjDiPvWWUNxLZWz3hzbodth4c5GZ45AkWYbWXNDdRbrg") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWExM3AvSYUxgSyHVRvfxHPCaM5PgYNCLZBMc54eWQzMJ3") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWF7GeAYDjUpPXKJCPo6GrNeTAYxcPx54vfLddbLyPQ2qm")
    ("Addrs" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic"
     "/ip4/168.138.42.234/tcp/4001" "/ip4/168.138.42.234/udp/4001/quic"
     "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWFGJeNYZ2EPFGk6YCTL2y8oqWXsPxqb5hB1jeMBuNP5Rg")
    ("Addrs" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001"
     "/ip4/157.245.93.202/tcp/4001" "/ip4/157.245.93.202/udp/4001/quic"
     "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWG152XtuC4VrbNFKoxheuWQB2wGQ7ETrubMn8ytGBZFqK") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWGM2bMa6p3up2y5xuESZiA4srXUUjdYdcTmTtnTjLyyzY") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWGbhUKsu5aEBrkGsbW4zTQ8YRGKUBLupSsBwE1G2kAsYC") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWGyVABBGz4dapgMJmK5vTX9iTznCtbYGc6aaRooZX1oD8") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWHH2iDTb6MxDrtUGdFMuikVeyobaZPoARB2d9HJ9iMo2V")
    ("Addrs" "/ip4/132.145.76.242/tcp/4001" "/ip4/10.0.0.2/tcp/4001"
     "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001"
     "/ip4/10.0.0.2/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic"
     "/ip6/::1/udp/4001/quic" "/ip4/132.145.76.242/udp/4001/quic")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWHKn6fHgCbMtQYw2ZVYe5agXp1vutUhajHuwgegZW9gvG") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWN2MMNdanfQ9gFgv4YEVGxWCs2h4VcmaJmxWJgPf3sM7Y") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWK4JdWzsKR5THsrgyoVGgG2gBRLFww2pkjVQ5zSC3K12R")
    ("Addrs" "/ip6/::1/tcp/4001" "/ip4/51.75.127.200/tcp/4001"
     "/ip4/127.0.0.1/tcp/4001" "/ip4/51.75.127.200/udp/4001/quic"
     "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWKFKByZhyxtdD9Am13KfsLyEcugfrCcGwnQzCJQZTcJM1") ("Addrs")))
  ("ID" . "") ("Extra" . ""))
 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWSRsuHTHXg5t4J1kVaTb6T1a5XmEjsNqbiezGbGK8uDD5") ("Addrs")))
  ("ID" . "") ("Extra" . "")))
``` (defun ipfs-call1 (call arguments &key (parameters nil) (want-stream nil) (method :POST)) "Make an IPFS HTTP API call. Quite commonly used. Some calls return strings/raw data, and others return JSON. When strings/arbitrary data are recieved, they're returned verbatim. But, when JSON is returned, it is parsed into a hashtable. If the JSON is 'error JSON', I.E., it signals that an error has been recieved, two values are returned: NIL and the string-error-message." (let ((result (drakma:http-request (make-call-url *api-host* *api-root* call arguments) :method method :url-encoder #'ipfs::url-encode :parameters parameters :want-stream want-stream))) (cond (want-stream result) ((stringp result) result) ((vectorp result) (format t "~A" (yason:parse (flexi-streams:octets-to-string result) :object-as :alist)) (let ((string (flexi-streams:octets-to-string result) )) (with-input-from-string (stream string) (loop while (peek-char t stream nil) ;(listen stream) collect (yason:parse stream :object-as :alist))) ))))) ``` A first whack. I convert the string to a stream, then go into a loop asking YASON to parse until EOF... Oh, and YASON can deliver an ALIST without an extra step of going to a hashtable and back to an ALIST... Now the output is complete (and a bit long-winded): ``` ((("Type" . 7) ("Responses") ("ID" . "12D3KooWJUQ2Xk9TUqWKNPBDSr6Cfj5XVTKB2ZzQHZmANmuARotU") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "QmcbTjrtTQj94uKxQkHmKq9nGfXnaQar36QwKbJDa9pMLg") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "QmaY8pZtpSUugRwjDmnEngENPQMq9ipCXZw432kR4Ugxgn") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "QmSb8vSark1ZhHv7m5TDgQFcVHYoZtebpACWBPk14BUFiD") ("Extra" . "")) (("Type" . 0) ("Responses") ("ID" . "QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "QmQg3un1fwoQXYR221wQS2S5NFVVgARgjB4JrFmYNpeQTA") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "Qmcrv6s2ThaJfNafs1E2w89SYLJnM3X5YJa5HJHX43qap7") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "12D3KooWCXYFMWFLWBRWzULXpUB6QRP5ytGZhxrCkVx4p3r3C6Kd") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "QmVFEyseBFB3jv9CJL8YWRN3PhduwGsFVPqiH1eDdoZmEU") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "QmPEambM2Hfq53oTUgub842koJC5LQxALJvTV4pMLUhLDZ") ("Extra" . "")) (("Type" . 1) ("Responses" (("ID" . "12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3") ("Addrs" "/ip4/54.158.134.9/tcp/4001" "/ip4/54.158.134.9/udp/4001/quic" "/ip4/172.31.17.20/tcp/4001" "/ip6/::1/tcp/4001" "/ip4/127.0.0.1/udp/4001/quic" "/ip4/172.31.17.20/udp/4001/quic" "/ip6/::1/udp/4001/quic" "/ip4/127.0.0.1/tcp/4001" "/ip4/54.158.134.9/tcp/4001" "/ip4/172.31.17.20/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic" "/ip4/172.31.17.20/tcp/4001" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001" "/ip4/54.158.134.9/udp/4001/quic")) (("ID" . "QmVJir9HuBWVzWQQvXfLndwQY62YrytVdxdvrXghWDexLY") ("Addrs" "/ip4/207.189.196.12/tcp/51942" "/ip4/127.0.0.1/tcp/51942")) (("ID" . "QmdWZRzS5QNJXTvUpLdrQ126WSDH5oHpZVo68GG7ggoGir") ("Addrs" "/ip6/::1/tcp/4001" "/ip4/180.116.170.87/tcp/6756" "/ip4/127.0.0.1/tcp/4001" "/ip4/192.168.0.118/tcp/4001")) (("ID" . "QmWyXvLQ3GjR14korCbCDkWNrDxmSDww7zwy666mFa4WEL") ("Addrs" "/ip4/192.168.0.18/tcp/4001" "/ip4/180.115.231.110/tcp/1737" "/ip6/::1/tcp/4001" "/ip4/127.0.0.1/tcp/4001")) (("ID" . "12D3KooWM3RqXZdQ4dXRuKiPxC9KaGq348pC28kdY1frjYkx26JT") ("Addrs" "/ip4/149.202.76.157/tcp/4001" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001" "/ip4/149.202.76.157/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic" "/ip6/2001:41d0:d:359d::/tcp/4001" "/ip6/2001:41d0:d:359d::/udp/4001/quic")) (("ID" . "12D3KooWBoZSafzTKHysRda9CZPxkwRVef2QbdbrdNEibvyG57K9") ("Addrs" "/ip4/159.65.73.69/udp/30753/quic" "/ip4/10.244.10.65/tcp/30753" "/ip4/127.0.0.1/tcp/30753" "/ip4/10.244.10.65/udp/30753/quic" "/ip4/127.0.0.1/udp/30753/quic" "/ip4/159.65.73.69/tcp/30753" "/ip4/159.65.73.69/udp/20814/quic")) (("ID" . "QmcZDoT5svpNfsARB4ZPsbLYo88WiTpZhZUCE9hZZC43wB") ("Addrs" "/ip4/127.0.0.1/tcp/42914" "/ip4/192.168.1.120/tcp/42914" "/ip4/73.150.107.80/tcp/42914")) (("ID" . "12D3KooWHP7rcNmWrCv4fLETUUgm8TyJi3MVPu524oFesQFXD3xQ") ("Addrs" "/ip4/104.211.23.151/tcp/4001")) (("ID" . "QmUUAx3VWQcWiWV6vmTDPUtQzooppzMy47WSBfGgW1pLnJ") ("Addrs" "/ip4/192.168.0.19/tcp/4001" "/ip4/172.17.0.1/tcp/4001" "/ip4/63.226.63.33/tcp/14550")) (("ID" . "12D3KooWLypZpJgixtBrREJ84HbUnYd9D4jQdBeowZQFy8W9x3F8") ("Addrs" "/ip4/172.31.57.88/udp/43710/quic" "/ip4/127.0.0.1/tcp/42937" "/ip4/127.0.0.1/udp/43710/quic" "/ip4/3.84.222.217/udp/43710/quic" "/ip4/3.84.222.217/tcp/42937" "/ip4/172.31.57.88/tcp/42937")) (("ID" . "12D3KooWDtDgQDTm8BM65G6QvpR9cPDYTh2Jeon1nuFGMG5e5K5p") ("Addrs" "/ip6/::1/udp/4001/quic" "/ip6/2605:a601:aa2f:1f00:8d02:ff80:bc14:eda9/tcp/4001" "/ip4/136.49.200.163/tcp/61843" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001" "/ip4/192.168.1.100/udp/4001/quic" "/ip4/136.49.200.163/udp/61843/quic" "/ip6/2605:a601:aa2f:1f00:8d02:ff80:bc14:eda9/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic" "/ip4/192.168.1.100/tcp/4001")) (("ID" . "QmZeXmfSsz6CHCPHjfLAdmKHuzV1oiPYgLKgTLpfpJ4nhm") ("Addrs" "/ip4/18.218.250.68/tcp/4001" "/ip4/18.218.250.68/udp/4001/quic" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic" "/ip4/172.31.19.245/tcp/4001" "/ip4/172.31.19.245/udp/4001/quic")) (("ID" . "12D3KooWK8GPZ2gDw1LfDMHSJb1qty7rfqY6VUofU7kNEv2mXMbX") ("Addrs" "/ip4/104.244.72.144/tcp/8081/ws" "/ip6/::1/tcp/8081/ws" "/ip6/::1/udp/4001/quic" "/ip6/::1/tcp/4001" "/ip4/104.244.72.144/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic" "/ip4/127.0.0.1/tcp/4001" "/ip4/127.0.0.1/tcp/8081/ws" "/ip4/104.244.72.144/tcp/4001")) (("ID" . "QmRAPZYEGyZxuWzN19MDNYXt6XmGr6B5vwcqCuYArCZBJZ") ("Addrs" "/ip4/34.74.155.182/tcp/4001" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001")) (("ID" . "12D3KooWCay869Sz7JBbVz5uRqMtGUBHpCA5gsVSRxB1Vm4CRBHj") ("Addrs" "/ip4/206.189.69.143/tcp/30523" "/ip4/127.0.0.1/tcp/30523" "/ip4/10.244.10.227/udp/30523/quic" "/ip4/206.189.69.143/udp/26487/quic" "/ip4/127.0.0.1/udp/30523/quic" "/ip4/206.189.69.143/udp/30523/quic" "/ip4/10.244.10.227/tcp/30523")) (("ID" . "QmTAR67GpY4LKp5ccUvQ5Qb54UAygqQSBgakwF7dPVs752") ("Addrs" "/ip4/127.0.0.1/tcp/34306" "/ip4/117.146.52.62/tcp/34306")) (("ID" . "QmSQcMgxVHYgngAbix58j7rmRfB7y6nGrzivQ7otFk6RYN") ("Addrs" "/ip4/127.0.0.1/tcp/58764" "/ip4/24.90.4.9/udp/12660/quic" "/ip4/10.20.163.77/udp/55563/quic" "/ip6/::1/tcp/58765" "/ip6/fe80::5a58:8dd:d756:de65/tcp/58765" "/ip4/10.20.163.77/tcp/58764" "/ip4/24.90.4.9/tcp/64379" "/ip4/24.90.4.9/tcp/30817" "/ip4/127.0.0.1/udp/55563/quic" "/ip6/::1/udp/55564/quic" "/ip6/fe80::5a58:8dd:d756:de65/udp/55564/quic" "/ip4/24.90.4.9/udp/39088/quic")) (("ID" . "QmfVWUd6LbTmh6Xhwhj6EbEwn6iKbnsvxc994iT1rjmxa3") ("Addrs" "/ip4/119.237.111.166/tcp/37622" "/ip4/127.0.0.1/tcp/37622")) (("ID" . "Qmf64UEGazB2fZZpQDGXhHFsWYoygM8kKm5rPtZ8svDtsd") ("Addrs" "/ip4/127.0.0.1/tcp/33459" "/ip4/109.162.44.65/tcp/33459")) (("ID" . "QmW5FPWs3gtgHUMDGYk4W1JfSN1dBvqtPYwfkTi4Bg66pc") ("Addrs" "/ip4/127.0.0.1/tcp/4001" "/ip4/96.44.156.195/tcp/4001" "/ip6/::1/tcp/4001"))) ("ID" . "QmZfCTbC2FhuBKHrb48JT3PH4GijTdmtdi2YVLGt5T4Ufv") ("Extra" . "")) (("Type" . 7) ("Responses") ("ID" . "12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3") ("Extra" . "")) (("Type" . 0) ("Responses") ("ID" . "12D3KooWNoHRfno55jVuPo5Dvvg98KBDvUij98vkpTwLNFQ6yun3") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWDd2WUiFK29Y3byUPAwQmMYC9QDp1e3UmnmAwwTEGvKfk") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWA5HzYN4VcNkvPxT31qJWx92MF5Qzb1a9AsTetinuNKzs") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWADaUtfpf7hahJooJoxB9fNgMcb7kXRUWkvFmPT1kxb5Q") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWB5nAjGFhwJqtBuwLSNfEhFBvZrURdxtib7aHdhHZFwCm") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWBdW6dYGB7i34UvipVtgnToEFQH9dr2B91usfBA4AQxTK") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWCQx1kaJpQHMnYWd2isntkn4uej1YSNpNjgShGwFEeyJi") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWHjDiPvWWUNxLZWz3hzbodth4c5GZ45AkWYbWXNDdRbrg") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWExM3AvSYUxgSyHVRvfxHPCaM5PgYNCLZBMc54eWQzMJ3") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWF7GeAYDjUpPXKJCPo6GrNeTAYxcPx54vfLddbLyPQ2qm") ("Addrs" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic" "/ip4/168.138.42.234/tcp/4001" "/ip4/168.138.42.234/udp/4001/quic" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWFGJeNYZ2EPFGk6YCTL2y8oqWXsPxqb5hB1jeMBuNP5Rg") ("Addrs" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001" "/ip4/157.245.93.202/tcp/4001" "/ip4/157.245.93.202/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWG152XtuC4VrbNFKoxheuWQB2wGQ7ETrubMn8ytGBZFqK") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWGM2bMa6p3up2y5xuESZiA4srXUUjdYdcTmTtnTjLyyzY") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWGbhUKsu5aEBrkGsbW4zTQ8YRGKUBLupSsBwE1G2kAsYC") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWGyVABBGz4dapgMJmK5vTX9iTznCtbYGc6aaRooZX1oD8") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWHH2iDTb6MxDrtUGdFMuikVeyobaZPoARB2d9HJ9iMo2V") ("Addrs" "/ip4/132.145.76.242/tcp/4001" "/ip4/10.0.0.2/tcp/4001" "/ip4/127.0.0.1/tcp/4001" "/ip6/::1/tcp/4001" "/ip4/10.0.0.2/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic" "/ip4/132.145.76.242/udp/4001/quic"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWHKn6fHgCbMtQYw2ZVYe5agXp1vutUhajHuwgegZW9gvG") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWN2MMNdanfQ9gFgv4YEVGxWCs2h4VcmaJmxWJgPf3sM7Y") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWK4JdWzsKR5THsrgyoVGgG2gBRLFww2pkjVQ5zSC3K12R") ("Addrs" "/ip6/::1/tcp/4001" "/ip4/51.75.127.200/tcp/4001" "/ip4/127.0.0.1/tcp/4001" "/ip4/51.75.127.200/udp/4001/quic" "/ip4/127.0.0.1/udp/4001/quic" "/ip6/::1/udp/4001/quic"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWKFKByZhyxtdD9Am13KfsLyEcugfrCcGwnQzCJQZTcJM1") ("Addrs"))) ("ID" . "") ("Extra" . "")) (("Type" . 4) ("Responses" (("ID" . "12D3KooWSRsuHTHXg5t4J1kVaTb6T1a5XmEjsNqbiezGbGK8uDD5") ("Addrs"))) ("ID" . "") ("Extra" . ""))) ```
JadedCtrl commented 2020-12-23 21:16:23 -06:00 (Migrated from github.com)

I used your ipfs-call as a basis for this last commit (f185501). #'dht-findprovs (among others) should be working just fine now. Thanks a lot for the basis.

I used your ipfs-call as a basis for this last commit (f185501). #'dht-findprovs (among others) should be working just fine now. Thanks a lot for the basis.
stacksmith commented 2020-12-24 11:02:24 -06:00 (Migrated from github.com)

Yes, it returns all the responses, although it is somewhat verbose.

I don't have enough experience with IPFS to make any serious suggestions, but the empty "Addrs", "ID" and "Extra" fields could be filtered somehow... The inconsistency of "Addrs" list with nothing following and "ID" and "Extra" as conses is also irksome. API bindings always turn into a headache once you start lispifying them...

Yes, it returns all the responses, although it is somewhat verbose. I don't have enough experience with IPFS to make any serious suggestions, but the empty "Addrs", "ID" and "Extra" fields could be filtered somehow... The inconsistency of "Addrs" list with nothing following and "ID" and "Extra" as conses is also irksome. API bindings always turn into a headache once you start lispifying them...
JadedCtrl commented 2020-12-29 14:12:13 -06:00 (Migrated from github.com)

Do you have any examples of calls with those empty fields? They sound annoying, I'll try filtering them out.

Do you have any examples of calls with those empty fields? They sound annoying, I'll try filtering them out.
stacksmith commented 2020-12-29 14:47:10 -06:00 (Migrated from github.com)

In the post above, things like

 (("Type" . 4)
  ("Responses"
   (("ID" . "12D3KooWSRsuHTHXg5t4J1kVaTb6T1a5XmEjsNqbiezGbGK8uDD5") ("Addrs")))
  ("ID" . "") ("Extra" . "")))
In the post above, things like ``` (("Type" . 4) ("Responses" (("ID" . "12D3KooWSRsuHTHXg5t4J1kVaTb6T1a5XmEjsNqbiezGbGK8uDD5") ("Addrs"))) ("ID" . "") ("Extra" . ""))) ```
JadedCtrl commented 2020-12-30 09:16:22 -06:00 (Migrated from github.com)

Ahh, I see what you mean now, thanks. I'll work on it.

API bindings always turn into a headache once you start lispifying them...

Aint that the truth.

Ahh, I see what you mean now, thanks. I'll work on it. > API bindings always turn into a headache once you start lispifying them... Aint that the truth.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jadedctrl/cl-ipfs-api2#2
No description provided.