Newbie questions about config.json

My new Ubuntu node is now running using the default configuration (i.e. no config.json file in /usr/lib/algorand). I understand that this makes it a non-relay, non-archival node.

The testnet instance has fully sync’d and the mainnet has a couple of days left to go.

I’m now wishing to explore the different configuration options: the first of which is turning the testnet instance into a archival node.

Node Configuration Settings has raised some questions in my mind. Hopefully you can clairify a few things (and perhaps it can feed back into the documentation - unless I’m being particularly dumb).

I have found config.json.example in /var/lib/algorand, but not in /var/lib/algorand_testnet (no ‘sudo cp’ of config.json.example was mentioned in Switch Networks. Am I correct in thinking that the two instances (mainnet and testnet) can have different configuration and that I can simply drop an appropriate config.json in /var/lib/algorand_testnet and stop and start the testnet node?

Given that my node sync’d with the defaults will mean that it will have discarded all but the last 1000 blocks, so I am expecting that my testnet node will start again pulling all the blocks it does not currently have. Will my node have to revalidate all these blocks a second time or is there a simple hash comparison with the information it has aready compiled?

The first item in config.json.example is the “Version” (set to 8 in the one I’m looking at). Does this refer to the config example or does the Version number reference the version of algod that is running? (and if so, then how is this handled when the node needs to be upgraded?)

The rest of the items in config.json.example are in alphabetic order - it is a shame that Node Configuration Settings doesn’t follow the same alphabetic order which would make cross-referencing easier.

I have noticed the following anolmalies in the documentation:

  • ReconnectTime is specified in seconds and the default is 60 - yet the value in config.json.example is 60000000000. Should config.json be 60 or should the documentation state it is specified in nanoseconds?
  • The text states that BaseLoggerDebugLevel default is 4 whereas the right-hand column states 1 (config.json.example has 4)
  • There are a number of items in config.json.example which are not described in the Node Configuration Settings. Where can I find a definitive list and their explanation?

I can answer my first two questions from experience:

A config.json in /var/lib/algorand_testnet/ results in the testnet instance operating using that config. This is indepedent of the configuration used for the mainnet instance.

A change of “Archival” from false to true results in the node starting to sync again from the genesis block. Unless I’ve missed a trick, there is no quick way to convert a non-acrchival node into an archival node.

Oh well, it’ll be a few more days before both my testnet and mainnet node instances are sync’d!

@rmb,

As you’ve already figured out, the config.json is per data directory. Each one of your instances are running independently of others.

The version 8 is the version of the config.json file. Between different releases, we occasionally change the default values. When doing so, we want to change only the values that haven’t been explicitly set by the end-user in the config.json file. The version 8 helps us to archive that by providing an upgrade path for the values that have not been changed.

i.e. if you are running a node that is using version 8, you can keep upgrading the binaries to a newer versions, and they would keep working with your config.json correctly. You should not need to ever change the version field on your own. If you do want to “rebase” your changes, pick a newer config.json file ( let’s call it version 10 ), and make your changes there.

  • ReconnectTime should be 60000000000 ( 60 seconds )
  • BaseLoggerDebugLevel is suggested to be 4. You can use 1 if you want debug messages to be printed to the log file, but note that it might slow down your node.

The configuration options are rapidly evolving, and the documentation around there might lag behind. We try to document the values that we believe are useful for the majority of the end-users. If you want to review some of the in-code documentation, you can take a look on the source code comments : https://github.com/algorand/go-algorand/blob/master/config/config.go

@tsachi Thanks for the pointers on config.
I’ll come back to the conversion to archival / sync time topic on another thread.