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

Ipns name resolution #45

Merged
merged 111 commits into from
Oct 9, 2014
Merged

Ipns name resolution #45

merged 111 commits into from
Oct 9, 2014

Conversation

whyrusleeping
Copy link
Member

This branch is not yet complete, but before i move forward, the name resolution code (in namesys) needs some critiquing. There are also a decent number of bugfixes in this branch that i ran into while trying to get the code to a point where i could test ipns.

@whyrusleeping whyrusleeping added the status/in-progress In progress label Sep 12, 2014
@whyrusleeping whyrusleeping self-assigned this Sep 12, 2014
@whyrusleeping whyrusleeping added codereview and removed status/in-progress In progress labels Sep 13, 2014
@@ -58,6 +60,7 @@ func ipfsCmd(c *commander.Command, args []string) error {

func main() {
u.Debug = true
runtime.GOMAXPROCS(2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why limiting concurrency?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i beleive it actually defaults to one, i was bumping it to two just for my own sanity. (let me know if im wrong)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num := runtime.NumCPU()
    runtime.GOMAXPROCS(num)

Re: GOMAXPROCS

This call will go away when the scheduler improves.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and setting GOMAXPROCS to your number of CPU's is rarely a good idea (if you dont beleive me, go on #go-nuts and ask, lol). We should first determine a way to measure performance, and see how it changes across different numbers of procs.

whyrusleeping added a commit that referenced this pull request Sep 15, 2014

var ErrCouldntResolve = errors.New("could not resolve name.")

type MasterResolver struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may want to make this struct private to prevent it from being instantiated without its handlers being initialized

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@jbenet
Copy link
Member

jbenet commented Sep 22, 2014

@whyrusleeping want to rebase on top of new master and then merge it in? What else is left?

@whyrusleeping
Copy link
Member Author

At this point it works. (as far as individual name resolution goes) I still need to test it in the grande scheme of things (i.e. requesting /ipns/jero.my or /ipns/base58hash)

@jbenet
Copy link
Member

jbenet commented Oct 9, 2014

@whyrusleeping I'm going to:

@jbenet
Copy link
Member

jbenet commented Oct 9, 2014

Btw: i noticed that you're merging sometimes when we're both working on same branch. pro-tip: rebase pull.

# rebase pull
git pull --rebase

# setup branch to always rebase
git config branch.master.rebase true

# setup all future branches to rebase
git config branch.autosetuprebase always
git config --global branch.autosetuprebase always

http://gitready.com/advanced/2009/02/11/pull-with-rebase.html

- cleaned up cmd help
- ipfs name publish [<name>] <ref>
- ipfs name resolve [<name>]
- publish validates <ref>
- both validate n args
Conflicts:
	cmd/ipfs/ipfs.go
jbenet added a commit that referenced this pull request Oct 9, 2014
@jbenet jbenet merged commit c6ffaa4 into master Oct 9, 2014
@jbenet jbenet removed the status/in-progress In progress label Oct 9, 2014
@jbenet jbenet deleted the ipns branch October 9, 2014 11:05
@jbenet
Copy link
Member

jbenet commented Oct 9, 2014

 .gitignore                                         |   1 +
 .travis.yml                                        |   2 +
 Godeps/Godeps.json                                 |  14 +-
 .../src/github.com/bren2010/proquint/README.md     |   6 +
 .../src/github.com/bren2010/proquint/proquint.go   | 123 ++++
 .../jbenet/datastore.go/Godeps/Godeps.json         |  43 ++
 .../github.com/jbenet/datastore.go/Godeps/Readme   |   5 +
 .../src/github.com/jbenet/datastore.go/basic_ds.go |  65 +-
 .../jbenet/datastore.go/basic_ds_test.go           |  13 +
 .../github.com/jbenet/datastore.go/datastore.go    |  16 +-
 .../src/github.com/jbenet/datastore.go/fs/fs.go    | 122 ++++
 .../github.com/jbenet/datastore.go/fs/fs_test.go   |  65 ++
 .../src/github.com/jbenet/datastore.go/io/io.go    |  44 ++
 .../src/github.com/jbenet/datastore.go/key_test.go |   5 +-
 .../datastore.go/keytransform/keytransform.go      |  88 +++
 .../datastore.go/keytransform/keytransform_test.go |  60 ++
 .../jbenet/datastore.go/leveldb/datastore.go       |   4 +-
 .../jbenet/datastore.go/lru/datastore.go           |  54 ++
 .../jbenet/datastore.go/lru/datastore_test.go      |  52 ++
 .../src/github.com/jbenet/datastore.go/query.go    |  19 +
 .../github.com/jbenet/datastore.go/sync/sync.go    |  64 ++
 .../src/github.com/jbenet/go-is-domain/LICENSE     |  21 +
 .../src/github.com/jbenet/go-is-domain/README.md   |  23 +
 .../src/github.com/jbenet/go-is-domain/doc.go      |  13 +
 .../src/github.com/jbenet/go-is-domain/domainre.go |  12 +
 .../github.com/jbenet/go-is-domain/is_domain.go    |  44 ++
 .../jbenet/go-is-domain/is_domain_test.go          |  29 +
 .../jbenet/go-is-domain/tlds-alpha-by-domain.txt   | 727 ++++++++++++++++++++
 .../src/github.com/jbenet/go-is-domain/tlds.go     | 737 +++++++++++++++++++++
 .../src/github.com/jbenet/go-multiaddr/LICENSE     |  21 +
 .../src/github.com/jbenet/go-multiaddr/README.md   |  38 +-
 .../src/github.com/jbenet/go-multiaddr/doc.go      |  36 +
 .../src/github.com/jbenet/go-multiaddr/index.go    | 117 ----
 .../github.com/jbenet/go-multiaddr/interface.go    |  42 ++
 .../github.com/jbenet/go-multiaddr/multiaddr.go    | 110 +++
 .../jbenet/go-multiaddr/multiaddr_test.go          |  46 +-
 .../src/github.com/jbenet/go-multiaddr/net.go      |  40 +-
 .../src/github.com/jbenet/go-multiaddr/net_test.go |  32 +-
 blocks/blocks.go                                   |   8 +-
 blocks/blocks_test.go                              |  15 +-
 blockservice/blocks_test.go                        |  14 +-
 blockservice/blockservice.go                       |  20 +-
 blockstore/blockstore.go                           |  14 +-
 blockstore/blockstore_test.go                      |   8 +-
 cmd/ipfs/add.go                                    |   7 +-
 cmd/ipfs/bootstrap.go                              |   5 +-
 cmd/ipfs/cat.go                                    |  36 +-
 cmd/ipfs/gen.go                                    |  50 +-
 cmd/ipfs/init.go                                   |   6 +
 cmd/ipfs/ipfs.go                                   |  93 ++-
 cmd/ipfs/ls.go                                     |   7 +-
 cmd/ipfs/mount_unix.go                             |  82 ++-
 cmd/ipfs/name.go                                   |  57 ++
 cmd/ipfs/pin.go                                    |  31 +
 cmd/ipfs/publish.go                                |  41 ++
 cmd/ipfs/refs.go                                   |   7 +-
 cmd/ipfs/resolve.go                                |  42 ++
 cmd/ipfs/run.go                                    |  36 +
 cmd/ipfs/serve.go                                  |  42 +-
 config/config.go                                   |  20 +-
 core/commands/add.go                               |  32 +-
 core/commands/cat.go                               |   4 +-
 core/commands/commands.go                          |   3 +
 core/commands/pin.go                               |  17 +-
 core/commands/publish.go                           |  53 ++
 core/commands/resolve.go                           |  35 +
 core/core.go                                       |  22 +-
 core/datastore.go                                  |  21 +-
 core/mock.go                                       |  52 ++
 crypto/key.go                                      |  37 +-
 crypto/key_test.go                                 |   4 +
 crypto/rsa.go                                      |   8 +
 crypto/spipe/handshake.go                          |  37 +-
 crypto/spipe/pipe.go                               |   1 -
 daemon/daemon.go                                   |  13 +-
 daemon/daemon_client.go                            |   5 +-
 exchange/bitswap/bitswap.go                        |  12 +-
 exchange/bitswap/bitswap_test.go                   |  52 +-
 exchange/bitswap/message/message.go                |  14 +-
 exchange/bitswap/message/message_test.go           |  19 +-
 .../bitswap/notifications/notifications_test.go    |  10 +-
 exchange/bitswap/strategy/strategy_test.go         |   6 +-
 exchange/bitswap/testnet/network_test.go           |  10 +-
 exchange/offline/offline_test.go                   |   6 +-
 fuse/ipns/ipns_test.go                             | 337 ++++++++++
 fuse/ipns/ipns_unix.go                             | 568 ++++++++++++++++
 fuse/ipns/link_unix.go                             |  24 +
 fuse/ipns/mount_unix.go                            |  91 +++
 fuse/ipns/repub_unix.go                            |  42 ++
 fuse/ipns/writerat.go                              |  29 +
 fuse/readonly/readonly_unix.go                     |  52 +-
 importer/{ => chunk}/rabin.go                      |  42 +-
 importer/{ => chunk}/splitting.go                  |  12 +-
 importer/importer.go                               |  22 +-
 importer/importer_test.go                          |  26 +-
 merkledag/Makefile                                 |   5 +-
 merkledag/coding.go                                |   3 +
 merkledag/merkledag.go                             | 129 ++--
 merkledag/merkledag_test.go                        |   3 +-
 namesys/dns.go                                     |  48 ++
 namesys/entry.pb.go                                |  48 ++
 namesys/entry.proto                                |   6 +
 namesys/interface.go                               |  43 ++
 namesys/namesys.go                                 |  57 ++
 namesys/proquint.go                                |  24 +
 namesys/publisher.go                               |  78 +++
 namesys/resolve_test.go                            |  53 ++
 namesys/routing.go                                 |  85 +++
 net/conn/conn.go                                   |   8 +-
 net/service/service.go                             |   2 +-
 net/swarm/conn.go                                  |  16 +-
 net/swarm/swarm.go                                 |   2 +-
 net/swarm/swarm_test.go                            |   2 +-
 path/path.go                                       |  20 +-
 peer/peer.go                                       |  23 +-
 peer/peerstore.go                                  |   8 +-
 peer/queue/queue_test.go                           |   2 +-
 routing/dht/Message.go                             |   6 +-
 routing/dht/dht.go                                 |  57 +-
 routing/dht/dht_test.go                            |   8 +-
 routing/dht/ext_test.go                            |   2 +-
 routing/dht/handlers.go                            |  37 +-
 routing/dht/query.go                               |  24 +-
 routing/dht/routing.go                             |  39 +-
 routing/kbucket/table.go                           |   4 +
 routing/kbucket/table_test.go                      |   4 +-
 routing/keyspace/xor_test.go                       |   4 +-
 routing/mock/routing.go                            |   4 +-
 server/http/http.go                                |   4 +-
 server/http/ipfs.go                                |   3 +-
 unixfs/Makefile                                    |   5 +
 {merkledag => unixfs}/data.pb.go                   |  24 +-
 {merkledag => unixfs}/data.proto                   |   4 +-
 unixfs/format.go                                   | 119 ++++
 unixfs/format_test.go                              |  36 +
 unixfs/io/dagmodifier.go                           | 192 ++++++
 unixfs/io/dagmodifier_test.go                      | 200 ++++++
 {merkledag => unixfs/io}/dagreader.go              |  46 +-
 unixfs/io/dagwriter.go                             | 107 +++
 unixfs/io/dagwriter_test.go                        | 127 ++++
 util/testutil/blocks.go                            |  22 -
 util/util.go                                       | 172 ++++-
 util/util_test.go                                  |  35 +-
 143 files changed, 6407 insertions(+), 855 deletions(-)

@jbenet
Copy link
Member

jbenet commented Oct 9, 2014

@whyrusleeping
Copy link
Member Author

image

ribasushi pushed a commit that referenced this pull request Jul 4, 2021
laurentsenta pushed a commit to laurentsenta/kubo that referenced this pull request Feb 25, 2022
make it easier to detect an uninitialized repo
laurentsenta pushed a commit to laurentsenta/kubo that referenced this pull request Feb 25, 2022
make it easier to detect an uninitialized repo
laurentsenta pushed a commit to laurentsenta/kubo that referenced this pull request Mar 4, 2022
make it easier to detect an uninitialized repo
laurentsenta pushed a commit to laurentsenta/kubo that referenced this pull request Mar 4, 2022
make it easier to detect an uninitialized repo
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this pull request Apr 7, 2022
fix: slightly reduce memory usage when walking large directory trees
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants