forked from Crinstaniev/merge-data-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.py
38 lines (28 loc) · 1.04 KB
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#%%
from web3.beacon import Beacon
import warnings
import pickle
import json
warnings.filterwarnings('ignore')
beacon = Beacon('https://ultra-chaotic-silence.discover.quiknode.pro/3a20380951ff287a674246a038a9563feea0e27f')
# %%
validators = beacon.get_validators()
with open('data/validators.json', 'w') as f:
json.dump(validators, f)
#%%
block_headers = beacon.get_block_headers()
# %%
epoch_committees_4680000_4680031 = beacon.get_epoch_committees(4680000).get('data')
# %%
epoch_committees_4680032_4680063 = beacon.get_epoch_committees(4680032).get('data')
# %%
epoch_committees_4680064_4680095 = beacon.get_epoch_committees(4680064).get('data')
# %%
epoch_committees_4680000_4680095 = []
epoch_committees_4680000_4680095.extend(epoch_committees_4680000_4680031)
epoch_committees_4680000_4680095.extend(epoch_committees_4680032_4680063)
epoch_committees_4680000_4680095.extend(epoch_committees_4680064_4680095)
# %%
with open('./data/epoch_committees_4680000_4680095.pkl', 'wb') as f:
pickle.dump(epoch_committees_4680000_4680095, f)
# %%