2020-03-11 15:54:09 +00:00
package commands
import (
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
"github.com/spf13/cobra"
)
2020-03-25 20:18:46 +00:00
var (
2020-06-09 05:52:38 +00:00
historyfile string
nocheck bool
writeReceipts bool
2020-03-25 20:18:46 +00:00
)
2020-03-11 15:54:09 +00:00
func init ( ) {
withBlock ( checkChangeSetsCmd )
withChaindata ( checkChangeSetsCmd )
2020-03-26 21:52:22 +00:00
checkChangeSetsCmd . Flags ( ) . StringVar ( & historyfile , "historyfile" , "" , "path to the file where the changesets and history are expected to be. If omitted, the same as --chaindata" )
2020-03-25 20:18:46 +00:00
checkChangeSetsCmd . Flags ( ) . BoolVar ( & nocheck , "nocheck" , false , "set to turn off the changeset checking and only execute transaction (for performance testing)" )
2020-06-09 05:52:38 +00:00
checkChangeSetsCmd . Flags ( ) . BoolVar ( & writeReceipts , "writeReceipts" , false , "set to turn off writing receipts as the exection ongoing" )
2020-03-11 15:54:09 +00:00
rootCmd . AddCommand ( checkChangeSetsCmd )
}
var checkChangeSetsCmd = & cobra . Command {
Use : "checkChangeSets" ,
Short : "Re-executes historical transactions in read-only mode and checks that their outputs match the database ChangeSets" ,
RunE : func ( cmd * cobra . Command , args [ ] string ) error {
2020-06-09 05:52:38 +00:00
return stateless . CheckChangeSets ( genesis , block , chaindata , historyfile , nocheck , writeReceipts )
2020-03-11 15:54:09 +00:00
} ,
}