Skip to content

Commit

Permalink
DB: Add migration scripts to postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedmansour committed Oct 27, 2021
1 parent 8d3b9a0 commit 396544d
Show file tree
Hide file tree
Showing 5 changed files with 1,126 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
"args": [
"--db-path=${workspaceFolder}/watchtheburn.db"
]
},
{
"name": "Launch Migration",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/migration",
"args": [
"--sqlite-db-path=${workspaceFolder}/watchtheburn.db"
]
}
]
}
2 changes: 1 addition & 1 deletion analysis/blocks_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (b *BlocksFull) storePercentage(block WatchTheBurnBlockStat, percentile int
}
b.blocksFull[consecutivePercentile] = append(b.blocksFull[consecutivePercentile], block) // Mark consecutive full blocks

fmt.Printf("%d to %d = %d", b.currentStreaks[percentile].StartBlock, b.currentStreaks[percentile].EndBlock, b.currentStreaks[percentile].Count())
// fmt.Printf("%d to %d = %d\n", b.currentStreaks[percentile].StartBlock, b.currentStreaks[percentile].EndBlock, b.currentStreaks[percentile].Count())
}

if clearTrackingPercentile {
Expand Down
10 changes: 10 additions & 0 deletions migration/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/mohamedmansour/ethereum-burn-stats/analysis

go 1.16

require (
github.com/ethereum/go-ethereum v1.10.9 // indirect
github.com/lib/pq v1.10.3 // indirect
github.com/mattn/go-sqlite3 v1.14.8
github.com/mohamedmansour/ethereum-burn-stats/daemon v0.0.0-20210929233232-a8ed04012aba // indirect
)
Loading

0 comments on commit 396544d

Please sign in to comment.