Setting up the config File

The configuration file of Nxt is an important tool for you to setup how Nxt works on your computer.

With the configuration file you can setup your Nxt to use SSL, Setup Nxt on a Raspberry Pi or configure your Nxt for development, like the example used here.​

The configuration file

You already have a configuration file you can see all current settings

nxt/conf/nxt-default.properties

For developing purposes, please create a file in nxt/conf/ and name it nxt.properties

Please copy the code below in your nxt.properties file.

​

# Enable Cross Origin Filter for the API server.

nxt.apiServerCORS=true

​

# Enable Cross Origin Filter for NRS user interface server.

nxt.uiServerCORS=true

If you want to develop on testnet, please add

# Never unlock your real accounts on testnet! Use separate accounts for testing only.

# When using testnet, all custom port settings will be ignored,

# and hardcoded ports of 6874 (peer networking), 6875 (UI) and 6876 (API) will be used.

nxt.isTestnet=true

Instead of hosting Nxt yourself, you can decide to get information from any other node in the Nxt network. In my examples I will be using http://localhost:7876. This is when you are using Nxt on your personal computer or server. A list of other nodes you could use for displaying data on your website or access Nxt can be found on websites that provide access to the Nxt network like:

Nxtpeers.com or PeerExplorer.com

Instead of using http://localhost:7876 you could then for exampe enter an IP like http://x.x.x.x:7876 to get information from a node instead of localhost.

When you want to have control over the node, which version it runs, which information can be accessed or how many data sets the API retreives, it makes sense to have your own node running with the configuration you prefer.

If you are looking for more information on the API, documentation and more I recommend the Nxt Wiki

Find also how to create your own public node or host your node with amazon AWS.

By: Tosch