"github.com/vapor/accesstoken"
cfg "github.com/vapor/config"
+ "github.com/vapor/crypto/ed25519/chainkd"
"github.com/vapor/dashboard/dashboard"
"github.com/vapor/dashboard/equity"
"github.com/vapor/errors"
// API is the scheduling center for server
type API struct {
sync NetSync
+ peerXPub chainkd.XPub
wallet *wallet.Wallet
accessTokens *accesstoken.CredentialStore
chain *protocol.Chain
// https://github.com/golang/go/issues/17071
TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){},
}
+ a.peerXPub = config.PrivateKey().XPub()
coreHandler.Set(a)
}
Listening bool `json:"listening"`
Syncing bool `json:"syncing"`
Mining bool `json:"mining"`
+ PeerXPub string `json:"peer_xpub"`
PeerCount int `json:"peer_count"`
CurrentBlock uint64 `json:"current_block"`
HighestBlock uint64 `json:"highest_block"`
Listening: a.sync.IsListening(),
Syncing: !a.sync.IsCaughtUp(),
Mining: a.blockProposer.IsProposing(),
+ PeerXPub: a.peerXPub.String(),
PeerCount: a.sync.PeerCount(),
CurrentBlock: a.chain.BestBlockHeight(),
NetWorkID: a.sync.GetNetwork(),