Preparation of configuration files

These following configuration files are used for the configuration:

  • accounts.conf – the configuration file for the accounts creation.

  • api-key-hash.conf – the configuration file for the api-key-hash and privacy-api-key-hash values creation when you choose the api-key string hash authorization.

  • node.conf – the main node configuration file defining the operational principals and an option list.

accounts.conf configuration file for the accounts creation

When specifying a path, use the “forward slash” - / as a delimiting character for directory hierarchy levels. During Linux using the value wallet must match the directory structure of the operating system, for example /home/contract/we/keystore.dat. During node setting it is prohibited to use cyrillic symbols for specifying paths to the working directory, keystore, etc.

// accounts.conf listing

accounts-generator {
  waves-crypto = yes
  chain-id = V
  amount = 1
  wallet = ${user.home}"/node/keystore.dat"
  wallet-password = "some string as password"
  reload-node-wallet {
    enabled = false
    url = "http://localhost:6862/utils/reload-wallet"
  }
}

The description of the configuration file parameters is represented below.

  • waves-crypto – the choice of a cryptographic algorithm (“yes” - use cryptography Waves, “no” - use GOST-cryptography);

  • chain-id – an identifying byte of the network, the value will be necessary further on for entry in parameter address-scheme-character of the node configuration file;

  • amount – a number of generated key pairs;

  • wallet – the path to the key storage directory on the node, the value will be required further on for entry in parameter wallet > file of the node configuration file. For the Waves cryptography, the path to file keystore.dat is specified (example, ${user.home}/nodeName/keystore.dat), for the GOST-cryptography - the path to directory (${user.home}/nodeName/keystore/);

  • wallet-password – a password for access to closed node keys, the value will be necessary further for entry into the parameter wallet > password of the node configuration file;

  • reload-node-wallet – an option to update the node keyStore without restarting the application, by default it is turned off (false). url parameter specifies the path to the /utils/reload-wallet method of the REST API node.

api-key-hash.conf configuration file

api-key-hash.conf configuration file is intended only for the api-key-hash and privacy-api-key-hash values creation when you choose the api-key string authorization.

// api-key-hash.conf listing

apikeyhash-generator {
  waves-crypto = no
  api-key = "some string for api-key"
}

Parameters description

  • waves-crypto – the choice of a cryptographic algorithm (“yes” - use cryptography Waves, “no” - use GOST-cryptography);

  • api-key – the key you need to come up with. The value of this key will need to be specified in requests to REST API node (for more details see page REST API).

node.conf node configuration file

If you are planning to connect the new node to the existing network, it will be more easy to request full configuration file from your network administrator or from any of net participants. When you are creating the configuration file from a scratch or connecting to the “Waves Enterprise Mainnet”, you can get the example of the file from our GitHub page. You can read here about changes in the node configuration file.

Warning

If your node’s version is 1.0.3 and higher you need to specify the following parameter in the node section of the node configuration file:

"features": {
"supported": [100]
}

This option becomes active when the total quantity of blocks from feature-check-blocks-period = 15000 and blocks-for-feature-activation = 10000 parameters is achieved (25 000 of blocks). These parameters are stored in the blockchain section and can not be changed during Mainnet or Partnernet connection. Nodes will not be able to connect to the network without activation of this option.

The example of the node configuration file is represented below. This file does not include such options like anchoring, Docker smart contracts and private data access groups. Also there are api-key authorization and Waves cryptography. You can find the fields description here.

Note

If you want to use additional options, set the enable field of the selected option to yes or true and configure the option section according to the description of its setting.

Warning

Please, fill ONLY the fields with the /FILL/ word inside as a value.

 node {
 # Type of cryptography
 waves-crypto = yes

 # Node owner address
 owner-address = " /FILL/ "

 # NTP settings
 ntp {
   server = "pool.ntp.org"

   # Maximum time without synchronization. Required for PoA consensus.
   fatal-timeout = 5 minutes
 }

 # Node "home" and data directories to store the state
 directory = "/node"
 data-directory = "/node/data"

 wallet {
   # Path to keystore.
   file = "/node/keystore.dat"

   # Access password
   password = " /FILL/ "
 }

 # Blockchain settings
 blockchain {
   type = CUSTOM
   fees.enabled = false
   consensus {
     type = "poa"
     round-duration = "17s"
     sync-duration = "3s"
     ban-duration-blocks = 100
     warnings-for-ban = 3
     max-bans-percentage = 40
   }
   custom {
     address-scheme-character = "E"
     functionality {
       feature-check-blocks-period = 1500
       blocks-for-feature-activation = 1000
       pre-activated-features = { 2 = 0, 3 = 0, 4 = 0, 5 = 0, 6 = 0, 7 = 0, 9 = 0, 10 = 0, 100 = 0 }
     }

     # Mainnet genesis settings
     genesis {
       average-block-delay: 60s
       initial-base-target: 153722867

       # Filled by GenesisBlockGenerator
       block-timestamp: 1573472578702

       initial-balance: 1625000000000000

       # Filled by GenesisBlockGenerator
       genesis-public-key-base-58: ""

       # Filled by GenesisBlockGenerator
       signature: ""

       transactions = [
           # Initial token distribution:
           # - recipient: target's blockchain address (base58 string)
           # - amount: amount of tokens, multiplied by 10e8 (integer)
           #
           #     Example: { recipient: "3HQSr3VFCiE6JcWwV1yX8xttYbAGKTLV3Gz", amount: 3000000000000000 }
           #
           # Note:
           #   Sum of amounts must be equal to initial-balance above.
           #
         { recipient: " /FILL/ ", amount: 100000000000000 },
         { recipient: " /FILL/ ", amount: 150000000000000 },
         { recipient: " /FILL/ ", amount: 50000000000000 },
       ]
       network-participants = [
           # Initial participants and role distribution
           # - public-key: participant's base58 encoded public key;
           # - roles: list of roles to be granted;
           #
           #     Example: {public-key: "EPxkVA9iQejsjQikovyxkkY8iHnbXsR3wjgkgE7ZW1Tt", roles: [permissioner, miner, connection_manager, contract_developer, issuer]}
           #
           # Note:
           #   There has to be at least one miner, one permissioner and one connection_manager for the network to start correctly.
           #   Participants are granted access to the network via GenesisRegisterNodeTransaction.
           #   Role list could be empty, then given public-key will only be granted access to the network.
           #
         { public-key: " /FILL/ ", roles: [permissioner, miner, connection_manager, contract_developer, issuer]},
         { public-key: " /FILL/ ", roles: [miner]},
         { public-key: " /FILL/ ", roles: []},
       ]
     }
   }
 }

 # Application logging level. Could be DEBUG | INFO | WARN | ERROR. Default value is INFO.
 logging-level = DEBUG

 features.supported = [100]

 # P2P Network settings
 network {
   # Network address
   bind-address = "0.0.0.0"
   # Port number
   port = 6864

   # Peers network addresses and ports
   #   Example: known-peers = ["node-1.com:6864", "node-2.com:6864"]
   known-peers = [  /FILL/  ]

   # Node name to send during handshake. Comment this string out to set random node name.
   #   Example: node-name = "your-we-node-name"
   node-name = " /FILL/ "

   # How long the information about peer stays in database after the last communication with it
   peers-data-residence-time = 2h

   # String with IP address and port to send as external address during handshake. Could be set automatically if uPnP is enabled.
   #   Example: declared-address = "your-node-address.com:6864"
   declared-address = "0.0.0.0:6864"
 }

 # New blocks generator settings
 miner {
   enable = yes
   # Important: use quorum = 0 only for testing purposes, while running a single-node network;
   # In other cases always set quorum > 0
   quorum = 0
   interval-after-last-block-then-generation-is-allowed = 10d
   micro-block-interval = 5s
   min-micro-block-age = 3s
   max-transactions-in-micro-block = 500
   minimal-block-generation-offset = 200ms
 }

 # Nodes REST API settings
 rest-api {
   # Enable/disable REST API
   enable = yes

   # Network address to bind to
   bind-address = "0.0.0.0"

   # Port to listen to REST API requests
   port = 6862

   auth {
     type: "api-key"

     # Hash of API key string
     # You can obtain hashes by running ApiKeyHash generator
     api-key-hash: " /FILL/ "

     # Hash of API key string for PrivacyApi routes
     privacy-api-key-hash: " /FILL/ "
   }
 }

 #Settings for Privacy Data Exchange
 privacy {
   storage {
     enabled = false
     # url = "jdbc:postgresql://postgres:5432/node-1?user=postgres&password=wenterprise"
     # driver = "org.postgresql.Driver"
     # profile = "slick.jdbc.PostgresProfile$"

     # user = "postgres@postgres&password=wenterprise"
     # password = "wenterprise"

     # connectionPool = HikariCP
     # connectionTimeout = 5000
     # connectionTestQuery = "SELECT 1"
     # queueSize = 10000
     # numThreads = 20
     # schema = "public"
     # migration-dir = "db/migration"
   }
 }


 # Docker smart contracts settings
 docker-engine {
   # Docker smart contracts enabled flag
   enable = no

   # Basic auth credentials for docker host
    #docker-auth {
    #  username = "some user"
    #  password = "some password"
    #}

   # Optional connection string to docker host
    docker-host = "unix:///var/run/docker.sock"

   # Optional string to node REST API if we use remote docker host
   # node-rest-api = "node-0"

   # Execution settings
   execution-limits {
     # Contract execution timeout
     timeout = 10s
     # Memory limit in Megabytes
     memory = 512
     # Memory swap value in Megabytes (see https://docs.docker.com/config/containers/resource_constraints/)
     memory-swap = 0
   }

   # Reuse once created container on subsequent executions
   reuse-containers = yes

   # Remove container with contract after specified duration passed
   remove-container-after = 10m

   # Allows net access for all contracts
   allow-net-access = yes

   # Remote registries auth information
   remote-registries = []

   # Check registry auth on node startup
   check-registry-auth-on-startup = yes

   # Contract execution messages cache settings
   contract-execution-messages-cache {
     # Time to expire for messages in cache
     expire-after = 60m
     # Max number of messages in buffer. When the limit is reached, the node processes all messages in batch
     max-buffer-size = 10
     # Max time for buffer. When time is out, the node processes all messages in batch
     max-buffer-time = 100ms
   }
 }
}