status-go/config
Samuel Hawksby-Robinson 07e46714f0
Anon Metrics Broadcast (#2198)
* Protobufs and adapters

* Added basic anon metric service and config init

* Added fibonacci interval incrementer

* Added basic Client.Start func and integrated interval incrementer

* Added new processed field to app metrics table

* Added id column to app metrics table

* Added migration clean up

* Added appmetrics GetUnprocessed and SetToProcessedByIDs and tests

There was a wierd bug where metrics in the db that did not explicitly insert a  value would be NULL, so could not be found by . In addition I've added a new primary id field to the app_metrics table so that updates could be done against very specific metric rows.

* Updated adaptors and db to handle proto_id

I need a way to distinguish individual metric items from each other so that I can ignore the ones that have been seen before.

* Moved incrementer into dedicated file

* Resolve incrementer test fail

* Finalised the main loop functionality

* Implemented delete loop framework

* Updated adaptors file name

* Added delete loop delay and quit, and tweak on RawMessage gen

* Completed delete loop logic

* Added DBLock to prevent deletion during mainLoop

* Added postgres DB connection, integrated into anonmetrics.Server

* Removed proto_id from SQL migration and model

* Integrated postgres with Server and updated adaptors

* Function name update

* Added sample config files for client and server

* Fixes and testing for low level e2e

* make generate

* Fix lint

* Fix for receiving an anonMetricBatch not in server mode

* Postgres test fixes

* Tidy up, make vendor and make generate

* delinting

* Fixing database tests

* Attempted fix of does:  cannot open `does' (No such file or directory)
not:   cannot open `not' (No such file or directory)
exist: cannot open `exist' (No such file or directory) error on sql resource loas

* Moved all anon metric postgres migration logic and sources into a the protocol/anonmetrics package or sub packages. I don't know if this will fix the does:  cannot open `does' (No such file or directory)
not:   cannot open `not' (No such file or directory)
exist: cannot open `exist' (No such file or directory) error that happens in Jenkins but this could work

* Lint for the lint god

* Why doesn't the linter list all its problems at once?

* test tweaks

* Fix for wakuV2 change

* DB reset change

* Fix for postgres db migrations fails

* More robust implementation of postgres test setup and teardown

* Added block for anon metrics functionality

* Version Bump to 0.84.0

* Added test to check anon metrics broadcast is deactivated

* Protobufs and adapters

* Added basic anon metric service and config init

* Added new processed field to app metrics table

* Added id column to app metrics table

* Added migration clean up

* Added appmetrics GetUnprocessed and SetToProcessedByIDs and tests

There was a wierd bug where metrics in the db that did not explicitly insert a  value would be NULL, so could not be found by . In addition I've added a new primary id field to the app_metrics table so that updates could be done against very specific metric rows.

* Updated adaptors and db to handle proto_id

I need a way to distinguish individual metric items from each other so that I can ignore the ones that have been seen before.

* Added postgres DB connection, integrated into anonmetrics.Server

* Removed proto_id from SQL migration and model

* Integrated postgres with Server and updated adaptors

* Added sample config files for client and server

* Fix lint

* Fix for receiving an anonMetricBatch not in server mode

* Postgres test fixes

* Tidy up, make vendor and make generate

* Moved all anon metric postgres migration logic and sources into a the protocol/anonmetrics package or sub packages. I don't know if this will fix the does:  cannot open `does' (No such file or directory)
not:   cannot open `not' (No such file or directory)
exist: cannot open `exist' (No such file or directory) error that happens in Jenkins but this could work
2021-09-01 13:02:18 +01:00
..
cli Anon Metrics Broadcast (#2198) 2021-09-01 13:02:18 +01:00
README.md drop AdvertiseAddr from default configuration 2021-08-19 16:53:31 +02:00
status-chain-genesis.json Streamline configuration in status-go. Part of #1180 (#1183) 2018-09-13 18:31:29 +02:00

README.md

Introduction

This document describes the available options in the JSON config for status-go.

The structure of the JSON config is defined in the params/config.go file, which also contains detailed comments on meaning of each option. The NodeConfig struct defines the general configuration keys at the root of the JSON file.

If the descriptions of any options are too vague feel free to open an issue.

Example config files can be viewed in the config/cli folder.

Important Sections

The JSON config is separated into several sections. The most important ones are listed below.

NodeConfig

The root of the JSON configuration.

An example of most important settings would include:

{
    "NetworkID": 1,
    "DataDir": "/tmp/status-go-data",
    "NodeKey": "123qwe123qwe123qwe123",
    "Rendezvous": false,
    "NoDiscovery": false,
    "ListenAddr": "0.0.0.0:30303",
    "RegisterTopics": ["whispermail"]
}

If you'd want to enable JSON RPC port you'd need:

{
    "HTTPEnabled": true,
    "HTTPHost": "0.0.0.0",
    "HTTPPort": 8545,
    "APIModules": "eth,net,web3,admin"
}

In order to adjust logging settings you'd need:

{
    "LogFile": "/var/log/status-go.log",
    "LogLevel": "INFO",
    "LogMaxSize": 200,
    "LogMaxBackups": 5,
    "LogCompressRotated": true
}

Valid LogLevel settings are: ERROR, WARN, INFO, DEBUG, TRACE

WakuConfig

If you want your node to relay Waku(modified Whisper) protocol messages you'll want to include this:

{
    "WakuConfig": {
        "Enabled": true,
        "EnableMailServer": true,
        "DataDir": "/tmp/status-go-data/waku",
        "MailServerPassword": "status-offline-inbox"
    }
}

The MailServerPassword is used for symmetric encryption of history requests.

By default it will use leveldb embedded database. To use postgres instead you need to add this to your config:

{
    "DatabaseConfig": {
      "PGConfig": {
        "Enabled": true,
        "URI": "postgres://user:password@host:port?options"
      }
    }
}

NOTE: The default password used by Status App and our mailservers is status-offline-inbox.

ClusterConfig

This config manages what peers and bootstrap nodes your status-go instance connects when it starts.

{
  "ClusterConfig": {
    "Enabled": true,
    "Fleet": "eth.prod",
    "BootNodes": [
      "enode://345ert345ert@23.45.67.89:30404"
    ],
    "TrustedMailServers": [
      "enode://qwe123qwe123@98.76.54.32:30504"
    ],
    "StaticNodes": [
      "enode://123qwe123qwe@12.34.56.78:30305"
    ]
  }
}

BootNodes help the status-go instance find peers. They are more important to have than StaticNodes or TrustedMailServers, which are just statically added peers on start.