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

The indexer gets stuck with PostgreSQL #1507

Closed
qbzzt opened this issue Sep 15, 2023 · 1 comment · Fixed by #1514
Closed

The indexer gets stuck with PostgreSQL #1507

qbzzt opened this issue Sep 15, 2023 · 1 comment · Fixed by #1514
Labels
bug Something isn't working

Comments

@qbzzt
Copy link
Contributor

qbzzt commented Sep 15, 2023

This is on MacOS with PostgreSQL 15.

  1. Clear the database.

    cd ~/Library/Application\ Support/Postgres
    rm -rf var-15 
  2. Start the database UI and click Initialize.

  3. Create fresh installation.

    git clone https://github.com/latticexyz/mud.git && cd mud && pnpm install && pnpm build
    cd ..
    pnpm create mud@main app
    # I selected vanilla, but it shouldn't matter
  4. Run the app.

    cd app; pnpm dev
  5. Wait until the app is initialized.

  6. In a separate command line, run the indexer.

    cd mud
    cd packages/store-indexer
    pnpm start:postgres:local

    Wait until it is all caught up.

  7. Get the last block indexed from the indexer.

    curl 'http://localhost:3001/trpc/findAll?batch=1&input=%7B%220%22%3A%7B%22json%22%3A%7B%22chainId%22%3A31337%2C%22address%22%3A%220x5FbDB2315678afecb367f032d93F642f64180aa3%22%7D%7D%7D' | jq '.[0].result.data.json.blockNumber'
  8. Wait a few minutes and run the same command again, see the results are unchanged.

    curl 'http://localhost:3001/trpc/findAll?batch=1&input=%7B%220%22%3A%7B%22json%22%3A%7B%22chainId%22%3A31337%2C%22address%22%3A%220x5FbDB2315678afecb367f032d93F642f64180aa3%22%7D%7D%7D' | jq '.[0].result.data.json.blockNumber'

To see in PostgreSQL:

  1. Open the psql app
  2. select * from __mud_internal.chain;
  3. Wait a few minutes
  4. select * from __mud_internal.chain;

Again, you'll see an unchanged value.

@holic
Copy link
Member

holic commented Sep 16, 2023

Thanks for the good repro steps! Fix is up: #1514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants