ether-scan.go 777 B

123456789101112131415161718192021222324252627282930313233
  1. package cronjobs
  2. import (
  3. "fmt"
  4. "syncscan-go/locals"
  5. models_table "syncscan-go/models/table"
  6. "time"
  7. "github.com/dabory/abango-rest"
  8. e "github.com/dabory/abango-rest/etc"
  9. )
  10. func EtherScan() error {
  11. fmt.Println("connStr: ", locals.GSync.Scb.ConnString)
  12. fmt.Println("this is: ", time.Now().String())
  13. fmt.Println("Show Abango Variable: ", abango.XConfig["MainNetName"])
  14. y := locals.GSync
  15. var row models_table.EthBlock
  16. locals.BlockNoCnt += 1
  17. row.BlockNo = locals.BlockNoCnt
  18. row.GasUsed = "10.0000"
  19. row.GasLimit = "10.0000"
  20. row.TrfeeSum = "10.0000"
  21. row.Reward = "10.0000"
  22. row.UncleReward = "10.0000"
  23. if err := row.AddaRow(&y); err != nil {
  24. return e.ErrLog(e.FuncRun("093840ulua03", e.CurrFuncName()), err)
  25. }
  26. return nil
  27. }