This is Privatess Service Node, a place for different microservices
At the moment there are 3 services
- Node service - service for registration and for displaying different information about current service node and current user
- PRNG service - service for generation ultra-high entropy random data
- Files service - a file storage and sharing service
Devblog https://ness-main-dev.medium.com/
git clone https://github.com/NESS-Network/PrivatenessToolscd PrivatenessTools
./keygen user master01 100
master01master user name100entrophy (as more as better)
./key nvs master01.key.jsonto show NVS key./key worm master01.key.jsonto show NVS value (in format)- Make blockchain NVS record in emercoin wallet or in NVS exchange here
./keygen node http://my-node.net 10 master01 "prng,files" inet 100
10tariff 10 NCH per hourmaster01master user"prng,files"PRNG and FILES servicesinetinternet network100entrophy (as more as better)
./key nvs http%3A%2F%2Fmy-node.net.key.jsonto show NVS key./key worm http%3A%2F%2Fmy-node.net.key.jsonto show NVS value (in format)- Make blockchain NVS record in emercoin wallet or in NVS exchange here
- Install Apache with .htaccess enabled, check that "AllowOverride all" directive is present in apache config file
- Install PHP 8.0+ with php-curl and php-xml mods
- Install composer package manager for php
- Detailed instructions here
- x86-64 or ARM64 version needed
- Install Emercoin wallet/daemon from here
- Configure JsonRPC connection in
~/.emercoin/emercoin.conf
example configuration:
rpcuser=user
rpcpassword=user
rpcallowip=127.0.0.1
rpcport=8332
server=1
daemon=1
- Clone PRNG
git clone https://github.com/NESS-Network/PyUHEPRNG - Change systemd configuration for apache in
/lib/systemd/apache2.serviceor in/lib/systemd/system/httpd.servicechange thePrivateTmp=falseto make/tmp/*directory readable - launch random number generator
cd PyUHEPRNGandpython server.py
- Clone Ness Service Node
git clone https://github.com/NESS-Network/NessNodeandcd NessNode
cd services/node && composer install && composer updatecd services/prng && composer install && composer updatecd services/files && composer install && composer update
- Copy node JSON key to server with node
php exec/make-config.php http%3A%2F%2Fmy-node.net.key.json wallet_id.wlp password user user 10 10Gb(node.key.json wallet_id wallet_password emc_user emc_password user_slots disk_usage_quota)
- Copy node master-user key to server with node
- RUN
php exec/reg-master-user.php master01.key.json(reg-master-user.php master_user.key.json)
- RUN
php exec/self-test.phpif it's OK it should be all green - Open $NODE_URL/node/about page, it shold display service node logo
- RUN
php exec/cron.phpif it's OK it will output OK - configure CRON utility to run
php $NESS_NODE_DIRECTORY/exec/cron.phpevery hour.
- Move to Privateness Tools directory
./nodes-update node https://node.ness.cx
./node select http%3A%2F%2Fmy-node.net
./node about http%3A%2F%2Fmy-node.net
./node userinfo
All output is made in JSON format.
if param result is error then the error message is stored in error param as string
if param result is info then the info is stored in info param as array
if param result is data then the data is stored in data param as array
All data is sent in HTTP POST or GET request and returned in JSON format
http://node-url/node/infodisplay all info about nodehttp://node-url/node/servicesoutput all available serviceshttp://node-url/node/nodesdisplay all nodes found in blockchainhttp://node-url/node/aboutdisplay about pagehttp://node-url/node/pubdisplay node public key (encryption key)http://node-url/node/verifydisplay node verify key (sign/verify key)http://node-url/node/test/auth/username/auth-idtest authentication by Auth IDhttp://node-url/node/test/authtest authentication by Two Way Encryptionhttp://node-url/node/test/auth-shadow/username/auth-idtest authentication by Auth ID using shadownamehttp://node-url/node/test/auth-shadowtest authentication by Two Way Encryption using shadownamehttp://node-url/node/get-address/username/auth-idGet user payment address or return existing one (Auth ID) Returned data: `{data: {address: 784y5t4787ytw487yt}}http://node-url/node/userinfo/username/auth-id
Display all info about user (Auth ID)
Returned data: {data: {'addr': 'hw9gw4rogj', 'counter': 0, 'balance': {'coins': 5000, 'hours': 82689, 'fee': 8269, 'available': 74420}, 'is_active': True}}
is_active - can user use this node (has enough hours to pay the node)
counter - how many hours user was active (was using this node)
http://node-url/node/balance/username/auth-id
Get user current balance (Auth ID)
Returned data: {data: {balance: {'coins': 5000, 'hours': 82689, 'fee': 8269, 'available': 74420}}}
hours - total hours
fee - fee substracted from hours
available - available hours for withdraw
http://node-url/node/userinfoReturned data:{data: {userinfo: {'joined': True, 'is_active': True, 'balance': 1.00000}}}
joined - is user joined (registered)
is_active - is user active (balance > counter)
balance - total user balance
http://node-url/node/joinReturned data:{data: {'address': shdfgih5gh4, 'shadowname': rt9gj498h495h}
address - Internal NESS address of user
shadowname - internal name of user (shadowname)
http://node-url/node/joinedReturned data:{data: {'joined': True, 'address': shdfgih5gh4, 'shadowname': rt9gj498h495h}OR{data: {'joined': False}}(is not joined (registered))
joined - is user joined (registered)
address - Internal NESS address of user
shadowname - internal name of user (shadowname)
http://node-url/node/withdraw
Withdraw coins and hours (Two Way Encryption)
Input data (POST): {data: {coins: 1, hours: 111, to_addr: 495u4ugjhgt}, username: user, sig: 54e65e5j}
sig - signature of data
to_addr - external address, where to withdraw
Error format: {error: "Error text message"}
Read more about authentication in my dev-blog
Read more about payment system
http://node-url/prng/seed/username/auth-id- Random generated SEED (PRNG service https://github.com/NESS-Network/PyUHEPRNG)http://node-url/prng/seedb/username/auth-id- Random generated numbershttp://node-url/prng/numbers/username/auth-id- Random generated large SEEDhttp://node-url/prng/numbersb/username/auth-id- Big ammount of random generated
emer.jsonConnection to emercoin RPCness.jsonConnection to PrivateNess daemonnode.jsonNode paramspayments.jsonPayments listprng.jsonPRNG service configusers.jsonUsers list - users address, counter and random-hoursfiles.jsonFiles service config
/prng/seedoutput randomly generated seed (regenerated every second)/prng/seedboutput randomly generated big seed (regenerated every second)/prng/numbersoutput randomly generated numbers (100) (regenerated every second)/prng/numbersboutput randomly generated numbers (1000) (regenerated every second)
/files/quotadisk usage quota for current user/files/listfile list/files/fileinfofileinfo for selected file/files/download/$file_id/$shadowname/$auth-iddownload selected file (with resume support)/files/touchcreate selected file/files/removeremove selected file/files/append/$file_id/$shadowname/$auth-idupload and a block of new file and append it to existing file (created by touch)/files/pub/$file_id-$shadowname-$auth-iddownload selected file (public use), (with resume support)
You can generate test users (without blockchain) to test Counter Random Payments
Create test user ( in users.json without using blockchain)
Usage: php create-username.php <username> [address] (address is optional)
Usage: php test.php <username>pay for single hour (similar as exec/cron.php but for single user)
{"master":{"addr":"e56he5jh5e7j6rjr6jr7","counter":2,"random_hours":7219},
"User":{"addr":"e56he5jh5e7j6rjr6jr7","counter":2,"random_hours":7568},
"ZZZ":{"addr":"e56he5jh5e7j6rjr6jr7","counter":2,"random_hours":7112},
"123":{"addr":"e56he5jh5e7j6rjr6jr7","counter":2,"random_hours":7038},
"zxc":{"addr":"e56he5jh5e7j6rjr6jr7","counter":2,"random_hours":7495},
"user":{"addr":"e56he5jh5e7j6rjr6jr7","counter":0,"random_hours":7403}}
- master - master user ( master-user="master" param from WORM file )
- ZZZ - username
- addr - address in Ness blockchain
- counter - amount of hours user was active, every hour the counter gets incremented (if user is active and the user payed tariff amount of Hours successfully)
- random_hours - next payment time in hours ( if counter = random_hours then payment() )
Emercoin blockchain recordworm:node:ness:http://my-ness-node.net
<worm>
<nodetype="ness"url="http://my-ness-node.net"nonce="Q3khjWopdxiLpPweVo6+BQ=="verify="Q13IcdGM6CLjH+zZ/EaPgK+2C8igkh8/x0aEgZVVfTw="public="dJplXPV7cqsC518qg0bJXoWknhqkIZQNTnksVHaSq2E="master-user="master-user-name"tariff="24"tags="Test,My test node,Hello world">
<!-- Here tags may be different for each type of node or each node -->
</node>
</worm>
- url - url of the node
- verify - verify public key
- public - encryption public key
- nonce - salt
- master - user - Master user name (the user being payed every hour for node usage)
- tarif - how mush Hours the node cost for one hour
Emercoin blockchain recordworm:user:ness:user
<worm>
<usertype="ness"nonce="R04rQis5hP2EfILpAGuU8Q=="tags="Hello World,test"public="rYsglIKg2ZQf4yfmqjH70vaC0wCjO5mXAdHPwaWcOX4="verify="1iC81pdum1JRgQ/9j9ceu5QsPVo5VpUjAmwY6LQPM+4="/>
<!-- Here tags may be different for each type of user -->
</user>
</worm>- verify - verify public key
- public - encryption public key
- nonce - salt