Commit Graph

108 Commits

Author SHA1 Message Date
Juan Batiz-Benet
f47b4f1799 Merge pull request #255 from jbenet/id-cmd
basic ID cmd
2014-11-17 23:23:06 -08:00
Juan Batiz-Benet
d93e49e06e fix node context (tests pass) 2014-11-17 22:50:01 -08:00
Brian Tiger Chow
24f0fa0fde delegate teardown
this is silly but whatever

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:19 -08:00
Brian Tiger Chow
ef65bb1ce3 revert to debug error
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
2bbfe4d56f debug(core, datastore, daemon) wrap errors
@jbenet @whyrusleeping @mappum

very helpful for tracking down errors. the stack traces are only
shown when debug mode is visible. They function best when caught at the
source.

I propose we use this errors package as a drop-in replacement for
fmt.Errorf and errors.New in all of our code, and use errors.Wrap for
external errors as they emerge from others' libraries.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
bacf3ecc6a feat(util) add datastore Closer Wrapper
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:17 -08:00
Brian Tiger Chow
f26388e0e5 fix(core) tear-down leveldb
@jbenet @whyrusleeping @mappum

If we permit initialization in `ipfs daemon`, then we must ensure that
the node instantiated in `ipfs init` (to create the welcome file) shuts
down and releases resources.

Kept running into "resource temporarily unavailable". Discovered that it
was our cousins Jeff and Sanjay over at LevelDB Ave.

go-datastore doesn't expose Close() so I extended the TsDs interface and
submitted a patch.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 00:44:18 -08:00
Jeromy
9f4127aefa fix variable naming 2014-11-16 17:12:35 -08:00
Jeromy
0de12b5d36 implement ipfs id in the new commands library 2014-11-16 16:46:06 -08:00
Brian Tiger Chow
a11c59dcac feat(peer) add Type (Unspecified, Local, Remote) 2014-11-16 07:00:58 -08:00
Brian Tiger Chow
05346dd927 misc(core/identity) more specific function argument
to aid in testing
2014-11-16 07:00:28 -08:00
Brian Tiger Chow
1ed0850ce2 style(core) peer -> self 2014-11-16 07:00:28 -08:00
Jeromy
f45d575a96 address comments from PR 2014-11-16 02:45:20 -08:00
Jeromy
f21ec1923a verify ipns records 2014-11-16 02:45:19 -08:00
Juan Batiz-Benet
99f2378bac mount: fixed mount init + teardown
This commit adds a Mount abstraction (which is really just
a wrapped context closer). It makes sure to bind the mount
to the fate of the Node (i.e. close it if the node ends).
This fixes #350
2014-11-16 01:42:42 -08:00
Brian Tiger Chow
0b42d77e13 refactor(core, bitswap) split bitswap init into two steps
@jbenet
2014-11-15 02:10:53 -08:00
Brian Tiger Chow
6d89094d41 rename -> OnlineMode()
because this method doesn't check actual network status
2014-11-14 03:17:29 -08:00
Brian Tiger Chow
772f657fcd add online method to node 2014-11-14 03:17:29 -08:00
Juan Batiz-Benet
0135e3ebbe swarm + net: add explicit listen addresses 2014-11-05 04:00:49 -08:00
Juan Batiz-Benet
f0d823c2db fix tests (circular import) 2014-10-30 01:17:26 -07:00
Brian Tiger Chow
79866d3378 hotfix(core) assign node.Resolver = path.Resolver
discovered by @mappum and applied at 414e20b71e

fixing here to address #233

https://github.com/jbenet/go-ipfs/issues/233
2014-10-29 06:58:35 -07:00
Juan Batiz-Benet
d79ebe68d2 dht ctxcloserify 2014-10-25 21:33:59 -07:00
Juan Batiz-Benet
4584bc8d18 clean up core initialization
- less floating variables
2014-10-25 21:33:59 -07:00
Juan Batiz-Benet
8cf22c062f core is now ctxcloser 2014-10-25 21:33:10 -07:00
Juan Batiz-Benet
f2b8803a57 net/service now uses ctxcloser 2014-10-25 21:33:10 -07:00
Emery Hemingway
056699cebe convert DAGService to an interface 2014-10-25 22:15:19 -04:00
Juan Batiz-Benet
184c25430b go-vet friendly codebase
- distinguish log.Error and log.Errorf functions
- Initialize structs with field names
- A bit of unreachable code (defers)
2014-10-25 03:46:39 -07:00
Jeromy
31b0ff0307 add testing for pins 2014-10-22 00:28:41 -07:00
Juan Batiz-Benet
f7c1ed39e0 renamed datastore.go -> go-datastore 2014-10-21 15:10:58 -07:00
Juan Batiz-Benet
ac62d13e42 peerstore Put -> Add
Changed lots of peer use, and changed the peerstore to ensure
there is only ever one peer in use.

Fixed #174
2014-10-20 06:37:12 -07:00
Juan Batiz-Benet
9ca87fbb93 peer.Peer is now an interface
![](http://m.memegen.com/77n7dk.jpg)
2014-10-20 03:26:46 -07:00
Juan Batiz-Benet
b1d11ccfcb peerstore constructs peers
Now, all peers should be retrieved from the Peerstore, which will
construct the peers accordingly. This ensures there's only one peer
object per peer (opposite would be bad: things get out sync)

cc @whyrusleeping
2014-10-20 00:44:44 -07:00
Jeromy
60cd0f1cf0 some dht cleanup, and make DHTs take a master context 2014-10-18 04:28:26 -07:00
Jeromy
b2bd6848a8 fix core NewNode not setting network field, and added new json serializer for diagnostics 2014-10-18 04:28:25 -07:00
Juan Batiz-Benet
338b037238 clean up and add inet.Network to bitswap
new Service interface
2014-10-10 20:43:04 -07:00
Jeromy
3732244837 actually start the diagnostics service 2014-10-10 13:18:20 -07:00
Jeromy
280c7e7e06 implement diagnostics service 2014-10-10 13:18:19 -07:00
Juan Batiz-Benet
972c0f7b4b u.DOut -> log.Debug
and other logging switches. I kept the u.PErr and u.POut in cli
commands, as those do need to write raw output directly.
2014-10-09 04:50:22 -07:00
Juan Batiz-Benet
2944360f5c New NameSystem interface
type NameSystem interface {
      Resolver
      Publisher
    }

should say it all.

cc @whyrusleeping
2014-10-08 04:14:52 -07:00
Juan Batiz-Benet
910a76e220 updated multiaddr use across codebase 2014-10-06 04:13:43 -07:00
Juan Batiz-Benet
0c8ae7674e loggers: set level 2014-10-04 03:53:21 -07:00
Juan Batiz-Benet
7e1cd59259 initialize loggers at ERROR 2014-10-04 03:36:30 -07:00
Juan Batiz-Benet
2ce9415c69 + fs ds + thread safe 2014-10-03 14:45:21 -07:00
Juan Batiz-Benet
88d804e32a added core logging 2014-10-03 14:45:21 -07:00
Juan Batiz-Benet
ba510cbd6d IpnsPublicher -> Publisher interface 2014-10-01 01:36:21 -07:00
Juan Batiz-Benet
728f17d3c9 cmd/ipfs/pin.go now uses MakeCommand
+ added recursive pinning func
2014-10-01 01:17:27 -07:00
Jeromy
7f5e13716d writes to ipns work if the top object is the written file (no directories yet!) 2014-10-01 00:39:57 -07:00
Jeromy
2aa2b8c6c7 add routing resolver test 2014-10-01 00:26:59 -07:00
Jeromy
4c0f18cbbd implement ipns publisher code 2014-10-01 00:26:59 -07:00
Jeromy
8ddfb57c59 some bugfixes and added logging 2014-10-01 00:26:59 -07:00