@cryptotaxi247 / kubo / commits / 81b4b3814

RPC Address init + checks

Juan Batiz-Benet committed Sep 21, 2014 at 03:38 UTC 81b4b381406fc01a7588742c90c8ededbd5bf3a8
2 files changed +10 -1
cmd/ipfs/init.go
+4 -1
@@ -71,7 +71,10 @@ func initCmd(c *commander.Command, inp []string) error {
71
72 cfg.Identity = new(config.Identity)
73 // This needs thought
74 - cfg.Identity.Address = "/ip4/127.0.0.1/tcp/4001"
74 + cfg.Identity.Address = "/ip4/127.0.0.1/tcp/5001"
75 +
76 + // local RPC endpoint
77 + cfg.RPCAddress = "/ip4/127.0.0.1/tcp/4001"
78
79 nbits, ok := c.Flag.Lookup("b").Value.Get().(int)
80 if !ok {
cmd/ipfs/mount_unix.go
+6
@@ -3,6 +3,7 @@
3 package main
4
5 import (
6 + "errors"
7 "fmt"
8
9 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
@@ -44,6 +45,11 @@ func mountCmd(c *commander.Command, inp []string) error {
45 return err
46 }
47
48 + // launch the RPC endpoint.
49 + if n.Config.RPCAddress == "" {
50 + return errors.New("no config.RPCAddress endpoint supplied")
51 + }
52 +
53 maddr, err := ma.NewMultiaddr(n.Config.RPCAddress)
54 if err != nil {
55 return err