fix core NewNode not setting network field, and added new json serializer for diagnostics

This commit is contained in:
Jeromy 2014-10-13 16:36:51 -07:00 committed by Juan Batiz-Benet
parent be5f9769b2
commit b2bd6848a8
4 changed files with 8 additions and 5 deletions

View File

@ -108,6 +108,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
route *dht.IpfsDHT
exchangeSession exchange.Interface
diagnostics *diag.Diagnostics
network inet.Network
)
if online {
@ -135,6 +136,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
if err != nil {
return nil, err
}
network = net
diagnostics = diag.NewDiagnostics(local, net, diagService)
diagService.SetHandler(diagnostics)
@ -173,6 +175,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
Routing: route,
Namesys: ns,
Diagnostics: diagnostics,
Network: network,
}, nil
}

View File

@ -1,4 +1,4 @@
package diagnostic
package diagnostics
import (
"bytes"

View File

@ -3,7 +3,7 @@
// DO NOT EDIT!
/*
Package diagnostic is a generated protocol buffer package.
Package diagnostics is a generated protocol buffer package.
It is generated from these files:
message.proto
@ -11,9 +11,9 @@ It is generated from these files:
It has these top-level messages:
Message
*/
package diagnostic
package diagnostics
import proto "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
import proto "code.google.com/p/goprotobuf/proto"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -1,4 +1,4 @@
package diagnostic;
package diagnostics;
message Message {
required string DiagID = 1;