MCPcopy Index your code
hub / github.com/chain/Core / info

Method info

core/core.go:44–62  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

42}
43
44func (a *API) info(ctx context.Context) (map[string]interface{}, error) {
45 if a.config == nil {
46 // never configured
47 return map[string]interface{}{
48 "is_configured": false,
49 "version": config.Version,
50 "build_commit": config.BuildCommit,
51 "build_date": config.BuildDate,
52 "build_config": config.BuildConfig,
53 }, nil
54 }
55 // If we're not the leader, forward to the leader.
56 if a.leader.State() == leader.Following {
57 var resp map[string]interface{}
58 err := a.forwardToLeader(ctx, "/info", nil, &resp)
59 return resp, err
60 }
61 return a.leaderInfo(ctx)
62}
63
64func (a *API) leaderInfo(ctx context.Context) (map[string]interface{}, error) {
65 var generatorHeight uint64

Callers 7

TestForwardToLeaderFunction · 0.95
mainMethod · 0.80
connectMethod · 0.80
processBatchMethod · 0.80
doConfigFunction · 0.80
fetchCoreInfoFunction · 0.80

Calls 3

forwardToLeaderMethod · 0.95
leaderInfoMethod · 0.95
StateMethod · 0.65

Tested by 1

TestForwardToLeaderFunction · 0.76