Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't retrieve raw nodes using the dag cli/http api #6076

Closed
achingbrain opened this issue Mar 13, 2019 · 1 comment · Fixed by ipfs/go-merkledag#36
Closed

Can't retrieve raw nodes using the dag cli/http api #6076

achingbrain opened this issue Mar 13, 2019 · 1 comment · Fixed by ipfs/go-merkledag#36
Assignees

Comments

@achingbrain
Copy link
Member

achingbrain commented Mar 13, 2019

I can add and fetch a CBOR node via the CLI:

$ echo -e "\xa1\x63\x66\x6f\x6f\x63\x62\x61\x72" | ipfs block put --format=cbor
zdpuAspUFE9aaNm5FQB5T3jXig5xDuzRPYGqswYPrZbJHbCqz
$ ipfs dag get zdpuAspUFE9aaNm5FQB5T3jXig5xDuzRPYGqswYPrZbJHbCqz
{"foo":"bar"}

But if I add the same data as a raw node I can't get the data back:

$ echo -e "\xa1\x63\x66\x6f\x6f\x63\x62\x61\x72" | ipfs block put --format=raw
zb2rhe3JxU16E17kG3GSnUW5paVwzNrnpFwLCiQPRbeediA8t
$ ipfs dag get zb2rhe3JxU16E17kG3GSnUW5paVwzNrnpFwLCiQPRbeediA8t
{"Block":{}}

Since it's a raw node I would have expected to to just blurt out the raw data and (potentially) make my console go all weird in the same way as the block api:

$ ipfs block get zb2rhe3JxU16E17kG3GSnUW5paVwzNrnpFwLCiQPRbeediA8t
?cfoocbar

Is this intentional?

Version information:

$ ipfs version --all
go-ipfs version: 0.4.19-dev-481136b
Repo version: 7
System version: amd64/darwin
Golang version: go1.11.2
@achingbrain achingbrain changed the title Can't retrieve raw nodes Can't retrieve raw nodes using the dag cli/http api Mar 13, 2019
Stebalien added a commit to ipfs/go-merkledag that referenced this issue Mar 13, 2019
@ghost ghost assigned Stebalien Mar 13, 2019
@ghost ghost added the status/in-progress In progress label Mar 13, 2019
@Stebalien
Copy link
Member

Stebalien commented Mar 13, 2019

No, this is because our current IPLD implementation doesn't currently have a nice way to translate between node types. Quick fix: ipfs/go-merkledag#36. Longer term fix requires https://github.com/ipld/go-ipld-prime.

Stebalien added a commit to ipfs/go-merkledag that referenced this issue Mar 13, 2019
@ghost ghost removed the status/in-progress In progress label Mar 13, 2019
Jorropo pushed a commit to ipfs/boxo that referenced this issue Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants