Add IPCendpoint

This commit is contained in:
Oskar Thoren 2019-04-09 14:21:27 +08:00
parent ad8e36a39e
commit 9e5ef8ef14
1 changed files with 10 additions and 1 deletions

View File

@ -114,6 +114,8 @@ func newNode(port int) (*node.Node, error) {
} }
cfg.HTTPPort = port cfg.HTTPPort = port
// XXX
cfg.IPCPath = "bzz.ipc"
fmt.Printf("Current data directory is %s\n", cfg.DataDir) fmt.Printf("Current data directory is %s\n", cfg.DataDir)
return node.New(cfg) return node.New(cfg)
@ -257,7 +259,8 @@ func init() {
// loglevel = log.LvlTrace // loglevel = log.LvlTrace
// } // }
// XXX Trace for now // XXX Trace for now
loglevel = log.LvlTrace // XXX: unable to forward to any peers volume is crazy
//loglevel = log.LvlTrace
hf := log.LvlFilterHandler(loglevel, hs) hf := log.LvlFilterHandler(loglevel, hs)
h := log.CallerFileHandler(hf) h := log.CallerFileHandler(hf)
log.Root().SetHandler(h) log.Root().SetHandler(h)
@ -307,3 +310,9 @@ func main() {
// XXX Ok the problem is https://github.com/ethereum/go-ethereum/blob/master/swarm/pss/pss.go#L766 // XXX Ok the problem is https://github.com/ethereum/go-ethereum/blob/master/swarm/pss/pss.go#L766
// Which happens due to not being connected, so manually and possibly some local network stuff here // Which happens due to not being connected, so manually and possibly some local network stuff here
// Can't do this because IPC isn't running:
// geth attach <path to bzzd.ipc> --exec 'admin.peers'
// Not sure how to enable it from Go code, can do with CLI and then connect?
// Boom
// geth attach .data_9600/bzz.ipc --exec 'admin.peers' # []