Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

feat(dag): basics (put, get) #520

Closed
wants to merge 2 commits into from
Closed

feat(dag): basics (put, get) #520

wants to merge 2 commits into from

Conversation

daviddias
Copy link
Contributor

@daviddias daviddias commented Feb 1, 2017

Started implementing ipfs-inactive/interface-js-ipfs-core#112 on js-ipfs-api, but there are somethings missing, from ipfs dag cli we have:

» ipfs dag put --help
USAGE
  ipfs dag put <object data> - Add a dag node to ipfs.

SYNOPSIS
  ipfs dag put [--format=<format> | -f] [--input-enc=<input-enc>] [--] <object data>

ARGUMENTS

  <object data> - The object to put

OPTIONS

  -f,        --format string - Format that the object will be added as. Default: cbor.
  --input-enc         string - Format that the input object will be. Default: json.

DESCRIPTION

  'ipfs dag put' accepts input from a file or stdin and parses it
  into an object of the specified format.

It would be great if we could use the multicodec names for the format flag, namely:

  • dag-cbor
  • dag-pb
  • eth-block
  • and so on

It will solve a lot of ambiguity. Can we get that @whyrusleeping ?

Another thing, it has no option to pick the hash algorithm to use.

Last note, the --input-enc defaults to json, but if we can use the multicodec of the type, we could send them serialized directly.

@daviddias
Copy link
Contributor Author

Just realized now that already had started implemented this here and found the same blockers that I have here: #534

Closing in favour of #534

@daviddias daviddias closed this Mar 15, 2017
@daviddias daviddias deleted the feat/dag-api-basics branch March 15, 2017 15:25
@daviddias daviddias removed the ready label Mar 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants