diff --git a/app.go b/app.go index 89f6223..371e4c7 100644 --- a/app.go +++ b/app.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 { diff --git a/main.go b/main.go index b7790fd..7ee53df 100644 --- a/main.go +++ b/main.go @@ -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() } diff --git a/steemapi.go b/steemapi.go index 4559d90..7d80213 100644 --- a/steemapi.go +++ b/steemapi.go @@ -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 }