Skip to content

Commit b5662a5

Browse files
lidelvyzo
authored andcommitted
refactor: remove proquint.go
See discussion in: ipfs/go-namesys#13 (review) This commit was moved from ipfs/go-namesys@aa54bc9
1 parent 6f288d9 commit b5662a5

File tree

3 files changed

+7
-47
lines changed

3 files changed

+7
-47
lines changed

namesys/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
1111
Package namesys defines `Resolver` and `Publisher` interfaces for IPNS paths, that is, paths in the form of `/ipns/<name_to_be_resolved>`. A "resolved" IPNS path becomes an `/ipfs/<cid>` path.
1212

13-
Traditionally, these paths would be in the form of `/ipns/peer_id`, which references an IPNS record in a distributed `ValueStore` (usually the IPFS DHT).
13+
Traditionally, these paths would be in the form of `/ipns/{libp2p-key}`, which references an IPNS record in a distributed `ValueStore` (usually the IPFS DHT).
1414

15-
Additionally, the /ipns/ namespace can also be used with domain names that use DNSLink (/ipns/my.domain.example, see https://dnslink.io) and proquint strings.
15+
Additionally, the `/ipns/` namespace can also be used with domain names that use DNSLink (`/ipns/en.wikipedia-on-ipfs.org`, see https://docs.ipfs.io/concepts/dnslink/).
1616

1717
The package provides implementations for all three resolvers.
1818

namesys/namesys.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
//
99
// Additionally, the /ipns/ namespace can also be used with domain names that
1010
// use DNSLink (/ipns/<dnslink_name>, https://docs.ipfs.io/concepts/dnslink/)
11-
// and proquint strings.
1211
//
1312
// The package provides implementations for all three resolvers.
1413
package namesys
@@ -38,15 +37,14 @@ import (
3837
// Uses several Resolvers:
3938
// (a) IPFS routing naming: SFS-like PKI names.
4039
// (b) dns domains: resolves using links in DNS TXT records
41-
// (c) proquints: interprets string as the raw byte data.
4240
//
4341
// It can only publish to: (a) IPFS routing naming.
4442
//
4543
type mpns struct {
4644
ds ds.Datastore
4745

48-
dnsResolver, proquintResolver, ipnsResolver resolver
49-
ipnsPublisher Publisher
46+
dnsResolver, ipnsResolver resolver
47+
ipnsPublisher Publisher
5048

5149
staticMap map[string]path.Path
5250
cache *lru.Cache
@@ -125,7 +123,6 @@ func NewNameSystem(r routing.ValueStore, opts ...Option) (NameSystem, error) {
125123
ns.dnsResolver = NewDNSResolver(madns.DefaultResolver.LookupTXT)
126124
}
127125

128-
ns.proquintResolver = new(ProquintResolver)
129126
ns.ipnsResolver = NewIpnsResolver(r)
130127
ns.ipnsPublisher = NewIpnsPublisher(r, ns.ds)
131128

@@ -188,7 +185,6 @@ func (ns *mpns) resolveOnceAsync(ctx context.Context, name string, options opts.
188185
// Resolver selection:
189186
// 1. if it is a PeerID/CID/multihash resolve through "ipns".
190187
// 2. if it is a domain name, resolve through "dns"
191-
// 3. otherwise resolve through the "proquint" resolver
192188

193189
var res resolver
194190
ipnsKey, err := peer.Decode(key)
@@ -228,11 +224,9 @@ func (ns *mpns) resolveOnceAsync(ctx context.Context, name string, options opts.
228224
} else if _, ok := dns.IsDomainName(key); ok {
229225
res = ns.dnsResolver
230226
} else {
231-
// TODO: remove proquint?
232-
// dns.IsDomainName(key) will return true for proquint strings,
233-
// so this block is a dead code.
234-
// (alternative is to move this before DNS check)
235-
res = ns.proquintResolver
227+
out <- onceResult{err: fmt.Errorf("invalid IPNS root: %q", key)}
228+
close(out)
229+
return out
236230
}
237231

238232
resCh := res.resolveOnceAsync(ctx, key, options)

namesys/proquint.go

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)