mirror of
https://github.com/feather-wallet/feather.git
synced 2024-11-16 17:27:38 +00:00
Update restore heights
This commit is contained in:
parent
63438d8b82
commit
1d691d1eb1
3 changed files with 239 additions and 2 deletions
46
contrib/generate-restore-heights/heights.py
Normal file
46
contrib/generate-restore-heights/heights.py
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
import requests
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description='Generate restore height list.')
|
||||||
|
parser.add_argument('-P', '--port',
|
||||||
|
default='18081',
|
||||||
|
dest='port',
|
||||||
|
help='Daemon port',
|
||||||
|
type=int)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
DAEMON_ADDRESS = f"http://127.0.0.1:{args.port}"
|
||||||
|
|
||||||
|
def get_block_timestamp(height: int):
|
||||||
|
data = {
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "0",
|
||||||
|
"method": "get_block_header_by_height",
|
||||||
|
"params": {
|
||||||
|
"height": height
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res = requests.get(DAEMON_ADDRESS+"/json_rpc", json=data)
|
||||||
|
return res.json()['result']['block_header']['timestamp']
|
||||||
|
|
||||||
|
|
||||||
|
def get_height():
|
||||||
|
data = {
|
||||||
|
"jsonrpc": "2.0",
|
||||||
|
"id": "0",
|
||||||
|
"method": "get_block_count"
|
||||||
|
}
|
||||||
|
res = requests.get(DAEMON_ADDRESS+"/json_rpc", json=data)
|
||||||
|
return res.json()['result']['count']
|
||||||
|
|
||||||
|
|
||||||
|
timestamps = {}
|
||||||
|
current_height = get_height()
|
||||||
|
|
||||||
|
timestamps[1] = get_block_timestamp(1)
|
||||||
|
for height in range(1500, current_height, 1500):
|
||||||
|
timestamps[height] = get_block_timestamp(height)
|
||||||
|
|
||||||
|
for val in timestamps:
|
||||||
|
print(f"{timestamps[val]}:{val}")
|
|
@ -1510,3 +1510,117 @@
|
||||||
1609331787:2263500
|
1609331787:2263500
|
||||||
1609513572:2265000
|
1609513572:2265000
|
||||||
1609692129:2266500
|
1609692129:2266500
|
||||||
|
1609867599:2268000
|
||||||
|
1610047219:2269500
|
||||||
|
1610228186:2271000
|
||||||
|
1610407595:2272500
|
||||||
|
1610589258:2274000
|
||||||
|
1610772298:2275500
|
||||||
|
1610951384:2277000
|
||||||
|
1611133107:2278500
|
||||||
|
1611312080:2280000
|
||||||
|
1611490215:2281500
|
||||||
|
1611673294:2283000
|
||||||
|
1611853050:2284500
|
||||||
|
1612029885:2286000
|
||||||
|
1612206719:2287500
|
||||||
|
1612387526:2289000
|
||||||
|
1612569532:2290500
|
||||||
|
1612750081:2292000
|
||||||
|
1612930978:2293500
|
||||||
|
1613113853:2295000
|
||||||
|
1613289586:2296500
|
||||||
|
1613470569:2298000
|
||||||
|
1613650566:2299500
|
||||||
|
1613830056:2301000
|
||||||
|
1614009139:2302500
|
||||||
|
1614188174:2304000
|
||||||
|
1614364622:2305500
|
||||||
|
1614547318:2307000
|
||||||
|
1614725907:2308500
|
||||||
|
1614906615:2310000
|
||||||
|
1615094144:2311500
|
||||||
|
1615272359:2313000
|
||||||
|
1615451290:2314500
|
||||||
|
1615629691:2316000
|
||||||
|
1615805209:2317500
|
||||||
|
1615991354:2319000
|
||||||
|
1616169054:2320500
|
||||||
|
1616349055:2322000
|
||||||
|
1616525847:2323500
|
||||||
|
1616708533:2325000
|
||||||
|
1616893535:2326500
|
||||||
|
1617071845:2328000
|
||||||
|
1617249163:2329500
|
||||||
|
1617430317:2331000
|
||||||
|
1617607600:2332500
|
||||||
|
1617790288:2334000
|
||||||
|
1617973699:2335500
|
||||||
|
1618147282:2337000
|
||||||
|
1618329866:2338500
|
||||||
|
1618511460:2340000
|
||||||
|
1618685970:2341500
|
||||||
|
1618865550:2343000
|
||||||
|
1619048569:2344500
|
||||||
|
1619230022:2346000
|
||||||
|
1619407133:2347500
|
||||||
|
1619590095:2349000
|
||||||
|
1619769449:2350500
|
||||||
|
1619948697:2352000
|
||||||
|
1620131734:2353500
|
||||||
|
1620308138:2355000
|
||||||
|
1620490090:2356500
|
||||||
|
1620668363:2358000
|
||||||
|
1620849947:2359500
|
||||||
|
1621033633:2361000
|
||||||
|
1621207215:2362500
|
||||||
|
1621393360:2364000
|
||||||
|
1621567773:2365500
|
||||||
|
1621750649:2367000
|
||||||
|
1621933277:2368500
|
||||||
|
1622108971:2370000
|
||||||
|
1622288557:2371500
|
||||||
|
1622467139:2373000
|
||||||
|
1622651471:2374500
|
||||||
|
1622833171:2376000
|
||||||
|
1623011441:2377500
|
||||||
|
1623188483:2379000
|
||||||
|
1623370163:2380500
|
||||||
|
1623550839:2382000
|
||||||
|
1623728565:2383500
|
||||||
|
1623910801:2385000
|
||||||
|
1624094652:2386500
|
||||||
|
1624268730:2388000
|
||||||
|
1624454173:2389500
|
||||||
|
1624633102:2391000
|
||||||
|
1624813544:2392500
|
||||||
|
1624995509:2394000
|
||||||
|
1625174760:2395500
|
||||||
|
1625350875:2397000
|
||||||
|
1625530310:2398500
|
||||||
|
1625715884:2400000
|
||||||
|
1625890512:2401500
|
||||||
|
1626080398:2403000
|
||||||
|
1626251832:2404500
|
||||||
|
1626434873:2406000
|
||||||
|
1626616459:2407500
|
||||||
|
1626797788:2409000
|
||||||
|
1626976609:2410500
|
||||||
|
1627159689:2412000
|
||||||
|
1627336518:2413500
|
||||||
|
1627515996:2415000
|
||||||
|
1627696970:2416500
|
||||||
|
1627873363:2418000
|
||||||
|
1628056769:2419500
|
||||||
|
1628233063:2421000
|
||||||
|
1628413022:2422500
|
||||||
|
1628596304:2424000
|
||||||
|
1628777705:2425500
|
||||||
|
1628957276:2427000
|
||||||
|
1629135964:2428500
|
||||||
|
1629318052:2430000
|
||||||
|
1629495981:2431500
|
||||||
|
1629677343:2433000
|
||||||
|
1629854603:2434500
|
||||||
|
1630032622:2436000
|
||||||
|
1630217808:2437500
|
|
@ -529,3 +529,80 @@
|
||||||
1615731420:792000
|
1615731420:792000
|
||||||
1615933315:793500
|
1615933315:793500
|
||||||
1616104918:795000
|
1616104918:795000
|
||||||
|
1616280486:796500
|
||||||
|
1616483958:798000
|
||||||
|
1616677488:799500
|
||||||
|
1616864492:801000
|
||||||
|
1617011783:802500
|
||||||
|
1617243009:804000
|
||||||
|
1617434167:805500
|
||||||
|
1617609667:807000
|
||||||
|
1617795845:808500
|
||||||
|
1617993128:810000
|
||||||
|
1618181526:811500
|
||||||
|
1618362660:813000
|
||||||
|
1618537048:814500
|
||||||
|
1618700152:816000
|
||||||
|
1618891334:817500
|
||||||
|
1619058998:819000
|
||||||
|
1619232663:820500
|
||||||
|
1619427622:822000
|
||||||
|
1619628127:823500
|
||||||
|
1619863363:825000
|
||||||
|
1619998315:826500
|
||||||
|
1620216657:828000
|
||||||
|
1620416386:829500
|
||||||
|
1620602417:831000
|
||||||
|
1620784230:832500
|
||||||
|
1620977670:834000
|
||||||
|
1621176309:835500
|
||||||
|
1621352150:837000
|
||||||
|
1621529837:838500
|
||||||
|
1621715183:840000
|
||||||
|
1621891016:841500
|
||||||
|
1622068671:843000
|
||||||
|
1622236700:844500
|
||||||
|
1622393818:846000
|
||||||
|
1622572603:847500
|
||||||
|
1622767566:849000
|
||||||
|
1622941282:850500
|
||||||
|
1623107663:852000
|
||||||
|
1623352063:853500
|
||||||
|
1623502520:855000
|
||||||
|
1623696345:856500
|
||||||
|
1623903078:858000
|
||||||
|
1624067589:859500
|
||||||
|
1624277066:861000
|
||||||
|
1624466865:862500
|
||||||
|
1624643841:864000
|
||||||
|
1624818125:865500
|
||||||
|
1625006084:867000
|
||||||
|
1625182383:868500
|
||||||
|
1625348128:870000
|
||||||
|
1625542485:871500
|
||||||
|
1625690595:873000
|
||||||
|
1625875030:874500
|
||||||
|
1626049431:876000
|
||||||
|
1626230916:877500
|
||||||
|
1626454343:879000
|
||||||
|
1626627856:880500
|
||||||
|
1626839863:882000
|
||||||
|
1627022662:883500
|
||||||
|
1627206043:885000
|
||||||
|
1627390139:886500
|
||||||
|
1627549087:888000
|
||||||
|
1627727762:889500
|
||||||
|
1627910975:891000
|
||||||
|
1628095914:892500
|
||||||
|
1628304203:894000
|
||||||
|
1628485223:895500
|
||||||
|
1628636024:897000
|
||||||
|
1628850117:898500
|
||||||
|
1629035762:900000
|
||||||
|
1629206719:901500
|
||||||
|
1629395524:903000
|
||||||
|
1629579720:904500
|
||||||
|
1629754526:906000
|
||||||
|
1629907575:907500
|
||||||
|
1630095527:909000
|
||||||
|
1630287335:910500
|
Loading…
Reference in a new issue