Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing Substrate networks #1168

Merged
merged 55 commits into from
Dec 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
c7060bd
Substrate support preview
droserasprout Oct 18, 2024
c74899b
store metadata in localshare, use latest, fix docstrings
droserasprout Oct 18, 2024
24919d1
alternative demo
droserasprout Oct 20, 2024
f0406bd
merge demos, http replay fixes
droserasprout Oct 20, 2024
aec763f
Misc refactoring, fixes
droserasprout Oct 22, 2024
90f6b43
Preserve jsonschemas in xdg dir
droserasprout Oct 22, 2024
a2a1f43
docs
droserasprout Oct 22, 2024
dd2368a
Fix CallbackError wrapping, type registries in file
droserasprout Oct 23, 2024
4da75a0
typo
droserasprout Oct 23, 2024
55f5ce3
Use built-in registries when available
droserasprout Oct 23, 2024
3001086
fixes, typeddicts
droserasprout Oct 23, 2024
d8eb4be
is_finalized property
droserasprout Oct 27, 2024
9fc2160
refactoring, chagelog
droserasprout Oct 29, 2024
839bd21
notes
droserasprout Oct 30, 2024
9cbcd7a
dev progress substrate events decoding
Nov 18, 2024
49d121d
fix debug decoding
Nov 18, 2024
6d2cd2c
decoding fix
droserasprout Nov 19, 2024
3a5f7cf
correct metadata for subsquid event decoding, small inheritance fixes
Nov 20, 2024
ef3e06f
use forked substrateinterface
droserasprout Nov 22, 2024
89567b7
fix import
droserasprout Nov 22, 2024
3fe0b21
events from node working prototype
Nov 25, 2024
bfeb187
subscriptions demo
Dec 8, 2024
69ec04a
org imports
Dec 8, 2024
3093df8
switch aiosubstrate
droserasprout Dec 8, 2024
b7b31e4
subscriptions complete demo
Dec 9, 2024
4d50caa
refactoring fixes
Dec 11, 2024
86fd6fe
Merge branch 'next' into dev/substrate-events
droserasprout Dec 12, 2024
c61cf00
Fix subscription handling in SubstrateNodeDatasource
Dec 12, 2024
d5cb5ca
fix subscriptions
droserasprout Dec 13, 2024
57e3fe4
Handle exit sync state in Index class
Dec 14, 2024
e5b5374
revert
Dec 14, 2024
a290961
tiny fixes
droserasprout Dec 14, 2024
ca76333
fix node only mode
droserasprout Dec 14, 2024
9acbb4a
lint, fix session management
droserasprout Dec 14, 2024
556382d
attach interface when possible
droserasprout Dec 15, 2024
641fe1b
update not matched objects
Dec 15, 2024
be7b3e7
fix metric stats
droserasprout Dec 15, 2024
5ca8405
refactor speed formatting in logging for better readability
Dec 15, 2024
a64ede3
fix refs
droserasprout Dec 16, 2024
c2e631f
Merge branch 'next' into dev/substrate-events
droserasprout Dec 16, 2024
bd931c8
misc typing
droserasprout Dec 16, 2024
e0817cd
Merge branch 'next' into dev/substrate-events
droserasprout Dec 16, 2024
4cb6fd0
cleanup
droserasprout Dec 16, 2024
03679d0
refactor: enhance Substrate event handling and typing
Dec 19, 2024
7fe38a4
docs
droserasprout Dec 19, 2024
2caa2ef
vars naming
droserasprout Dec 19, 2024
4922893
typing, refs, update head ts
droserasprout Dec 19, 2024
180d55c
Merge branch 'next' into dev/substrate-events
droserasprout Dec 20, 2024
bb3e911
cleanup
droserasprout Dec 22, 2024
e4605b6
Merge branch 'next' into dev/substrate-events
droserasprout Dec 22, 2024
8ba27d6
Docs
droserasprout Dec 22, 2024
4100e80
Rename abi.etherscan
droserasprout Dec 22, 2024
e88469c
lock
droserasprout Dec 22, 2024
130bdbe
update demo
droserasprout Dec 22, 2024
3b9b54c
release notes
droserasprout Dec 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use built-in registries when available
droserasprout committed Oct 23, 2024
commit 55f5ce331fa08d18f0acafb7e0b931eeeecb29e3
12 changes: 10 additions & 2 deletions src/dipdup/runtimes.py
Original file line number Diff line number Diff line change
@@ -33,8 +33,16 @@ def extract_args_name(description: str) -> list[str]:
def get_type_registry(name_or_path: str | Path) -> 'RuntimeConfigurationObject':
from scalecodec.type_registry import load_type_registry_preset # type: ignore[import-untyped]

if isinstance(name_or_path, str) and Path(name_or_path).is_file():
name_or_path = Path(name_or_path)
if isinstance(name_or_path, str):
# NOTE: User path has higher priority
for path in (
Path(f'type_registries/{name_or_path}.json'),
Path(name_or_path),
):
if not path.is_file():
continue
name_or_path = path

if isinstance(name_or_path, Path):
return orjson.loads(name_or_path.read_bytes())
return load_type_registry_preset(name_or_path)
57 changes: 57 additions & 0 deletions src/dipdup/type_registries/hydradx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"types": {
"AssetPair": {
"asset_in": "AssetId",
"asset_out": "AssetId"
},
"Amount": "i128",
"AmountOf": "Amount",
"Address": "AccountId",
"OrmlAccountData": {
"free": "Balance",
"frozen": "Balance",
"reserved": "Balance"
},
"Fee": {
"numerator": "u32",
"denominator": "u32"
},
"BalanceInfo": {
"amount": "Balance",
"assetId": "AssetId"
},
"Currency": "AssetId",
"CurrencyId": "AssetId",
"CurrencyIdOf": "AssetId",
"Intention": {
"who": "AccountId",
"asset_sell": "AssetId",
"asset_buy": "AssetId",
"amount": "Balance",
"discount": "bool",
"sell_or_buy": "IntentionType"
},
"IntentionId": "u128",
"IntentionType": {
"_enum": [
"SELL",
"BUY"
]
},
"LookupSource": "AccountId",
"OrderedSet": "Vec<AssetId>",
"Price": "Balance",
"Chain": {
"genesisHash": "Vec<u8>",
"lastBlockHash": "Vec<u8>"
}
},
"typesAlias": {
"tokens": {
"AccountData": "OrmlAccountData"
}
},
"signedExtensions": {
"ValidateClaim": "Null"
}
}