Software for NBdomain node
You need to have NodeJS to run NBnode.
- install required modules:
npm install
- copy default config:
cd core && cp default_config.js config.js
- edit the config.js as needed
- start core service:
node core/index.js
- open browser and goto http://localhost:9000/api/?nid=1020.test to test NBdomain resolve service
- open browser and goto http://localhost:9000/web/md.1010.test to test NBdomain web service
- open browser and goto http://localhost:9000/ to view home page of this node.
You don't need to start the web server if you don't want to provide public service.
- stop the index.js if you have started it
# Allow non-root node to use ports 80 (HTTP) and 443 (HTTPS) Linux
sudo setcap 'cap_net_bind_service=+ep' $(which node)
# Allow non-root node to use ports 80 (HTTP) and 443 (HTTPS) Freebsd
sudo sysctl net.inet.ip.portrange.reservedhigh=0
- goto your domain's DNS manager to add a (A or C)record to point the domain (or subdomain) to this NBnode's IP address
- edit .\core\config.js, especially "node_info"->"domain"
- start core\index.js
note:
- you can change core/config.js to change the port number of the API server.
- a https web server comes with NBnode, please stop apache or ngnix server.
- you can download the latest db files from https://tnode.nbdomain.com/files/txs.db to core/db/ folder
- you can use tools like pm2 to make the service running in background. In this case, you can set exit_count:60 in config.js to make startCore.js restart every 60 minutes, to make it run more smoothly.
- you can create welcome.md in core/public/ folder to show welcome messages at https://yourdomain.