[OUTDATED] - How to setup Unchained node (full) testnet - Centos 7 and MongoDB local

This assumes you just installed Centos 7 and nothing else is installed apart from minimal software.

I didn’t cover the security hardening step as it’s the same as outlined on the github quick start. I’ll probably come back and fix all the formatting and explain the hardening steps after Christmas when I have some more time.

1) Add create the repository entry for mongodb:
vi /etc/yum.repos.d/mongodb-org-7.0.repo
or
nano -w /etc/yum.repos.d/mongodb-org-7.0.repo
Contents of the file:

[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc

2) Udpate packages now u have added shit to the repos:
yum update
3) install mongodb now u have it in the repos:
sudo yum install -y mongodb-org
4) install shit required for nodejs:
yum install -y gcc-c++ make - Installs c++ compiler and make
5) install node:

curl -sL https://rpm.nodesource.com/setup_18.x | sudo -E bash - 
sudo yum install https://rpm.nodesource.com/pub_16.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
sudo yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1

6) check node is installed
node -v
7) enable mongodb on boot:

systemctl status mongod
systemctl enable mongod
systemctl start mongod

8) log into mongodb:
mongosh

9) Create the DB that kenshi will use:
use unchained;
10) Insert a blank collection called ‘products’ to create the database.
db.products.insert( { item: "card", qty: 15 } )

11) quit mongodb shell:
exit

12) Update your database config settings. Specifically the URL and name of the DB.

database:
  url: mongodb://localhost/?retryWrites=true&w=majority 
  name: unchained

Full config looks like this (minus my sekrit key because NO):

log: info
name: SomeName
lite: false
gossip: 24
rpc:
  ethereum:
    - https://ethereum.publicnode.com
    - https://eth.llamarpc.com
    - wss://ethereum.publicnode.com
    - https://eth.rpc.blxrbdn.com
database:
  url: mongodb://localhost/?retryWrites=true&w=majority 
  name: unchained
peers:
  max: 512
  parallel: 16

At this stage you can start your node and check that it connects to the DB. If so, you’ll now want to create a user acc to run connect to unchained DB.

Here: https://www.mongodb.com/docs/manual/tutorial/enable-authentication/
and
Here: https://www.mongodb.com/docs/manual/tutorial/create-users/#configure-users-for-self-hosted-deployments

4 Likes

Excellent guide fren

1 Like

This tutorial is outdated and therefore archived.