minor tweaks

This commit is contained in:
Jeffrey Paul 2018-11-03 07:59:46 -07:00
parent 43d43d3748
commit 8ff07a4a0b
Signed by: sneak
GPG Key ID: 052443F4DF2A55C2
3 changed files with 9 additions and 5 deletions

7
app.go
View File

@ -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 {

View File

@ -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()
}

View File

@ -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
}