|
|
|
@ -42,18 +42,21 @@ func (s *PublicHarmonyService) ProtocolVersion( |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Syncing returns false in case the node is currently not syncing with the network. It can be up to date or has not
|
|
|
|
|
// yet received the latest block headers from its pears. In case it is synchronizing:
|
|
|
|
|
// - startingBlock: block number this node started to synchronise from
|
|
|
|
|
// - currentBlock: block number this node is currently importing
|
|
|
|
|
// - highestBlock: block number of the highest block header this node has received from peers
|
|
|
|
|
// - pulledStates: number of state entries processed until now
|
|
|
|
|
// - knownStates: number of known state entries that still need to be pulled
|
|
|
|
|
// Syncing returns false in case the node is in sync with the network
|
|
|
|
|
// With the current network height as well as the difference
|
|
|
|
|
func (s *PublicHarmonyService) Syncing( |
|
|
|
|
ctx context.Context, |
|
|
|
|
) (interface{}, error) { |
|
|
|
|
// TODO(dm): find our Downloader module for syncing blocks
|
|
|
|
|
return false, nil |
|
|
|
|
inSync, target, difference := s.hmy.NodeAPI.SyncStatus(s.hmy.ShardID) |
|
|
|
|
return struct { |
|
|
|
|
InSync bool `json:"in-sync"` |
|
|
|
|
Target uint64 `json:"network-height"` |
|
|
|
|
Delta uint64 `json:"difference"` |
|
|
|
|
}{ |
|
|
|
|
InSync: inSync, |
|
|
|
|
Target: target, |
|
|
|
|
Delta: difference, |
|
|
|
|
}, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GasPrice returns a suggestion for a gas price.
|
|
|
|
|