PBC: Shards are WIP
This commit is contained in:
parent
e612d7a10d
commit
4b640b7134
|
@ -25,6 +25,9 @@ HOSTNAME = 'reader.partisiablockchain.com'
|
|||
URL_ACCOUNT_PLUGIN = 'https://{hostname}/{shard}blockchain/accountPlugin/local'
|
||||
URL_ACCOUNT_PLUGIN_GLOBAL = 'https://{hostname}/{shard}blockchain/accountPlugin/global'
|
||||
|
||||
def shard_id_for_address(address: str) -> str:
|
||||
return 'shards/Shard2/' # TODO
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class MpcBalance(Scraper):
|
||||
dataset_name = 'defi_mpc_balance'
|
||||
|
@ -52,7 +55,6 @@ class MpcBalance(Scraper):
|
|||
url = URL_ACCOUNT_PLUGIN_GLOBAL.format(
|
||||
hostname = HOSTNAME,
|
||||
shard = '',
|
||||
#shard = 'shards/Shard0/',
|
||||
)
|
||||
|
||||
json_data, date = self.get_json(url, data=data)
|
||||
|
@ -69,7 +71,7 @@ class MpcBalance(Scraper):
|
|||
|
||||
url = URL_ACCOUNT_PLUGIN.format(
|
||||
hostname = HOSTNAME,
|
||||
shard = 'shards/Shard0/',
|
||||
shard = shard_id_for_address(address),
|
||||
)
|
||||
|
||||
data: dict = {'path':[{'type':'field','name':'accounts'},{'type':'avl','keyType':'BLOCKCHAIN_ADDRESS','key':address}]}
|
||||
|
|
Loading…
Reference in New Issue
Block a user