ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.04k stars 3k forks source link

Aliases #526

Open whyrusleeping opened 9 years ago

whyrusleeping commented 9 years ago

Im just filing an issue for this so I dont forget it, by no means is this issue a priority one. It would be nice to be able to specify aliases for both commands, and peer IDs.

i.e. ipfs routing ping -> ipfs ping

or for peer IDs

ipfs ping mars instead of ipfs ping QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ

daviddias commented 8 years ago

We can have a aliases repo on IPFS Repo or just use the config file for it.

hackergrrl commented 8 years ago

@whyrusleeping brought this up in IRC. Here's a excerpt from the logs:

whyrusleeping
thoughts on a good escape character for hash aliases?
like 'ipfs ping @mars'
or something

noffle
whyrusleeping: why not just "mars"? my understanding is that it's a pre-processing step, not real name resolution, so you could just be able to alias any string to any other string arbitrarily
much like how I can alias any string to any string in bash

whyrusleeping
right, but how will the cli know what is an alias and whats not?
if i do 'alias mars=Qmasdasd'
and then another hash contains mars somewhere down the road
or someone has a file named mars

noffle
having a sigil in front doesn't save you from that: I could have a file named @mars
it can always be ambigious

whyrusleeping
using the bash example:
to specify the file you would use \@mars

noffle
hm, maybe bash is a bad comparison, since you want to alias parameters, not a command
I can't think of an existing analog to this
what if they were just another multiaddress? like /alias/mars?

whyrusleeping
yeah... environment variables are what i'm looking at

noffle
why not just use env vars, anyways? what properties do they lack?

whyrusleeping
i'm looking for a tighter integration into ipfs
i want to be able to ship some default aliases, for the bootstrap nodes
i want logs to be able to use aliases to print

lgierth
do it with ipns
/ipns/mars.alias

whyrusleeping
lol, is .alias a tld?

lgierth
that's how we wanna integrate namecoin to isn't it?
oh no idea
/ipns/alias/mars?

noffle
it'd be nice if the solution was multiaddress-based, rather than a brand new shim layer on top
yeah

lgierth
and /ipns/alias would just be an object pointing to all the aliased objects
all-local

noffle
lgierth: like running the 'alias' command in bash
or just /alias/mars -- ipns seems like the wrong namespace?

lgierth
yeah maybe

noffle
is the /ipns namespace inherently tied to e.g. dht-based pki name resolution?

lgierth
no, it also e.g. resolves icann dns
and we want it to resolve .bit too (namecoin)
it's generally meant to map names to hashes
i.e. names to /ipfs/ paths

noffle
hm. aliases would be purely local, so either a new namespace (like /alias) might work, or heck, just have a /ipns/<your pubkey>/alias file
it should be namespaced to its 'owner' whatever that means