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 Raw Block Commands #138

Closed
whyrusleeping opened this issue Oct 3, 2014 · 10 comments
Closed

Ipfs Raw Block Commands #138

whyrusleeping opened this issue Oct 3, 2014 · 10 comments
Labels
help wanted Seeking public contribution on this issue topic/commands Topic commands

Comments

@whyrusleeping
Copy link
Member

It would be nice if we had some commands to interface directly with the raw DHT data. something like:

ipfs get <somehash>

And have it return the raw data from doing a database or bitswap query for that block.
In the same vein of thinking, I would also like to make ipfs add be able to accept input data from standard in so we could do something like: echo 'hello world' | ipfs add and have it create an object for that.
@jbenet What do you think as far as semantics?

@llSourcell
Copy link
Contributor

I'll do it post-@jbenet input

@jbenet
Copy link
Member

jbenet commented Oct 13, 2014

I think a few plumbing tools are emerging:

# interact with the routing system (via its interface)
ipfs routing [get, put, putprovider, getprovider, findpeer]

# show/edit the dht state
ipfs dht [table, diagnostic, providers, ... ]

# interact with bitswap
ipfs bitswap [strategy, ... ]

# get/put **raw** ipfs blocks (possibly encrypted, protobuf serialized)
ipfs block get <key> > valfile
ipfs block put < valfile

# interact with ipfs objects (almost porcelain)
ipfs object data <key> > datafile  (plumbing behind ipfs cat)
ipfs object links <key> > linksfile  (plumbing behind ipfs ls)
ipfs object get <key> > objfile  (probably protobuf serialized? or ....)
ipfs object get --format=json <key> > objfile
ipfs object put --format=json < objfile

# interact with local keys / keychain
ipfs key gen <name>            # make a key(pair) named <name>
ipfs key add <name> <keyfile>  # add a key(pair) named
ipfs key rm <name>
ipfs key show <name>

(Updated to remove <key> in put cmds).

@jbenet
Copy link
Member

jbenet commented Oct 13, 2014

sorted from easiest to hardest:

block < object < dht < routing < bitswap < key

@whyrusleeping
Copy link
Member Author

+:100: :+1:

@jbenet jbenet added the help wanted Seeking public contribution on this issue label Oct 13, 2014
@jbenet
Copy link
Member

jbenet commented Oct 13, 2014

we should turn all these commands into their own issue. (i can get to that later today)

@jbenet
Copy link
Member

jbenet commented Oct 23, 2014

cmds:

@jbenet
Copy link
Member

jbenet commented Jan 8, 2015

Still need ipfs {bitswap, dht}

@whyrusleeping
Copy link
Member Author

what subcommands do we want under bitswap and dht?
current thoughts:
bitswap wantlist {list|add|remove}
dht ping (alias from ipfs ping)
dht {get | put | provide | findproviders}

@jbenet
Copy link
Member

jbenet commented Jan 8, 2015

Rename ipfs dht --> ipfs routing:

# routing table
ipfs routing table - prints the routing table
ipfs routing table add <ipfs-addr> - adds <ipfs-addr> to the routing table
ipfs routing table rm [--all] <ipfs-addr> - removes <ipfs-addr> from the routing table
# if the routing system does not have a routing table, return an error

# actual routing operations!
ipfs routing value get [--local, --all] <key> -- returns value for <key>
ipfs routing value put [--local] <key> -- puts stdin as a value for <key>.
ipfs routing value rm [--all] <key> -- remove local value for <key>.
ipfs routing provider get [--local, --all] <key> -- returns providers for <key>
ipfs routing provider add [--local] <key> <ipfs-addr> -- adds provider for <key>
ipfs routing peer [--local, --all] <peer.ID> -- returns <ipfs-addrs> for peer with <peer.ID>
# all of these support options:
# --local - return only local results
# --all - returns all local values (implies --local, and does not need <key>)

ipfs routing commands must be careful to return errors if the node (a) does not have a routing system, (b) has a routing system without a routing table.

@jbenet
Copy link
Member

jbenet commented Jan 8, 2015

# general exchange, should work even if bitswap doesnt.
# this is different from ipfs-block in that it may allow us to force --remote operation
# so we can test protocols. -- say, both of these have: 
ipfs exchange get [--local, --remote] <key> [<ipfs-addr>...] returns contents of <key>
ipfs exchange add [--local, --remote] [<ipfs-addr>...] -- adds contents of stdin.
# if `<ipfs-addr>...` are specified, use only peers at those addresses.

# bitswap specific
ipfs bitswap peers [--all, --inactive] -- print IDs of peers 
ipfs bitswap ledger [--all, --inactive] <key> -- print ledger contents
# --inactive prints peers we have ledgers for, but not currently connected
# --all print all entries, active and inactive (and implies no <key> needed)

ipfs bitswap strategy -- print information on the current strategy used
ipfs bitswap stat -- print statistic on bitswap traffic

@jbenet jbenet added the topic/commands Topic commands label Mar 28, 2015
@jbenet jbenet closed this as completed Mar 28, 2015
Kubuxu added a commit that referenced this issue Jun 14, 2019
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
@aschmahmann aschmahmann mentioned this issue Feb 18, 2021
73 tasks
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Feb 25, 2022
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Mar 4, 2022
laurentsenta pushed a commit to laurentsenta/kubo that referenced this issue Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue topic/commands Topic commands
Projects
None yet
Development

No branches or pull requests

3 participants