tableflip / ipld-explorer-cli

🔎 Explore the IPLD directed acyclic graph with your keyboard
MIT License
22 stars 9 forks source link

Support large DAGs #7

Open olizilla opened 6 years ago

olizilla commented 6 years ago

There are CIDs out there that are too large for ipld-explorer to work with

$ ipld-explorer
? > cd zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK
✖ Source is too large

but ipfs dag get works on them, so we could show some info about them

$ ipfs dag get zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK
{"0":{"/":"zdpuAmom34jdkZ8cYWowodaA9Lx7NTKbFkDXaQjhdhDaSCm8L"},"1":{"/":"zdpuB1Eb3qmesCB1pnFf5mgtuy9TXenov8dBHJCK2SdugAsWd"},"10":{"/":"zdpuAriYPSrxsxFFeiJ8egm9Esaica12AQBssX1S3aSmqRkh3"},"100":...
alanshaw commented 6 years ago

More context:

? > cd zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK
  ipld-explorer-cli:repl cd [ 'zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK' ] +0ms
⠋   ipld-explorer-cli:eval cd [ 'zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK' ] +0ms
  ipld-explorer-cli:commands:cd /ipfs/zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK +0ms
  ipld-explorer-cli:lib:ipld get zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK  +17s
  ipfs-api:request POST 127.0.0.1:5001/api/v0/block/get?arg=zdpuAqN6LUsggXfSWDhAzmnLAkWFztsR1w1QhKr7mBp2wfBMK&stream-channels=true 200 OK +17s
  ipld-explorer-cli:print RangeError: Source is too large
  ipld-explorer-cli:print     at Uint8Array.set (<anonymous>)
  ipld-explorer-cli:print     at Decoder._decode (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/borc/src/decoder.js:552:17)
  ipld-explorer-cli:print     at Decoder.decodeFirst (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/borc/src/decoder.js:576:10)
  ipld-explorer-cli:print     at Object.exports.deserialize (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/ipld-dag-cbor/src/util.js:103:28)
  ipld-explorer-cli:print     at waterfall (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/ipld/src/index.js:376:18)
  ipld-explorer-cli:print     at nextTask (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/ipld/node_modules/async/waterfall.js:16:14)
  ipld-explorer-cli:print     at next (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/ipld/node_modules/async/waterfall.js:23:9)
  ipld-explorer-cli:print     at /Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/ipld/node_modules/async/internal/onlyOnce.js:12:16
  ipld-explorer-cli:print     at streamToValue (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/ipfs-api/src/block/get.js:49:11)
  ipld-explorer-cli:print     at concat (/Users/alan/Code/protocol-labs/ipld-explorer-cli/node_modules/ipfs-api/src/utils/stream-to-value.js:12:22) +0ms
✖ RangeError: Source is too large