minor tweaks

master
Jeffrey Paul 5 年前
父節點 43d43d3748
當前提交 8ff07a4a0b
簽署人: sneak
GPG 金鑰 ID: 052443F4DF2A55C2
  1. 7
      app.go
  2. 5
      main.go
  3. 2
      steemapi.go

@ -41,8 +41,8 @@ func (self *App) main() {
func (self *App) mainloop() {
log.Infof("using %d fetching threads", self.config.desiredFetcherThreads)
// we are going to do batches of 5,000 blocks
batchSize := uint(1000)
//batchSize := uint(1000)
batchSize := uint(10)
var start BlockNumber
var end BlockNumber
for {
@ -52,10 +52,13 @@ func (self *App) mainloop() {
time.Sleep(1 * time.Second)
continue
}
log.Infof("current network block height = %d", self.db.CurrentNetworkBlockHeight())
log.Infof("current local block height = %d", self.db.CurrentLocalBlockHeight())
// we are not synced
// how far behind are we?
countMustFetch := uint(self.db.CurrentNetworkBlockHeight() - self.db.CurrentLocalBlockHeight())
log.Infof("we are %d blocks behind", countMustFetch)
start = self.db.CurrentLocalBlockHeight() + 1
log.Infof("beginning fetch with start block %d", start)
if countMustFetch <= batchSize {

@ -12,10 +12,11 @@ const redisUrl = "localhost:6379"
func main() {
app := NewApp(&appconfig{
logLevel: log.InfoLevel,
logLevel: log.DebugLevel,
// logLevel: log.InfoLevel,
apiUrl: steemAPIURL,
redisUrl: redisUrl,
desiredFetcherThreads: 20,
desiredFetcherThreads: 40,
})
app.main()
}

@ -34,7 +34,7 @@ func NewSteemAPI(url string, options ...func(s SteemAPIShape)) *SteemAPI {
func (self *SteemAPI) GetDynamicGlobalProperties() (GetDynamicGlobalPropertiesResponse, error) {
var resp DynamicGlobalProperties
raw, err := self.rpc.Call("get_dynamic_global_properties", EmptyParamsRaw)
raw, err := self.rpc.Call("condenser_api.get_dynamic_global_properties", EmptyParamsRaw)
if err != nil {
return nil, err
}

載入中…
取消
儲存