Commit Graph

472 Commits

Author SHA1 Message Date
Brian Tiger Chow
4aba282379 feat(fsrepo): handle safe Removal 2015-01-13 03:09:33 -08:00
Brian Tiger Chow
80c2e97692 refactor(main): use fsrepo to load config 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
1b700864f9 refactor(repo): all config writes must go through repo 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
405afd2a02 refactor(config, repo): all writes go through FSRepo. next: privatize these 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
c2877b2045 refactor(init, repo): init logs in fsrepo 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
c5da1561b9 check datastore directory when opening the repo for use 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
0d88f70c6e feat(init): remove datastore path override 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
fa4cfe8da2 refactor(init, fsrepo): go through repo to write to config 2015-01-13 03:09:30 -08:00
Brian Tiger Chow
a2d1e3395e refactor(init): write config at top level 2015-01-13 03:09:30 -08:00
Brian Tiger Chow
44f3d95c3b refactor(repo/fsrepo): use repo to check whether config exists 2015-01-13 03:09:30 -08:00
Brian Tiger Chow
5b3164de5c refactor(repo/config) move config under repo 2015-01-13 03:09:30 -08:00
Juan Batiz-Benet
cac7e025b8 daemon: log error from gateway 2015-01-12 01:31:59 -08:00
Juan Batiz-Benet
4afb4e090f daemon gateway async 2015-01-12 01:14:32 -08:00
Juan Batiz-Benet
2c83cd5627 daemon: only try gateway addr if there 2015-01-12 01:05:15 -08:00
Juan Batiz-Benet
f215eee3ed gateway: cleaned up ServeHTTP func 2015-01-12 01:01:22 -08:00
Juan Batiz-Benet
ed41ac27fd daemon: refactor common parts of serve funcs 2015-01-12 01:01:21 -08:00
Matt Bell
f39f3fe432 cmd/ipfs: Redirect requests to /webui to webui app 2015-01-11 22:15:33 -08:00
Matt Bell
b5300f1d27 cmd/ipfs: Added gateway MIME type resolution 2015-01-11 22:15:33 -08:00
Matt Bell
e25b08231c cmd/ipfs: Renamed 'ipfsHandler' to 'gatewayHandler' 2015-01-11 22:15:33 -08:00
Matt Bell
cb84a376bd cmd/ipfs: Added an ipfsHandler constructor 2015-01-11 22:15:33 -08:00
Simon Kirkby
64cb1b6bf8 CR updates
replaced H
moved internal errors into function.

Signed-off-by: Simon Kirkby <tigger@interthingy.com>
2015-01-11 22:15:33 -08:00
Simon Kirkby
32823d2085 Static Website serving and listing
adds
 trailing slash redirection
 index.html return
 templated directory listing

Signed off : Simon Kirkby <tigger@interthingy.com>
2015-01-11 22:15:33 -08:00
Matt Bell
9119435cb6 cmd/ipfs: Added gateway server to daemon 2015-01-11 22:15:32 -08:00
Brian Tiger Chow
57b3ffa533 feat: new core constructor + config options (Standard, Online, Offline) 2015-01-11 01:23:25 -08:00
Juan Batiz-Benet
e1cde6bc8c Merge pull request #462 from jbenet/feat/indirect
Implement recursive indirect block creation for DAGs
2015-01-06 12:08:28 -08:00
Jeromy
e3cf893616 implement recursive indirect blocks
improve efficiency of multilayered indirect blocks

clean up tests

panic cleanup

clean up logic, improve readability

add final root node to the dagservice upon creation

importer: simplified dag generation

test: updated hashes using latest code

@whyrusleeping this is why the sharness tests
were failing: the hashes are added manually to
make sure our generation doesn't change.

cleanup after CR

fix merkledag tests

fix small block generation (no subblocks!)
2015-01-06 19:43:56 +00:00
Juan Batiz-Benet
517d3e99b8 bootstrap addrs: moved parsing around
this commit:
* moves parsing of bootstrap peers into config
* moves location of bootstrap addrs into core/commands
* refactor `*BootstrapPeer -> BootstrapPeer
2015-01-06 00:25:17 -08:00
Juan Batiz-Benet
64cb32dadd disable utp
utp is BROKEN!! it causes tests to fail.
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
cf62f63b58 better daemon + main exit semantics 2015-01-04 00:47:27 -08:00
Juan Batiz-Benet
e21b1f662b fuse mount lifecycle fixes
This commit cleans up how mounting was being done.
It now successfully signals when it is properly mounted
and listen to close signals correctly.
2015-01-04 00:47:27 -08:00
Juan Batiz-Benet
cc0d7c9b57 crypto -> p2p/crypto
The crypto package moves into p2p. Nothing in it so far is ipfs
specific; everything is p2p-general.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
89f5cd4c94 introducing p2p pkg
I think it's time to move a lot of the peer-to-peer networking
but-not-ipfs-specific things into its own package: p2p.
This could in the future be split off into its own library.
The first thing to go is the peer.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
c84a714b16 peer change: peer.Peer -> peer.ID
this is a major refactor of the entire codebase
it changes the monolithic peer.Peer into using
a peer.ID and a peer.Peerstore.

Other changes:
- removed handshake3.
-	testutil vastly simplified peer
-	secio bugfix + debugging logs
-	testutil: RandKeyPair
-	backpressure bugfix: w.o.w.
-	peer: added hex enc/dec
-	peer: added a PeerInfo struct
  PeerInfo is a small struct used to pass around a peer with
 	a set of addresses and keys. This is not meant to be a
 	complete view of the system, but rather to model updates to
 	the peerstore. It is used by things like the routing system.
-	updated peer/queue + peerset
-	latency metrics
-	testutil: use crand for PeerID gen
 	RandPeerID generates random "valid" peer IDs. it does not
 	NEED to generate keys because it is as if we lost the key
 	right away. fine to read some randomness and hash it. to
 	generate proper keys and an ID, use:
 	  sk, pk, _ := testutil.RandKeyPair()
 	  id, _ := peer.IDFromPublicKey(pk)
 	Also added RandPeerIDFatal helper
- removed old spipe
- updated seccat
- core: cleanup initIdentity
- removed old getFromPeerList
2014-12-23 08:33:32 -08:00
Markus Amalthea Magnuson
dbefedbb2e Fix typo.
”configurationx” -> ”configuration”
2014-12-14 20:55:29 +01:00
Juan Batiz-Benet
e7edeca392 added log.Events to secio 2014-12-12 03:29:09 -08:00
Juan Batiz-Benet
5b142948ab seccat (to test sio) 2014-12-12 02:45:23 -08:00
Juan Batiz-Benet
ac2be0b68b util/log: SetDebugLogging 2014-12-12 02:45:22 -08:00
Brian Tiger Chow
fb45e7b7fb fix: name
editing in the browser here goes nothing
2014-12-09 15:27:02 -08:00
Brian Tiger Chow
c2c95d1105 start threading context through the system
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-09 07:11:48 -08:00
Brian Tiger Chow
6780228765 fix: seed the random number generator
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-09 00:06:53 -08:00
Brian Tiger Chow
bd685045c8 fix: uranus and saturn IP addresses
Mistake: Saturn referred to the NY node and vice versa.

Correction: Fittingly, Uranus is in NY and _S_aturn is _S_ingapore.

I'll have to reboot the testnet to rectify the changes.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 23:19:52 -08:00
Brian Tiger Chow
af01e0a53c add names
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-07 17:45:49 -08:00
Brian Tiger Chow
7ea2b2d80e feat(bootstrap!) add saturn, neptune, pluto, uranus
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-07 17:07:15 -08:00
Jeromy
e8536db351 make bitswap sub-RPC's timeout (slowly for now) 2014-12-05 20:53:33 +00:00
Jeromy
514b26e2b8 remove sigquit from handled signals 2014-12-05 20:53:33 +00:00
Brian Tiger Chow
8d6f2ed0bc chore(main) move logging statement to more appropriate place
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-27 17:06:20 -08:00
Brian Tiger Chow
9e6177ef2e log(main) add log event for executing pre-command hooks
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:39 -08:00
Brian Tiger Chow
b5dc686fda feat(main) create root context
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:39 -08:00
Matt Bell
706ebe8d24 daemon: Set allowed API origins in API_ORIGIN environment variable 2014-11-25 06:12:35 -08:00
Brian Tiger Chow
90ed148209 fix(eventlog) apply settings upon initialization
This commit applies the logging settings to the logging system upon
initialization `ipfs init` and `ipfs daemon --init`.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-24 16:05:51 -08:00
Brian Tiger Chow
4d497f1c6e refactor(repo) mv ConfigureLogger to repo package
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	cmd/ipfs/main.go
2014-11-24 16:05:51 -08:00
Brian Tiger Chow
2c38487eb0 fix(eventlog) configure logging if repo is initialized
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-24 16:05:51 -08:00
Christian Couder
8b8b6ce9e2 Remove dot and slash before files in cmd/ipfs/.gitignore
It looks like files are not ignored when they are listed
starting with ./ in a .gitignore file.

At least this is true for me on Linux for the "ipfs"
binary in "cmd/ipfs/.gitignore".

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-22 21:55:12 +01:00
Jeromy
34da5f039c log formatting (info -> infof) 2014-11-21 03:54:26 +00:00
Juan Batiz-Benet
a1dcbbad80 init: note about addrs 2014-11-20 09:15:48 -08:00
Juan Batiz-Benet
1a5cb300cb config: swarm is list of addrs 2014-11-20 09:14:48 -08:00
Juan Batiz-Benet
43452fdeb7 updated multiaddr + multiaddr-net
I broke out multiaddr/net to its own package so
that multiaddr parsing could remain lean. multiaddr-net
will vendor special implementations of protocols (like utp)
2014-11-20 00:58:48 -08:00
Juan Batiz-Benet
a7d1fd42d8 updating daemon addr output 2014-11-18 08:19:25 -08:00
Brian Tiger Chow
e12edd2053 fix(daemon) ensure IPFS is initialized before starting the daemon
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-18 06:42:44 -08:00
Juan Batiz-Benet
5aaa45db9a transitioned ipfs2 -> ipfs 2014-11-18 06:15:00 -08:00
Juan Batiz-Benet
ad3f3e003f removed old commands files
https://www.youtube.com/watch?v=kyFyAqLtHq8
2014-11-18 06:15:00 -08:00
Juan Batiz-Benet
2b32e698d0 remove ipfs2 from gitignore 2014-11-18 06:15:00 -08:00
Juan Batiz-Benet
f43954fcd1 ensure node constructed is online for daemon 2014-11-18 05:20:04 -08:00
Juan Batiz-Benet
d3c9c5978e remove daemon node constructor 2014-11-18 03:47:28 -08:00
Matt Bell
7a4491ada3 Added --mount flag to mount when running 'ipfs daemon' 2014-11-18 03:31:32 -08:00
Matt Bell
d1f1d2f5bf core/commands2: Fixed commands to use string arguments 2014-11-18 02:13:55 -08:00
Juan Batiz-Benet
eba0599dd2 bugfix: node teardown is the last man to go down
Warning: during normal execution node teardown must be the
last thing that happens because command requests return
io.Readers, which may still be constructing or processing
their output. The node (and its subservices) is needed for
this. good night and good luck.
2014-11-17 23:13:18 -08:00
Brian Tiger Chow
8d4c21694c fix
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:19 -08:00
Brian Tiger Chow
7cebc3cc38 inline prints
looking forward to fixing these again

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
bc396610de fix(2/daemon) initialized --> init
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
061200452f feat(2/daemon) --initialized
@jbenet

now, ipfs can be built and executed in one step:
```
docker run jbenet/go-ipfs daemon --initialized
```

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
d0a3f9ba9a feat(2/init) expose init with defaults
will support daemon initialization

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

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
6a380ff532 refactor(2/init) use util.FileExists
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
c883f7dc36 refactor(2/init) extract const
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
81f5d6fd5f debug(2/ipfs) make cmdDetails loggable
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:17 -08:00
Brian Tiger Chow
cf8fb87df1 refactor(errors) debugerror -> errors
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 00:44:18 -08:00
Brian Tiger Chow
c4ea0b78ba fix(2/init) msg
@jbenet i presume you prefer it without the period

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 08:28:08 -08:00
Brian Tiger Chow
c8c062fe13 refactor(config/init) add hooks to identity generation. useful for displaying messages to the user
@jbenet this commit re-introduces the peer identity line. It's very
useful. I understand it may have been removed because of the clashing of
the IDs. To alleviate this, this commit places some negative space
between the two lines.

'to test' -> 'to get started' as a stronger call to action

```
λ. ipfs2 init -f
initializing ipfs node at /Users/btc/.go-ipfs
generating key pair...done.
peer identity: QmWzjxNEYKjDAxuHJqvtLP1dZTDjreBSUsArWoHai1v9yP

to get started, enter: ipfs cat QmYpv2VEsxzTTXRYX3PjDg961cnJE3kY1YDXLycHGQ3zZB
```

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 08:13:26 -08:00
Brian Tiger Chow
1c4c7412b4 fix(misc) address PR comments
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:40:05 -08:00
Brian Tiger Chow
02d8da09ae fix(2/init) message displayed during init
TODO use a writer to get the command output

resulting appearance:
```
go-ipfs (feat/machine-readable-logging) λ. make install_2; ipfs2 init -f
cd cmd/ipfs2 && go install
initializing ipfs node at /Users/btc/.go-ipfs
generating key pair...
peer identity: %s QmcPLgrqfvnneJ3vr3oGpkTiS9Psx8p3HxevjnoZYToDRm
```

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:01 -08:00
Brian Tiger Chow
6fec76d93e fix(imports) misc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
25c98e8e61 refactor(eventlog) elog -> eventlog
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
ac69aba561 feat(2/main) configure event logger
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
be62b76516 refactor(2/main) use debugerror
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
3a927cbcec feat(init) init logs upon config initialization
TODO allow user dir override

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

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
d28c9cc7b4 refactor(init) extract initCheckDir function
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
4cadbc1673 style rename for clarity
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:59 -08:00
Brian Tiger Chow
15f850f08c refactor(2/main) helper methods for details object
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:59 -08:00
Brian Tiger Chow
55896a86d6 logs(2/main) place log statements approppriately
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:59 -08:00
Brian Tiger Chow
2c88e342db feat(elog) implement event logger
a wrapper around the util.Logger
metadata is loggable

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:58 -08:00
Brian Tiger Chow
57689ffc2b fix(2/version) make it possible to execute before init
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 03:20:10 -08:00
Juan Batiz-Benet
e290b54d9e Merge pull request #351 from jbenet/mount-fixes
Mount, Daemon, and Signal Handler Fixes
2014-11-16 02:40:31 -08:00
Juan Batiz-Benet
4ac6db9a24 ipfs1/mount: text + unmounting 2014-11-16 02:35:13 -08:00
Juan Batiz-Benet
13c390b0b5 fix ipfs1 mount so it will compile 2014-11-16 02:30:29 -08:00
Juan Batiz-Benet
705465db8b main + daemon signal handlers
This commit changes the signal handler to be added once
the command is executing. this is because the daemon
has its own signal handler, that must try to shut down
the node gracefully first. You know, just in case.
2014-11-16 02:22:43 -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
Juan Batiz-Benet
61c1e39a51 Merge pull request #266 from jbenet/defaulthash
add in a default file hash and cleaned up init function a bit
2014-11-16 00:21:18 -08:00
Juan Batiz-Benet
ab09c3649c defaulthash: let's not ignore errors
@maybebtc fixed it. cc @whyrusleeping
2014-11-15 22:55:58 -08:00