Place for database

Hey guys. :v:

The question is: when using UNIX systems, what is the most correct way to use a non-standard database location? Do I understand correctly that the var/lib directory is not the only place where a database can be stored ? I mean that there is a STATE_DIRECTORY variable in the concordium-mainnet-node service and “–data-dir” key, which determines the location…how to correctly change the place where the blockchain itself will be stored? Let’s say I plugged in a new drive and want to use it.

The debian package is sandboxed, meaning that the node is limited in what locations it can read or write.

Without disabling the sandboxing the way to make your database stored in an external drive is to use the “BindPaths” option

BindPaths=/media/mydrive/:%S/my-database

and then set --data-dir to STATE_DIRECTORY/my-database.

You can also just disable the sandboxing if you do not care about it. You want to remove at least DynamicUser and maybe ProtectHome and ProtectSystem. I don’t have time to analyze at the moment.

1 Like