Granola-Team / mina-indexer

The Mina Indexer is a re-imagined version of the software collectively called the "Mina archive node."
Apache License 2.0
19 stars 10 forks source link

The default config options are broken on macOS #662

Closed trevorbernard closed 3 months ago

trevorbernard commented 7 months ago
$ mina-indexer server start
Error: Permission denied (os error 13)

The problem is that on darwin system, it protects the /usr directory

jhult commented 7 months ago

Just bumped into the same. The log directory has issues too. I think the following may have worked around the log directory issue for me:

sudo mkdir -p /var/log/mina-indexer/
sudo chown -R jonathan:admin /var/log/mina-indexer/
jhult commented 7 months ago

Cause: https://github.com/Granola-Team/mina-indexer/commit/edc5a07f10b8c3928f545f3cea3733ccafee2487 via #648

Isaac-DeFrain commented 7 months ago

Is this issue resolved? @jhult's solution worked for me

jhult commented 5 months ago

This makes running and testing on macOS tricky as you have to be sure to apply a workaround.

trevorbernard commented 5 months ago

This is my work around. This exists in the root of the rust directory:

#!/usr/bin/env bash

BLOCKS_DIR=~/.mina-indexer/blocks
STAKING_LEDGERS_DIR=~/.mina-indexer/staking-ledgers
GENESIS_LEDGERS_DIR=~/.mina-indexer/genesis-ledgers
DATABASE_DIR=~/.mina-indexer/database

IDXR="$(pwd)"/target/release/mina-indexer
DOMAIN_SOCKET_PATH="$(pwd)"/mina-indexer.sock

mina-indexer() {
    "$IDXR" "$@"
}

mina-indexer server start \
        --blocks-dir "$BLOCKS_DIR" \
        --staking-ledgers-dir "$STAKING_LEDGERS_DIR" \
        --database-dir "$DATABASE_DIR" \
        --log-level debug 2>&1
robinbb commented 5 months ago

Blocked on #920 and #921. After those are complete, then all that remains is to set good defaults for blocks directory and staking ledgers directory.

robinbb commented 4 months ago

Also blocked on #1082 .

robinbb commented 4 months ago

I no longer use Nix on my MacOS machine, so it is difficult for me to work on this issue.

Since the Indexer is a server, then by the Linux FHS, one would expect the logs in /var/log/mina-indexer despite the fact that this is a read-only directory for non-root users.

So, @jhult, what is the status of this issue, now that various blocking issues have changed? Do we expect to be able to start the server without arguments when we are not root?

jhult commented 3 months ago

As long as you set VOLUMES_DIR to a writable directory, this is no longer an issue.

Example: export VOLUMES_DIR="~/.mina-indexer"

jhult commented 3 months ago

Related: https://github.com/Granola-Team/mina-indexer/issues/1272

robinbb commented 3 months ago

As long as you set VOLUMES_DIR to a writable directory, this is no longer an issue.

I'll close, since this is no longer an issue.