Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Troubleshooting: blocks not being processed #44

Open
arjanz opened this issue Mar 2, 2021 · 0 comments
Open

Troubleshooting: blocks not being processed #44

arjanz opened this issue Mar 2, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@arjanz
Copy link
Member

arjanz commented Mar 2, 2021

When certain block are not processed or no blocks at all then most likely there is a missing or invalid type definition
in the type registry.

Some steps to check:

You can also dive into Python to pinpoint which types are failing to decode:

import json
from scalecodec.type_registry import load_type_registry_file
from substrateinterface import SubstrateInterface

substrate = SubstrateInterface(
    url='ws://127.0.0.1:9944',
    type_registry_preset='substrate-node-template',
    type_registry=load_type_registry_file('harvester/app/type_registry/custom_types.json'),
)

block_hash = substrate.get_block_hash(block_id=3899710)

extrinsics = substrate.get_block_extrinsics(block_hash=block_hash)

print('Extrinsincs:', json.dumps([e.value for e in extrinsics], indent=4))

events = substrate.get_events(block_hash)

print("Events:", json.dumps([e.value for e in events], indent=4))
@arjanz arjanz pinned this issue Mar 2, 2021
@arjanz arjanz added the good first issue Good for newcomers label Mar 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant