Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Indexer support#31

Open
lermchair wants to merge 4 commits intomainfrom
lermchair/indexer
Open

Indexer support#31
lermchair wants to merge 4 commits intomainfrom
lermchair/indexer

Conversation

@lermchair
Copy link
Copy Markdown
Contributor

@lermchair lermchair commented Dec 3, 2023

This adds support for the Mud indexer. It only supports the latest version of the indexer (version 2.0.0-next.14).

What does this mean?

Instead of requesting tens of thousands of logs from the rpc and then converting them into Mud events, we simply make one call to the indexer and then load the most recent state (that's already in a Mud event format we can use) into the client in one big batch. This makes loading times faster in production, where one might have lots of players making lots of transactions.

Local setup

  1. Run an indexer locally. See: https://mud.dev/services/indexer#running-directly
  2. Set the Indexer URL in your NetworkData ScriptableObject in Unity. This should be http://localhost:3001.

User-facing changes

You can now get the status of the initial snapshot fetch and display it to the user, via SyncStep.Snapshot:
https://github.com/emergenceland/UniMUD/blob/2da0fe7668de60507e4b7a25e8ca087b0227e7e3/unimud/Packages/UniMUD/Runtime/mud/NetworkManager.cs#L250C1-L259C24

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant