Web xml configuration file

From Nxt Wiki
Jump to: navigation, search

Warning! web.xml are no longer supported (version 0.8.0). The main configuration file for your Nxt software is a file called conf/nxt-default.properties

The main configuration file for your Nxt software is a file called web.xml, which is located under the root directory of your Nxt installation, in ./webapps/root/WEB-INF/web.xml. A copy of the default web.xml file is included below. There are a number of parameters that can be set, in the file, to tweak your software's performance.

Each parameter is written in this format:

		<init-param>
			<param-name>parameterName</param-name>
			<param-value>parameterValue</param-value>
		</init-param>

To change a parameter, just edit its corresponding parameterValue.

This page only provides information on parameters that are often edited. Many of the settings in this file should not be changed unless you really know what you're doing.

1 myAddress

Default value: null

Determines the "address" that will be used to describe your node. If you announce the address of your host in this parameter, the value must be set to the same value returned by http://localhost:7874/nxt?requestType=getMyInfo

2 shareMyAddress

Default value: true

Can be set to true or false; determines whether or not your software will advertise its presence to the network.

3 myPlatform

Default value: PC

Can be set to any string (text) value, to describe the platform your software is running on. Used for informational purposes only. Commonly-used values are PC, MacOS, Linux, CentOS, Debian, RaspberryPi, and VPS.

4 myHallmark

Default value: null

Optional parameter; set to the value of your node's hallmark. See How To: Create A Hallmark

5 wellKnownPeers

Default value: a pre-defined list of Nxt server addresses

There are a very large number of "well-known" Nxt servers on the network. These are public nodes that are "hallmarked" and therefore are more trusted than other nodes. Having a large list of well-known peers will make it easier for your software to connect to other servers and keep up to date with the blockchain.

It is in the best interest of the network for this list to vary from server to server. You can generate a random list of peer nodes at http://nxtra.org/nodes, or build one based on the servers listed in the Nxt peer explorer.

6 maxNumberOfConnectedPublicPeers

Default value: 20

Defines the maximum number of active peer connections your software will try to maintain.

7 connectTimeout

Default: 2000

In milliseconds. Determines the maximum time your server will wait before timing out on a connection to another server.

8 readTimeout

Default: 5000

In milliseconds. Determines the maximum time your server will wait to read data from another server connection.

9 pushThreshold

Default: 0

Used to determine minimum allowed weight for peers to send data to. If you send a lot of payments, you should set pushThreshold to 1 or higher, but this increases the chance that transactions won't be seen by most peers.

10 pullThreshold

Default: 0

Used to determine minimum allowed weight for peers to receive data from.

11 allowedUserHosts

Default: 127.0.0.1; localhost; 0:0:0:0:0:0:0:1;

Determines the IPv4 and IPv6 addresses that will be allowed to connect to your server and use the NRS web-based client. By default, only "localhost" (or equivalents) are permitted. If you want to access your server from elsewhere, add other IP addresses here. If you want to allow connections from anywhere, set this to *

12 allowedBotHosts

Default: 127.0.0.1; localhost; 0:0:0:0:0:0:0:1;

Determines the IPv4 and IPv6 addresses that will be allowed to connect to your server and use API calls. By default, only "localhost" (or equivalents) are permitted. If you want to access your server from elsewhere, add other IP addresses here. If you want to allow connections from anywhere, set this to *

13 blacklistingPeriod

Default: 300000

Expressed in seconds. Sets the time when blacklisted nodes are automatically "unblacklisted".

14 communicationLoggingMask

Default: 0

Change this value to increase the amount of message logging in the Java console.

  • 1: log exceptions
  • 2: log responses with non-200 HTTP response codes
  • 4: log response with 200 HTTP response codes
  • Add any of the above values together to log more than one kind of message (e.g. 2&1=3; 4&1=5. Possible values are 1-7)

15 Default webxml file

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>
	<servlet>
		<servlet-name>Nxt</servlet-name>
		<servlet-class>Nxt</servlet-class>
		<async-supported>true</async-supported>
		<load-on-startup>1</load-on-startup>

		<init-param>
			<param-name>blockchainStoragePath</param-name>
			<param-value>blockchain.nrs</param-value>
		</init-param>

		<init-param>
			<param-name>myScheme</param-name>
			<param-value>http</param-value>
		</init-param>

		<init-param>
			<param-name>myPort</param-name>
			<param-value>7874</param-value>
		</init-param>

		<init-param>
			<param-name>myAddress</param-name>
			<param-value></param-value>
		</init-param>

		<init-param>
			<param-name>shareMyAddress</param-name>
			<param-value>true</param-value>
		</init-param>

        <init-param>
            <param-name>myPlatform</param-name>
            <param-value>PC</param-value>
        </init-param>

		<init-param>
			<param-name>myHallmark</param-name>
			<param-value></param-value>
		</init-param>

		<init-param>
			<param-name>wellKnownPeers</param-name>
			<param-value>87.230.14.1; 46.19.137.116; 95.85.22.142; node18.nxtbase.com; node10.nxtbase.com; vps1.nxtcrypto.org; vps2.nxtcrypto.org; vps3.nxtcrypto.org; vps4.nxtcrypto.org; vps5.nxtcrypto.org; node16.nxtbase.com; node09.nxtbase.com; node29.nxtbase.com; 162.243.214.183; 162.243.213.115; 78.46.63.221; 95.85.46.233; 162.243.140.133; 146.185.129.54; 162.243.143.15; 109.230.224.65; 46.165.208.107:32151; 54.249.101.252; 37.209.120.192; 84.112.39.24; 78.46.63.221; 69.163.47.173; 95.85.46.233; 162.243.140.133; 146.185.129.54; 162.243.117.63; 192.241.155.44; 162.243.214.68; 95.85.46.164; 162.243.216.55; 162.243.143.15; 95.85.46.249; 93.190.92.74; 37.209.120.192; 93.190.92.75; 85.25.134.59; 93.190.92.76; nxtwallet.com; 31.220.50.208; nxt.ddos.me; 203.174.12.25; 88.198.142.92; 66.197.138.90; 64.120.180.106; 109.230.224.65; 80.86.92.50; node1.nextcoin.it; node2.nextcoin.it; node3.nextcoin.it; node4.nextcoin.it; node5.nextcoin.it; nxt.homer.ru; 31.204.130.123; 209.222.0.194; 209.222.16.10;</param-value>
		</init-param>

		<init-param>
			<param-name>wellKnownPeers2</param-name>
			<param-value>87.230.14.1; 46.19.137.116; 95.85.22.142; 162.243.214.183; scum2.bounceme.net; 162.243.213.115; node11.nxtbase.com; 78.46.63.221; scum5.bounceme.net; scum4.bounceme.net; vps5.nxtcrypto.org; node16.nxtbase.com;</param-value>
		</init-param>

		<init-param>
			<param-name>maxNumberOfConnectedPublicPeers</param-name>
			<param-value>20</param-value>
		</init-param>

		<init-param>
			<param-name>connectTimeout</param-name>
			<param-value>2000</param-value>
		</init-param>

		<init-param>
			<param-name>readTimeout</param-name>
			<param-value>5000</param-value>
		</init-param>

		<init-param>
			<param-name>enableHallmarkProtection</param-name>
			<param-value>true</param-value>
		</init-param>

		<init-param>
			<param-name>pushThreshold</param-name>
			<param-value>0</param-value>
		</init-param>

		<init-param>
			<param-name>pullThreshold</param-name>
			<param-value>0</param-value>
		</init-param>

		<init-param>
			<param-name>allowedUserHosts</param-name>
			<param-value>127.0.0.1; localhost; 0:0:0:0:0:0:0:1;</param-value>
		</init-param>

		<init-param>
			<param-name>allowedBotHosts</param-name>
			<param-value>127.0.0.1; localhost; 0:0:0:0:0:0:0:1;</param-value>
		</init-param>

		<init-param>
			<param-name>blacklistingPeriod</param-name>
			<param-value>300000</param-value>
		</init-param>

		<init-param>
			<param-name>communicationLoggingMask</param-name>
			<param-value>0</param-value>
		</init-param>

	</servlet>
	<servlet-mapping>
		<servlet-name>Nxt</servlet-name>
		<url-pattern>/nxt</url-pattern>
	</servlet-mapping>

	<filter>
		<filter-name>DoSFilter</filter-name>
		<filter-class>org.eclipse.jetty.servlets.DoSFilter</filter-class>
		<init-param>
			<param-name>maxRequestsPerSec</param-name>
			<param-value>3000</param-value>
		</init-param>
		<init-param>
			<param-name>delayMs</param-name>
			<param-value>1000</param-value>
		</init-param>
		<init-param>
			<param-name>trackSessions</param-name>
			<param-value>false</param-value>
		</init-param>
		<async-supported>true</async-supported>
	</filter>
	
	<filter-mapping>
		<filter-name>DoSFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
</web-app>