Client and Node communication
2 min readJan 5, 2024
Client initialization
- Backup key
The seed is generated and the user is promped to save the seed into safe place. User is also prompted where to save the backup which is done automatically after joining the next node. After this the backup key is generated from initial seed and saved to the backup.json file. This key is used later in automatic backup. - User keypair
Generating user keypair for communicating with the node. - Create Blockchain NVS record with user data and public key here or inside emercoin wallet.
- Upload nodes list
Upload nodes list from one of the default nodes stored in nodes.json file and update nodes list in nodes.json file.
Joining the node
- Joining the selected node.
After the joining acting is done on the node side, on the client side the encryption key is generated. There is one encryption key for every node, this encryption key is used to encrypt files and some other data (file system structure). After the node key is generated and saved in my-nodes.json file (list of joined nodes), the backup process is launched automatically. - Pay coin hours to joined node address.
Uploading a file
- Encrypt a file
- Upload encrypted file on node
- Write remote file-system structure (encrypted with the node key) into special file (fs.dir and fs.files)
Backup
- Backup all local keys (user.json, my-nodes.json and backup.json) to encrypted backup file backup.enc.
- Send encrypted backup file to email or other place.
Restore from backup
- Restore backup key from seed
- Decrypt local keys (user.json, my-nodes.json and backup.json) from encrypted backup file backup.enc.
- Regenarate user keypair
- Update Blockchain NVS record with user data and public key.
In case if you lost your device with all encryption keys, you will able to restore access to all your nodes and files. And after regenerating user keypair and updating blockchain NVS user record, you will block malevolent from accessing your nodes and files.
More articles
Read my old articles:
Authentication on NESS nodes
Microservices