-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
174 lines (108 loc) · 6.71 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
**Nexa Prerequisites**
======================
**Setting Up Cassandra**
------------------------
**Prerequisites**
Install Oracle Java Standard Edition 8 and Python 2.7 from your distro's package manager.
**Installation**
We are going to install all the necessary software under /opt directory which has sufficient disk space
(ideally 1 TB) and is mounted on an SSD.
Download Apache Cassandra 3.11.6 from this official download link and unarchive directly under /opt.
**Configuration**
Edit the config file (/opt/apache-cassandra-3.11.6/conf/cassandra.yaml)
Update the listen address appropriately,
listen_address: localhost
Also tweak the below settings appropriately per the instructions provided in the config file.
The below sample values are good for a 12 core machine
concurrent_reads: 32
concurrent_writes: 96
concurrent_counter_writes: 32
Also explicitly set the max threads configuration as below,
native_transport_max_threads: 256
To facilitate the highly concurrent application, make the following system configurations, it primarily
is meant to help Cassandra operate optimally.
/etc/security/limits.conf
* - memlock unlimited
* - nofile 100000
* - nproc 32768
* - as unlimited
/etc/sysctl.conf
vm.max_map_count = 1048575
Set the PATH environment variable as follows in your .bashrc file:
export PATH=$PATH:/opt/apache-cassandra-3.11.6/bin
Cassandra can be started using the following command
$cassandra
To stop Cassandra, we can simply get the processID and kill it.
$ps -ef |grep cassandra
$kill -9 <pid>
**Database schema setup**
Login to CQL shell (cqlsh) and execute the contents of the schema.cql file that was included in the release.
**Setting Up Neo4j**
--------------------
**Installation**
Download the official (3.5.20) release of Neo4j from here and unarchive the same under /opt.
Note: Only Neo4j version "3.5.x" is officially supported. The packaged Neo4j driver does NOT support versions 4.x.x.
**Configuration**
Edit the config file at /opt/neo4j-community-3.5.20/conf/neo4j.conf and add the following at the bottom of the file
dbms.connector.bolt.thread_pool_min_size=20
dbms.connector.bolt.thread_pool_max_size=2048
dbms.connector.bolt.thread_pool_keep_alive=5m
Also uncomment and update the following entry appropriately,
dbms.connector.default_listen_address=0.0.0.0
Login to the Neo4j web console (http://localhost:7474/) and execute the following:
CREATE CONSTRAINT ON (n:mnode) ASSERT n.v IS UNIQUE;
You can verify if the constraints have been applied correctly by querying
$ :schema
And you should see the following output,
Indexes
ON :mnode(v) ONLINE (for uniqueness constraint)
Constraints
ON ( mnode:mnode ) ASSERT mnode.v IS UNIQUE
Set the PATH environment variable as follows in your .bashrc file:
export PATH=$PATH:/opt/apache-cassandra-3.11.6/bin:/opt/neo4j-community-3.5.20/bin
neo4j can be started and stopped using the following command/s
$neo4j [start/stop/restart]
**Other packages**
------------------
Using the appropriate package manager for your Linux distribution install the below packages.
For example on Arch variants run,
sudo pacman -S libsecp256k1
sudo pacman -S leveldb
**Nexa Installation**
=====================
Download the latest stable release from the downloads page and unzip contents under /opt/xoken
The Nexa node sources configurable parameters from two different config files, as below:
- node-config.yaml: Contains all the general Nexa node, Bitcoin P2P & listen endpoint related configurations.
- arivi-config.yaml: Contains all the Arivi P2P related configurations (typically autogenerated)
**Configure**
-------------
Place the node-config.yaml (provided in the release) in the same directory as the xoken-nexa executable.
Typically you will need to update the following parameters.
- bitcoinNodeListenIP : the Nexa host's public IP that is used to interact with public Bitcoin mining nodes via BitconP2P.
- bitcoinNodeListenPort : the system port that is used to connect with public Bitcoin mining nodes.
- endPointTLSListenIP : the host's public IP where the TLS endpoint is listening.
- endPointTLSListenPort : the port being used by the TLS server. Default value of '9090' is recommended.
- tlsCertificatePath : the TLS self-signed certificate file path, including the file-name.
- tlsKeyfilePath : the TLS keyfile path, including the file-name.
- tlsCertificateStorePath : Please set to any valid directory, currently the client certificate validation is disabled.
- endPointHTTPSListenIP : listen IP for the HTTPS REST API endpoint.
- endPointHTTPSListenPort : listen port for the HTTPS REST API.
- endpointneo4jUsername : neo4j username
- neo4jPassword : neo4j password
- logLevel : Debug/Warn/Error , Debug level is very verbose and is not recommended unless you are troubleshooting.
The rest are mostly tuning related parameters and meant for advanced users.
The following command can be used to generate a TLS certificate and keyfile pair:
openssl req -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out example.crt -keyout example.key
**Running Nexa**
----------------
The Xoken Nexa server can be started as below, and it will run as a daemon process by defualt
$ ./xoken-nexa
And to stop the node you can do
$ pkill xoken-nexa
**Backup admin password & keys**
--------------------------------
Once the server has started successfully for the first time, open the nexa.log file and safely backup
the auto generated admin password, this is needed to provision other users and control user/node privileges.
Open the newly generated arivi-config.yaml file and safely backup the application generated secret key.
This is essential to restore the unique identity of your node, since nodes maintain the reputation of their peers.
e.g. secretKey: d670be193389c79349edd8ea4194925609f39cbeffc59b78fc1b4d431c0ebac