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

Ipfs dht put is not working #6749

Closed
pontiyaraja opened this issue Nov 5, 2019 · 2 comments · Fixed by #6750
Closed

Ipfs dht put is not working #6749

pontiyaraja opened this issue Nov 5, 2019 · 2 comments · Fixed by #6750
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@pontiyaraja
Copy link

Version information:

ipfs version --all

Description:

Ipfs dht put failed to add a key.

I used below commands :

`ipfs dht get /ipns/QmZYNu1popeREco3ccYEgLt8UbcE4wi2LbNrKMP7jGtut1 -v

returns :

17:16:36.437: adding peer to query: QmQCyd1C3YRjWHt3Ri2MDM4yirFHPyMqA3nFS6MYDMCkP2
17:16:36.437: adding peer to query: QmZGWUgMzPAX343ARkjEyeyGNeiAgqtU3bdeqKThr4Zk8g
17:16:36.437: * querying QmQCyd1C3YRjWHt3Ri2MDM4yirFHPyMqA3nFS6MYDMCkP2
17:16:36.437: * querying QmZGWUgMzPAX343ARkjEyeyGNeiAgqtU3bdeqKThr4Zk8g
17:16:36.457: * QmQCyd1C3YRjWHt3Ri2MDM4yirFHPyMqA3nFS6MYDMCkP2 says use QmZGWUgMzPAX343ARkjEyeyGNeiAgqtU3bdeqKThr4Zk8g
17:16:36.686: * QmZGWUgMzPAX343ARkjEyeyGNeiAgqtU3bdeqKThr4Zk8g says use QmQCyd1C3YRjWHt3Ri2MDM4yirFHPyMqA3nFS6MYDMCkP2
17:16:36.687: got value: 'CjQvaXBmcy9RbVJZa2s0dHNWNk11cVZDb2pCNGRmZ2ZzMVp3N01XNm1GN0MzVzZDWHN6NGpBEoACnm0pP0GZ8eb2CqCTCU4AthhG5MdzDhRFZGCp2MFsu/WjbHt12QrHcld55HrU7cWcDQXhKvsPx3OnUx2EH7YbzPaP9cDKfa3Jx4KN1qaS+o1OAfWrmJbj9js91EWbHoznDSw28jJXy86hktam4y3anvf7wG80eE4JqtPsszc1Hq06D6DRlnpnWtXGjFgQupjGTQQo/tcCwlJ9xl+6z2UslTOZfSuFfuYYT+tfEeglvqYrxdizAaRaEMRMdEMUFlERtg+xheq28OIKAFu8e20dvmdrsXHZI8BxXp7zP3ARNLEik+1zQPNhgiaRA4JO2SkVYW76MC16fg9g5OfUWM/RjBgAIhsyMDE5LTExLTA2VDExOjE2OjI1LjU5OTQzNlooADqrAggAEqYCMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv0tkCxWzDZnruykBk6wLQsytueEcob3FQx5VlXN2e4/+1uiJZRh2keEi+HFqPXSvRfZjlUN8CDQK5n6rlVBjXf6KDUEqOmQ8u/hIW2r5H7SxPxoebgSY082At5lxuBYF4mDm5uRyKl9Hq86UuCuckhJbRLexOJ8IkJ0yEOcPZU9u0lgMZ9Z8pR4Uc86enz0vbl5Nhxk64ChRuOo/tQICz0QugHAxy6YAsFWQm9iBdz8CACWld4AOxflJkxdeq7LTs5qIbvyOm9r6VBVV9N8EqhV4le4OQdeX2hOOx9W+/OuVhrx6uXxvWxG7psSq6O0p+qkVAqgRKGSo0gsx6drWdwIDAQAB'
`

`And I try to put a key by

curl "http://localhost:5001/api/v0/dht/put?arg=/ipns/QmZYNu1popeREco3ccYEgLt8UbcE4wi2LbNrKMP7jGtut1&arg=label:"hello"type:17reps:1reps:2reps:3&verbose=true"

Getting error response :

{"Extra":"record could not be unmarshalled","ID":"","Responses":null,"Type":3}
`

I followed the instructions from the Ipfs dot doc https://docs.ipfs.io/reference/api/cli/#ipfs-dht.

I published my key by using ipfs name publish and try to put the key and value in dht table. its not working.

note : dht is in experimental feature of ipfs.

#5967
#5519

@pontiyaraja pontiyaraja added the kind/bug A bug in existing code (including security flaws) label Nov 5, 2019
@pontiyaraja
Copy link
Author

@Stebalien

@Stebalien
Copy link
Member

You probably don't want to use this API.

  1. The value needs to be a valid, signed IPNS record protobuf (e.g., something returned by ipfs dht get).
  2. ipfs dht put doesn't actually work due to dht put doesn't interact well with binary data #5112.

I've improved the documentation and fixed the second bug in #6750 but that PR needs tests.

pontiyaraja pushed a commit to pontiyaraja/go-ipfs that referenced this issue Dec 27, 2019
ralendor pushed a commit to ralendor/go-ipfs that referenced this issue Jun 6, 2020
ralendor pushed a commit to ralendor/go-ipfs that referenced this issue Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants