mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 09:59:13 +08:00
RPC Address init + checks
This commit is contained in:

committed by
Brian Tiger Chow

parent
1653304129
commit
81b4b38140
@ -71,7 +71,10 @@ func initCmd(c *commander.Command, inp []string) error {
|
|||||||
|
|
||||||
cfg.Identity = new(config.Identity)
|
cfg.Identity = new(config.Identity)
|
||||||
// This needs thought
|
// This needs thought
|
||||||
cfg.Identity.Address = "/ip4/127.0.0.1/tcp/4001"
|
cfg.Identity.Address = "/ip4/127.0.0.1/tcp/5001"
|
||||||
|
|
||||||
|
// local RPC endpoint
|
||||||
|
cfg.RPCAddress = "/ip4/127.0.0.1/tcp/4001"
|
||||||
|
|
||||||
nbits, ok := c.Flag.Lookup("b").Value.Get().(int)
|
nbits, ok := c.Flag.Lookup("b").Value.Get().(int)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
|
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
|
||||||
@ -44,6 +45,11 @@ func mountCmd(c *commander.Command, inp []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// launch the RPC endpoint.
|
||||||
|
if n.Config.RPCAddress == "" {
|
||||||
|
return errors.New("no config.RPCAddress endpoint supplied")
|
||||||
|
}
|
||||||
|
|
||||||
maddr, err := ma.NewMultiaddr(n.Config.RPCAddress)
|
maddr, err := ma.NewMultiaddr(n.Config.RPCAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user