Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit aa54bc9

Browse files
lidelvyzo
authored andcommitted
refactor: remove proquint.go
See discussion in: #13 (review)
1 parent 2ae3bae commit aa54bc9

File tree

5 files changed

+7
-50
lines changed

5 files changed

+7
-50
lines changed

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

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module github.com/ipfs/go-namesys
22

33
require (
4-
github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d
54
github.com/gogo/protobuf v1.3.2
65
github.com/hashicorp/golang-lru v0.5.4
76
github.com/ipfs/go-cid v0.0.7

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
88
github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s=
99
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
1010
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
11-
github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d h1:QgeLLoPD3kRVmeu/1al9iIpIANMi9O1zXFm8BnYGCJg=
12-
github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d/go.mod h1:Jbj8eKecMNwf0KFI75skSUZqMB4UCRcndUScVBTWyUI=
1311
github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
1412
github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
1513
github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=

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)

proquint.go

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

0 commit comments

Comments
 (0)