@cryptotaxi247 / kubo / commits / 7b22bdc68

fix compile error after sync

verokarhu committed Sep 28, 2014 at 11:02 UTC 7b22bdc68b09dc92b54dad77f0adc03b662ddf8a
1 file changed +14 -2
cmd/ipfs/serve.go
+14 -2
@@ -6,6 +6,8 @@ import (
6
7 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
8 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
9 + ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
10 +
11 "github.com/jbenet/go-ipfs/daemon"
12 h "github.com/jbenet/go-ipfs/server/http"
13 )
@@ -48,9 +50,19 @@ func serveHttpCmd(c *commander.Command, _ []string) error {
50 return err
51 }
52
51 - fmt.Println("starting new daemon listener...")
52 - dl, err := daemon.NewDaemonListener(n, "localhost:12345")
53 + // launch the API RPC endpoint.
54 + if n.Config.Addresses.API == "" {
55 + return errors.New("no config.RPCAddress endpoint supplied")
56 + }
57 +
58 + maddr, err := ma.NewMultiaddr(n.Config.Addresses.API)
59 + if err != nil {
60 + return err
61 + }
62 +
63 + dl, err := daemon.NewDaemonListener(n, maddr)
64 if err != nil {
65 + fmt.Println("Failed to create daemon listener.")
66 return err
67 }
68 go dl.Listen()