ipfs/kubo

`ipfs --encoding=json ls` not returning JSON

Open

#7050 aperta il 28 mar 2020

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Go (2725 fork)batch import
P2help wantedkind/bug

Metriche repository

Star
 (13.906 star)
Metriche merge PR
 (Merge medio 4g 2h) (28 PR mergiate in 30 g)

Descrizione

Version information:

go-ipfs version: 0.4.23-6ce9a35 Repo version: 7 System version: amd64/darwin Golang version: go1.13.7

Description:

The output of ipfs --encoding=json ls is expected to return JSON, as with other commands. Instead, the output is the same as without the encoding parameter.

Example:

$ ipfs ls /ipfs/QmQy8FTQCdJGtNHg92pc4B6F4cjnuSdrFx9gdRmkrE1rVF
QmWyDJmrr6cRwEpTF2VGhWDi4uytrDHT8S5BptVdkbhjpv 6060 README.md
$ ipfs --encoding=json ls /ipfs/QmQy8FTQCdJGtNHg92pc4B6F4cjnuSdrFx9gdRmkrE1rVF
QmWyDJmrr6cRwEpTF2VGhWDi4uytrDHT8S5BptVdkbhjpv 6060 README.md

Expected output similar to HTTP API call:

curl "http://localhost:5001/api/v0/ls?arg=/ipfs/QmQy8FTQCdJGtNHg92pc4B6F4cjnuSdrFx9gdRmkrE1rVF" | jq
{
  "Objects": [
    {
      "Hash": "/ipfs/QmQy8FTQCdJGtNHg92pc4B6F4cjnuSdrFx9gdRmkrE1rVF",
      "Links": [
        {
          "Name": "README.md",
          "Hash": "QmWyDJmrr6cRwEpTF2VGhWDi4uytrDHT8S5BptVdkbhjpv",
          "Size": 6060,
          "Type": 2,
          "Target": ""
        }
      ]
    }
  ]
}

Guida contributor