From 71301d2c63ee390e1998897a265268c8a9622938 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Fri, 16 Jan 2015 15:54:11 -0800 Subject: [PATCH 1/5] core/commands: Updated root command helptext --- core/commands/root.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/commands/root.go b/core/commands/root.go index 93929fc76..738390daf 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -28,6 +28,7 @@ Basic commands: add Add an object to ipfs cat Show ipfs object data ls List links from an object + refs List hashes of links from an object Tool commands: @@ -36,12 +37,20 @@ Tool commands: version Show ipfs version information commands List all available commands id Show info about ipfs peers + pin Pin objects to local storage + name Publish or resolve IPNS names + log Change the logging level + +Network commands: + + swarm Manage connections to the p2p network + bootstrap Add or remove bootstrap peers + ping Measure the latency of a connection Advanced Commands: daemon Start a long-running daemon process mount Mount an ipfs read-only mountpoint - serve Serve an interface to ipfs diag Print diagnostics Plumbing commands: From 452f54a48e3a1dce469668381e2e98fd262c611b Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Sat, 17 Jan 2015 14:40:25 -0800 Subject: [PATCH 2/5] core/commands: Enabled stdin arguments for 'bootstrap {add, rm} --- core/commands/bootstrap.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/commands/bootstrap.go b/core/commands/bootstrap.go index a84682a8c..441a611a2 100644 --- a/core/commands/bootstrap.go +++ b/core/commands/bootstrap.go @@ -69,7 +69,7 @@ in the bootstrap list). }, Arguments: []cmds.Argument{ - cmds.StringArg("peer", false, true, peerOptionDesc), + cmds.StringArg("peer", false, true, peerOptionDesc).EnableStdin(), }, Options: []cmds.Option{ @@ -138,7 +138,7 @@ var bootstrapRemoveCmd = &cmds.Command{ }, Arguments: []cmds.Argument{ - cmds.StringArg("peer", false, true, peerOptionDesc), + cmds.StringArg("peer", false, true, peerOptionDesc).EnableStdin(), }, Options: []cmds.Option{ cmds.BoolOption("all", "Remove all bootstrap peers."), From 5589021a1d3c23391512fdeb29fa500c6e7d775e Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Sun, 18 Jan 2015 17:47:43 -0800 Subject: [PATCH 3/5] commands/http: Fixed panics when unmarshaling command output without a set Command.Type --- commands/http/client.go | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/commands/http/client.go b/commands/http/client.go index 6f4015a30..528dcf045 100644 --- a/commands/http/client.go +++ b/commands/http/client.go @@ -153,8 +153,14 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error outputType := reflect.TypeOf(req.Command().Type) for { - v := reflect.New(outputType).Interface() - err := dec.Decode(v) + var v interface{} + var err error + if outputType != nil { + v = reflect.New(outputType).Interface() + err = dec.Decode(v) + } else { + err = dec.Decode(&v) + } if err != nil && err != io.EOF { fmt.Println(err.Error()) return @@ -200,13 +206,20 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error } else { outputType := reflect.TypeOf(req.Command().Type) - v := reflect.New(outputType).Interface() - err = dec.Decode(v) + var v interface{} + + if outputType != nil { + v = reflect.New(outputType).Interface() + err = dec.Decode(v) + } else { + err = dec.Decode(&v) + } if err != nil && err != io.EOF { return nil, err } - - res.SetOutput(v) + if v != nil { + res.SetOutput(v) + } } return res, nil From 4ee3d39253d93cbcf2198a71ed09f7bfc2a536fb Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Fri, 23 Jan 2015 19:14:51 -0800 Subject: [PATCH 4/5] cmd/ipfs: Added key size to 'ipfs init' output --- cmd/ipfs/init.go | 2 +- test/sharness/t0020-init.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index ec8025bc0..a5fbbf6d3 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -238,7 +238,7 @@ func identityConfig(nbits int) (config.Identity, error) { return ident, debugerror.New("Bitsize less than 1024 is considered unsafe.") } - fmt.Printf("generating key pair...") + fmt.Printf("generating %v-bit RSA keypair...", nbits) sk, pk, err := ci.GenerateKeyPair(ci.RSA, nbits) if err != nil { return ident, err diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 5e6995b83..29cd70063 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -36,7 +36,7 @@ test_expect_success "ipfs peer id looks good" ' test_expect_success "ipfs init output looks good" ' STARTHASH="QmYpv2VEsxzTTXRYX3PjDg961cnJE3kY1YDXLycHGQ3zZB" && echo "initializing ipfs node at $IPFS_PATH" >expected && - echo "generating key pair...done" >>expected && + echo "generating 4096-bit RSA keypair...done" >>expected && echo "peer identity: $PEERID" >>expected && printf "\\n%s\\n" "to get started, enter: ipfs cat $STARTHASH" >>expected && test_cmp expected actual_init From ccaabbc06d3c410e7169ae202438e55a7a11bced Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Fri, 23 Jan 2015 19:17:09 -0800 Subject: [PATCH 5/5] core/commands: Rearranged command list sections --- core/commands/root.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/commands/root.go b/core/commands/root.go index 738390daf..60fd0a93f 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -41,18 +41,18 @@ Tool commands: name Publish or resolve IPNS names log Change the logging level -Network commands: - - swarm Manage connections to the p2p network - bootstrap Add or remove bootstrap peers - ping Measure the latency of a connection - Advanced Commands: daemon Start a long-running daemon process mount Mount an ipfs read-only mountpoint diag Print diagnostics +Network commands: + + swarm Manage connections to the p2p network + bootstrap Add or remove bootstrap peers + ping Measure the latency of a connection + Plumbing commands: block Interact with raw blocks in the datastore