rename namespaces and remove "ipfs" alias for "p2p" (#283)

Previously, we called these foo-ns. Now we just call them foo (the fact
that they're "namespaces" is implicit.

This way, the path component always matches the multicodec name (for
both multiaddr and other path types).
This commit is contained in:
Steven Allen 2022-08-25 00:11:58 -07:00 committed by GitHub
parent 6bca206279
commit 1653be60a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 20 deletions

View File

@ -81,10 +81,10 @@ md4, multihash, 0xd4, draft,
md5, multihash, 0xd5, draft, md5, multihash, 0xd5, draft,
decred-block, ipld, 0xe0, draft, Decred Block decred-block, ipld, 0xe0, draft, Decred Block
decred-tx, ipld, 0xe1, draft, Decred Tx decred-tx, ipld, 0xe1, draft, Decred Tx
ipld-ns, namespace, 0xe2, draft, IPLD path ipld, namespace, 0xe2, draft, IPLD path
ipfs-ns, namespace, 0xe3, draft, IPFS path ipfs, namespace, 0xe3, draft, IPFS path
swarm-ns, namespace, 0xe4, draft, Swarm path swarm, namespace, 0xe4, draft, Swarm path
ipns-ns, namespace, 0xe5, draft, IPNS path ipns, namespace, 0xe5, draft, IPNS path
zeronet, namespace, 0xe6, draft, ZeroNet site address zeronet, namespace, 0xe6, draft, ZeroNet site address
secp256k1-pub, key, 0xe7, draft, Secp256k1 public key (compressed) secp256k1-pub, key, 0xe7, draft, Secp256k1 public key (compressed)
dnslink, namespace, 0xe8, permanent, DNSLink path dnslink, namespace, 0xe8, permanent, DNSLink path
@ -109,7 +109,6 @@ utp, multiaddr, 0x012e, draft,
unix, multiaddr, 0x0190, permanent, unix, multiaddr, 0x0190, permanent,
thread, multiaddr, 0x0196, draft, Textile Thread thread, multiaddr, 0x0196, draft, Textile Thread
p2p, multiaddr, 0x01a5, permanent, libp2p p2p, multiaddr, 0x01a5, permanent, libp2p
ipfs, multiaddr, 0x01a5, draft, libp2p (deprecated)
https, multiaddr, 0x01bb, draft, https, multiaddr, 0x01bb, draft,
onion, multiaddr, 0x01bc, draft, onion, multiaddr, 0x01bc, draft,
onion3, multiaddr, 0x01bd, draft, onion3, multiaddr, 0x01bd, draft,

1 name tag code status description
81 md5 multihash 0xd5 draft
82 decred-block ipld 0xe0 draft Decred Block
83 decred-tx ipld 0xe1 draft Decred Tx
84 ipld-ns ipld namespace 0xe2 draft IPLD path
85 ipfs-ns ipfs namespace 0xe3 draft IPFS path
86 swarm-ns swarm namespace 0xe4 draft Swarm path
87 ipns-ns ipns namespace 0xe5 draft IPNS path
88 zeronet namespace 0xe6 draft ZeroNet site address
89 secp256k1-pub key 0xe7 draft Secp256k1 public key (compressed)
90 dnslink namespace 0xe8 permanent DNSLink path
109 unix multiaddr 0x0190 permanent
110 thread multiaddr 0x0196 draft Textile Thread
111 p2p multiaddr 0x01a5 permanent libp2p
ipfs multiaddr 0x01a5 draft libp2p (deprecated)
112 https multiaddr 0x01bb draft
113 onion multiaddr 0x01bc draft
114 onion3 multiaddr 0x01bd draft

View File

@ -4,20 +4,10 @@ import csv
import sys import sys
import re import re
# We have some duplicates
ALIAS_TABLE = [
{"ipfs", "p2p"},
]
def check(fname='table.csv'): def check(fname='table.csv'):
class CheckError(Exception): class CheckError(Exception):
pass pass
aliases = {}
for nameset in ALIAS_TABLE:
for name in nameset:
aliases[name] = nameset
success = True success = True
with open(fname) as table: with open(fname) as table:
tablereader = csv.reader(table, strict=True, skipinitialspace=False) tablereader = csv.reader(table, strict=True, skipinitialspace=False)
@ -84,11 +74,6 @@ def check(fname='table.csv'):
names[name] = code names[name] = code
if code in codes: if code in codes:
dup = codes[code]
if name in aliases:
if dup in aliases[name]:
# Skip aliased names
continue
raise CheckError( raise CheckError(
f"found duplicate for code {hex(code)} " f"found duplicate for code {hex(code)} "
f"for '{codes[code]}' and '{name}'" f"for '{codes[code]}' and '{name}'"