minor tweaks
This commit is contained in:
parent
43d43d3748
commit
8ff07a4a0b
7
app.go
7
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 {
|
||||
|
5
main.go
5
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()
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user