Skip to content

Configurations

Davide Miceli edited this page Jan 30, 2019 · 3 revisions

Configurations

The configurations are loaded by a json file. An example of configuration can be found here: test/configs/generic.json

Fields

The fields are the followings:

Field Optional Type Description
blockchain no string The name of the blockchain
organization no string The organization to which the peer belongs
role no enum(peer) The role of the peer (currently allowed only "peer")
id no string The id of the peer
db.hosts no [string] The list of database hosts
db.bucket no string Database bucket
db.username no string Database username
db.password no string Database password
kafka.hosts no [string] The list of Kafka broker hosts
kafka.topics.pending no string The name of the topic for the new proposed blocks
kafka.consumer.groupId no string The Kafka consumer group id to use
kafka.consumer.fromOffset yes boolean If set true, Kafka consumer will fetch message from the given offset in the payloads
kafka.consumer.autoCommit yes boolean The consumed messages are acked automatically by the Kafka consumer
kafka.consumer.encoding yes string Kafka message encoding (utf8)
kafka.consumer.keyEncoding yes string Kafka key message encoding (utf8)
kafka.producer.partitionerType yes integer Partitioner type (default = 0, random = 1, cyclic = 2, keyed = 3, custom = 4), default 0
webconsole.enabled yes boolean Enable/disable the web console
webconsole.host no string The ip address or the hostname of the web console server
webconsole.port yes integer The web console server port
logs.level yes enum(debug, info, warn, error) The log level to use
logs.console yes boolean To show logs on the console too
logs.path no string The path for .log files

Example

Below there is an example of configuration file:

{
  "blockchain": "blockchain",
  "organization": "brandName",
  "role": "peer",
  "id": "0000",
  "db": {
    "hosts": [
      "172.25.255.20"
    ],
    "bucket": "blockchain",
    "username": "admin",
    "password": "secret"
  },
  "kafka": {
    "hosts": [
      "172.25.255.61:9092"
    ],
    "topics": {
      "pending": "blockchain.blocks.pending"
    },
    "consumer": {
      "groupId": "brandName.0000",
      "fromOffset": false,
      "autoCommit": true,
      "encoding": "utf8",
      "keyEncoding": "utf8"
    },
    "producer": {
      "partitionerType": 2
    }
  },
  "webconsole": {
    "enabled": true,
    "host": "172.25.255.50",
    "port": 8080,
    "jwt": {
      "secret": "93f7db1df1f22a27c8b7cc609b9d5c9b7c1dba05e13f029a9e4612066c42775c86305e9d57c8c92cd30a789bc31ec011d135dc33508707c4e41512dc7502aeb8",
      "expire": "5m"
    },
    "admin": {
      "usedb": false,
      "user": "admin",
      "password": "admin"
    }
  },
  "logs": {
    "level": "debug",
    "console": true,
    "path": "./logs"
  }
}