forked from cerc-io/ipld-eth-server
Add ability to populate missing blocks
* The command populates up to the highest known block number
* The anticipated use case is that the listener will be running
in parallel to the populateBlocks command
* This will mean that the listener is responsible for picking up
new blocks, and the populateBlocks command is reposible for
historical blocks
* Reformat SQL statements
This commit is contained in:
@@ -25,6 +25,16 @@ func tasks(p *do.Project) {
|
||||
do.M{"environment": environment, "$in": "cmd/run"})
|
||||
})
|
||||
|
||||
p.Task("populateBlocks", nil, func(context *do.Context) {
|
||||
environment := parseEnvironment(context)
|
||||
startingNumber := context.Args.MayInt(-1, "starting-number")
|
||||
if startingNumber < 0 {
|
||||
log.Fatalln("--starting-number required")
|
||||
}
|
||||
context.Start(`go run main.go --environment={{.environment}} --starting-number={{.startingNumber}}`,
|
||||
do.M{"environment": environment, "startingNumber": startingNumber, "$in": "cmd/populate_blocks"})
|
||||
})
|
||||
|
||||
p.Task("migrate", nil, func(context *do.Context) {
|
||||
environment := parseEnvironment(context)
|
||||
cfg := config.NewConfig(environment)
|
||||
|
||||
Reference in New Issue
Block a user