Configuration improvements

I’m working on distributing blockstack with the native macOS app. As part of this, I’d like to make sure that blockstack’s configuration gets installed in a platform appropriate location inside ~/Library (like other bundle-installed macOS apps)

It looks like we can currently set the location of the configuration file using the
BLOCKSTACK_CLIENT_CONFIG environment variable.

Running BLOCKSTACK_CLIENT_CONFIG=/Users/larry/my-blockstack-config/client.ini creates that config file and a few other files in that same directory.

  1. It seems inconsistent to be able to specify an arbitrary name for client.ini but not of the other files.

  2. It doesn’t seem to be possible to change the location of BLOCKSTACK_METADATA_DIR without editing the configuration file after it is created. BLOCKSTACK_METADATA_DIR is hardcoded to ~/.blockstack/metadata even if BLOCKSTACK_CLIENT_CONFIG creates another directory.

I’d expect that metadata would default to being in a subdirectory of the client configuration directory.

Would it make more sense to instead have an environment variable or command line option to specify a configuration directory and have the layout of files and subdirectories within that folder be consistent? (or am I using this wrong?)

Something like:
BLOCKSTACK_CLIENT_CONFIG_DIR=~/my-blockstack-config blockstack
or
blockstack --config=~/my-blockstack-config

What do you think, @jude?

Argh, this post slipped by me.

It seems inconsistent to be able to specify an arbitrary name for client.ini but not of the other files.

The configuration module assumes that it “owns” the directory with your client.ini file. I agree that it is inconsistent that the user can pick the name of the config file–this should be removed.

It doesn’t seem to be possible to change the location of BLOCKSTACK_METADATA_DIR without editing the configuration file after it is created. BLOCKSTACK_METADATA_DIR is hardcoded to ~/.blockstack/metadata even if BLOCKSTACK_CLIENT_CONFIG creates another directory.

I will fix this in rc-0.14.1b.

Would it make more sense to instead have an environment variable or command line option to specify a configuration directory and have the layout of files and subdirectories within that folder be consistent? (or am I using this wrong?)

No, you’re correct :slight_smile: I have already added this to rc-0.14.1b.

Am trying to get rc-0.14.1b merged to master as soon as possible :slight_smile:

1 Like