- [[Become a KelVPN Service Provider#Part 1. Preliminary stage|Part 1. Preliminary stage]]
- [[Become a KelVPN Service Provider#Part 2. Installation and configuration of cellframe-node|Part 2. Installation and configuration of cellframe-node]]
- [[Become a KelVPN Service Provider#Part 3. Configuring DNS and firewall with NAT|Part 3. Configuring DNS and firewall with NAT]]
- [[Become a KelVPN Service Provider#Part 4. Configuring cellframe-node|Part 4. Configuring cellframe-node]]
- [[Become a KelVPN Service Provider#Part 5. Reading VPN node log file|Part 5. Reading VPN node log file]]
### Part 1. Preliminary stage
**What is needed to become a KelVPN service provider?**
- A machine that will stay running 24/7
A home PC, a VPS or a Raspberry Pi will be suitable.
The more consistently your KelVPN service node is online, the more revenue it will make. When it is offline, it cannot earn by providing service.
- Linux OS or MacOS.
At the moment, it is possible to set up a KelVPN service node using Linux or MacOS.
- A public IP address.
A public IP address is necessary for becoming KelVPN service provider.
- IPv4 protocol.
The option to use an IP address with IPv6 protocol will be implemented in the future.
- Your KelVPN wallet balance must have:
- 100000 $KEL ready for staking
or
- 100 mKEL (received for prior stakes in total of 100000 $KEL)
- Stable internet connection
This is one of the key requirements for a KelVPN service node.
> **NOTE: your 100000 $KEL or 100 mKEL should be in a wallet on the KelVPN network, not on the Backbone network!**
### Part 2. Installation and configuration of cellframe-node
#### 1. General notes
1. Everything you see written in the guide inside the `<` and `>` symbols is an example. This information can and should be changed to your own information for each step of the process.
The `<` and `>` symbols shouldn't be included when executing the commands.
2. We recommend changing to `root` user for the setup of the master node. This will simplify the process.
In Linux, user can be switched with command:
```bash
sudo -i
```
In MacOS, it can be done with similar command:
```none
sudo -s
```
All the commands presented in this instruction imply that the `root` user is being used.
#### 2. Download and install the cellframe-node
Linux build: <link>
Linux build for devices based on ARM architecture: <link>
MacOS build: <link>
Command for downloading files using the terminal:
```bash
wget <link>
```
Command to install:
```none
apt install ./<file_name>
```
#### 3. Initial cellframe-node configuration
You will be asked a few questions about the cellframe-node configuration. Below are the recommended answers.
- Auto online - True
- Debug mode - False
- Accept connections - True
- Server address - 0.0.0.0
- Server port - 8079
- Notify server address - 127.0.0.1
- Notify server port - 8080
- Backbone: Enable network - True
- Backbone: Node role - full
- KelVPN: Enable network - True
- KelVPN: Node role - master
- Riemann: Enable network - False
- Python plugins - False
If a mistake was made in initial configuration, it can be changed with the command:
```bash
dpkg-reconfigure cellframe-node
```
Configuration files are located at:
`/opt/cellframe-node/etc/cellframe-node.cfg`
`/opt/cellframe-node/etc/network/KelVPN.cfg`
### Part 3. Configuring DNS and firewall with NAT
#### 1. Install DNS
```bash
apt -y install bind9
```
#### 2. Set up IPv4 forwarding
To enable IPv4 forwarding, you need to edit the `sysctl.conf` file.
Open the file with editor `nano` using the command:
```bash
nano /etc/sysctl.conf
```
Find the following line:
```bash
#net.ipv4.ip_forward=1
```
Uncomment the line:
```bash
net.ipv4.ip_forward=1
```
**NOTE**: If your configuration file is missing this line, you may add it manually to the end of the file.
To apply changes to the file, press `Ctrl+X`, answer `Y` to `Save modified buffer` and press `Enter`.
Enable the new settings with the command:
```bash
sysctl -p
```
#### 3. Configuring firewall with NAT (Network Address Translation)
> **NOTE**: Setting up this section is extremely important and making an error may deprive you of access to the VPS server. Please be careful. If in doubt, ask for help in the [KelVPN Support group](https://t.me/kelvpn_tech_support).
First of all, you need to figure out which network interface you are using for internet connection. To find that out, use the following command to see current network interface:
```bash
ip -brief address show
```
The output can look like this:
```bash
lo UNKNOWN 127.0.0.1/8 ::1/128
ens33 UP 192.168.48.129/24 fe80::6cd2:a975:b910:ad69/64
```
In this example, the network interface is `ens33`.
**Save this information.** It will be needed later in the process.
Second, check the available tunnel devices from your system with the command:
```bash
ls /dev/net
```
The output can look like this:
```bash
tun
```
If you have only one `tun` device available on your system, you should use `tun0` as the tunnel device when configuring the firewall. However, if you have configured another VPN server for your system, you might have multiple tunnel devices available. For example, if you have `tun, tun0, tun1, tun2` devices when doing the `ls /dev/net/` command, you should use `tun3` in the firewall configuration.
**Save this information.** It will be needed later in the process.
#### 4. Installing and configuring the firewall
> **NOTE**: Setting up this section is extremely important and making an error may deprive you of access to the VPS server. Please be careful. If in doubt, ask for help in [KelVPN Support group](https://t.me/kelvpn_tech_support).
To configure Linux firewall (iptables), we are going to use `arno-iptables-firewall`, an iptables configuration script.
Command to install it:
```bash
apt -y install arno-iptables-firewall
```
Command to reconfigure it if it is already installed:
```bash
dpkg-reconfigure arno-iptables-firewall
```
You are going to be asked a few questions. Here are the recommended answers:
- Do you want to manage the firewall setup with debconf?
- Yes
- External network interfaces
- ens33
This is the network interface you checked with `ip -brief address show` command.
- Open external TCP-ports
- 8079 or 8079 22
> **NOTE**: If you're running other services on your computer (for example like SSH port 22), you should open those ports too, so that you can access them!
> **If you are using VPS, not including port 22 will result in losing connection via SSH to your device.**
- Open external UDP-ports
- 8079 or 8079 22
- Internal network interfaces
- tun0
This is the network interface you checked with `ls /dev/net` command.
- Internal subnets
- 10.11.12.0/255.255.255.0
This information (IP / Mask) will also be used in `cellframe-node.cfg` later in the process.
- Should the firewall be (re)started now?
- No
This question will be asked `twice`. Answer `No`, as we need to continue the configuration.
In the next step, use the following command to continue configuration:
```bash
dpkg-reconfigure -plow arno-iptables-firewall
```
**NOTE**: When installing the package for the first time, the installer will ask some of the same questions you have already answered. Read them carefully, and if the displayed answer is correct, press Enter.
- Is DHCP used on external interfaces?
- To answer Yes or No, read the information below.
**NOTE**: Usually the answer is “Yes”. However, answer “No” only if you have static network configuration for external connections.
- Should the machine be pingable from outside the world?
- Yes
- Do you want to enable NAT?
- Yes
- Internal networks with access to external networks
- 10.11.12.0/255.255.255.0
This information (IP / Mask) will also be used in `cellframe-node.cfg` later in the process.
- Should the firewall be (re)started now?
- Yes
### Part 4. Configuring cellframe-node
#### 1. Creation or restoration of a wallet
Command to create a new wallet:
```bash
cellframe-node-cli wallet new -w <wallet_name> -restore <hash>
```
`"-restore"` is an important parameter that allows you to restore a created wallet on another machine in case anything happens with the current one.
`<hash>` value needs to be entered manually. Recovery hash requirements are:
- begins with `0x`
- minimum length of 4 characters
- valid characters: 0-9, a-f, A-F.
If your wallet was created in `cellframe-node` with a hash that does not fit these requirements, then the `-restore_legacy` parameter should be used with the hash of old format instead of the `-restore` parameter.
If you would like to restore a wallet that was created in `cellframe dashboard` in `cellframe-node`, the following needs to be done:
- take your seed phrase
- join all 24 words together in one unit of text without spaces between words
- if your wallet is protected, add a password to the end of the text
- generate a hash from the resulting text using `sha256`
- use the generated hash with `-restore` parameter after the `0x` prefix
You can convert a `SEED phrase` into the required hash using the `SHA256` algorithm in the terminal in Linux, macOS, or using one of the web resources that provide such functionality.
Correct format is `-restore 0x<hash>`
Command to restore a wallet:
```bash
cellframe-node-cli wallet new -w <wallet_name> -sign sig_dil -restore <hash> -force
```
Command to restore a wallet with password:
```bash
cellframe-node-cli wallet new -w <wallet_name> -sign sig_dil -restore <hash> -password <password> -force
```
Please take a note of parameter `-force` at the end of command line. Its presence is necessary to restore the wallet!
Before interacting with a protected wallet, it needs to be activated with command:
```bash
cellframe-node-cli wallet activate -w <wallet_name> -password <password>
```
After successful creation or restoration of a wallet, its address and balance can be checked with the following command:
```bash
cellframe-node-cli wallet info -net KelVPN -w <wallet_name>
```
#### 2. Creating the certificate
First, you need to go to the `/opt/celframe-node/bin` folder and check the availability of the permissions to run `cellframe-node` executable files.
- Change directory to `/opt/celframe-node/bin`:
```bash
cd /opt/cellframe-node/bin
```
- Use this command to show detailed information about files in the directory:
```bash
ls -la
```
- The result of the command execution will be similar to this:
```bash
masternode@ubuntu:/opt/cellframe-node/bin$ ls -la
total 16156
drwxrwxr-x 2 root root 4096 Jul 13 22:20 .
drwxrwxr-x 9 root root 4096 Jul 13 22:20 ..
-rwxrwxr-- 1 root root 8714248 Jul 13 10:21 cellframe-diagtool
-rwxrwxr-- 1 root root 4214888 Jul 13 10:23 cellframe-node
-rwxrwxrwx 1 root root 73056 Jul 13 10:23 cellframe-node-cli
-rwxrwxr-- 1 root root 3522760 Jul 13 10:23 cellframe-node-tool
```
The line with `cellframe-node-tool` is the one you should take a look at.
If the first column ends with `-` and not `x`, then the following command should be executed:
- Grant execution rights to `cellframe-node-tool`:
```bash
chmod +x /opt/cellframe-node/bin/cellframe-node-tool
```
After that, the last symbol will change to `x`:
```bash
-rwxrwxr-x 1 root root 3522760 Jul 13 10:23 cellframe-node-tool
```
- The certificate can be created with the command:
```bash
cellframe-node-tool cert create <kelvpn.cert_name> sig_dil
```
It is recommended to use the `CRYSTALS-Dilithium` signature.
`sig_dil` parameter represents this signature type.
#### 3. Making changes to the KelVPN network configuration file
The configuration file is located at:
```bash
/opt/cellframe-node/etc/network/KelVPN.cfg
```
This file should be opened with an editor to make changes to it. To do this, a terminal-based text editor `nano` will be used.
```bash
nano /opt/cellframe-node/etc/network/KelVPN.cfg
```
- Find the `[esbocs]` section and make the necessary changes to match the example below:
```bash
[esbocs]
# Here we specify the name of our certificate
blocks-sign-cert=<kelvpn.cert_name>
#minimum_fee=
# We specify the address of our wallet to collect the fees
fee_addr=<kelvpn_wallet_address>
set_collect_fee=5
```
Do not forget that symbols `<` and `>` should not be used!
To save changes to the file, use the keyboard shortcut `Ctrl + O`.
To exit the editor, use the keyboard shortcut `Ctrl + X`.
#### 4. Making changes to the node configuration file
The configuration file is located at:
```bash
/opt/cellframe-node/etc/cellframe-node.cfg
```
To edit it, use a `nano` editor:
```bash
nano /opt/cellframe-node/etc/cellframe-node.cfg
```
The value of the `auto_proc` parameter needs to be changed from `false` to `true` in the `[mempool]` section:
```bash
[mempool]
# Automatically false, for enabling need role master or higher
auto_proc=true
```
To save changes to the file, use the keyboard shortcut `Ctrl + O`.
To exit the editor, use the keyboard shortcut `Ctrl + X`.
#### 5. Setting up a Cellframe node for VPN sharing
To enable VPN service sharing in cellframe node, edit the cellframe node configuration file with the following command:
```bash
nano /opt/cellframe-node/etc/cellframe-node.cfg
```
Find `[srv_vpn]` section and make the following change:
- enabled=true
Uncomment line `#grace_period=60` and change its value:
```bash
grace_period=900
```
Three lines need to be added:
- net=KelVPN
- wallet_addr=<kelvpn_wallet_address>
- receipt_sign_cert=<kelvpn.cert_name>
To save changes to the file, use the keyboard shortcut `Ctrl + O`.
To exit the editor, use the keyboard shortcut `Ctrl + X`.
After applying the changes, the configuration should look like this:
```bash
# VPN stream channel processing module
[srv_vpn]
# Turn to true if you want to share VPN service from you node
enabled=true
debug_more=false
# Grace period for service , 60 second by default
grace_period=900
# List of loca security access groups. Built in: expats,admins,services,nobo>
network_address=10.11.12.0
network_mask=255.255.255.0
net=KelVPN
wallet_addr=<kelvpn_wallet_address>
receipt_sign_cert=<kelvpn.cert_name>
```
#### 6. Restarting the node
In order for the made changes to apply, the node must be restarted.
To do this, use the following commands:
```bash
service cellframe-node stop
service cellframe-node start
```
To check that the node is running, you can use the command:
```bash
systemctl status cellframe-node.service
```
The expected result:
```bash
● cellframe-node.service - Cellframe Node
Loaded: loaded (/etc/systemd/system/cellframe-node.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-07-27 05:14:24 PDT; 4s ago
Main PID: 52072 (cellframe-node)
Tasks: 8 (limit: 4558)
Memory: 568.6M
CGroup: /system.slice/cellframe-node.service
└─52072 /opt/cellframe-node/bin/cellframe-node
```
#### 7. Publish IP address in node list
This can be done with the following command:
```bash
cellframe-node-cli node add -net KelVPN
```
Result of the command execution:
```bash
Node addr successfully added to node list
```
#### 8. Locking mKEL
Creating a transaction that locks mKEL and delegates the certificate you created:
```bash
cellframe-node-cli srv_stake delegate -cert <kelvpn.cert_name> -net KelVPN -wallet <wallet_name> -value 100.0e+18 -fee 0.05e+18
#Expected result:
SAVE TO TAKE ===>>> Stake transaction <transaction hash> has done
```
**Save the obtained hash.** You will need to send this information to KelVPN team.
In this command, the `-value` parameter is the number of mKEL you are locking.
- `100.0e+18 = 100 mKEL`
Cellframe node uses the _datoshi_ format for managing token values.
`Datoshi` is a format of recording values that allows accuracy of up to 18 decimals after the decimal point.
#### 9. Requesting to become a KelVPN service provider
Obtained hashes of `locking mKEL` and `a VPN service order` must be sent to the KelVPN team. There are multiple ways to request approval of your KelVPN service node:
- via the administrator in the [KelVPN Support group](https://t.me/kelvpn_tech_support);
- via this [Contact Us form](https://kelvpn.com/contact-us) on the [KelVPN website](https://kelvpn.com/).
If using the [Contact Us form](https://kelvpn.com/contact-us), please specify the topic of your request as `KelVPN service providing node` and leave a valid e-mail address for the team to contact you.
#### 10. Create order for the VPN service
Command to create your order:
```bash
cellframe-node-cli net_srv -net KelVPN order create -direction sell -srv_uid 1 -price <price> -price_unit SEC -price_token KEL -units <units> -cert <kelvpn.mycert> -region <country_name> -continent <continent_name>
```
Description of arguments
- `-direction` buy or sell. For VPN service providing it must be `sell`.
- `-srv_uid` Service UID. For VPN service, set `1`.
- `-price` Price for the number of units specified in the parameter `-units`. For example, 100 datoshi for 3600 seconds of the service.
- `-price_unit` Set SEC for Seconds.
- `-price_token` Ticker of the token that will be used for payment.
- `-units` The number of units in one portion of the service.
- `-cert` Certificate of the master node.
- `-region` The region in which the node is located.
- `-continent` The continent in which the node is located.
Result of the command execution:
```bash
Created order <hash>
```
**Save the obtained hash.** You will need to send this information to the KelVPN team.
**NOTE**: You should use your real region and country names to keep the list of available servers accurate. Orders with incorrect location data will be deleted.
To check already published orders in the network, use command:
```bash
cellframe-node-cli net_srv -net KelVPN order find -srv_uid 0x0000000000000001 -direction sell
```
This command will display a list of all available orders.
Here's an example of an order in the list:
```bash
== Order 0x06A9E4F65E3538E596F3C802F42C100CDADC4F3CF02967C7E8CADF6B6FB3A3FB ==
version: 3
direction: SERV_DIR_SELL
srv_uid: 0x0000000000000001
price: 0.000000000000001 (1000)
price_unit: SECOND
node_addr: 53DF::4976::1653::3E0A
node_location: Europe - Poland
tx_cond_hash: 0x0000000000000000000000000000000000000000000000000000000000000000
ext: 0x5202506F6C616E6400
pkey: 0x2D6DE20716028F66DEA4B7DB727CE54359239868A12EA37344D3DBACB1773D1D
units: 1800
```
#### 11. Creating an order for the validator fee
An `order` is published on the network. With it, you specify what your validator's fee will be for conducting transactions on the network.
Command to create an order:
```bash
cellframe-node-cli srv_stake order create -net KelVPN -value <value> -cert <kelvpn.cert_name>
```
In this command, the `value` is the amount of the validator fee in $KEL. That's how much your master node will be paid for signing the block. The amount of $KEL is written in `datoshi`. For example, `0.05e+18 = 0.05 $KEL`
It is not worth inflating your price, because when conducting transactions, the network focuses on the average value among all created orders.
The recommended amount is `0.05 $KEL`
#### 12. Restarting the node
After receiving approval from the KelVPN team and creating both VPN service and validator fee orders, the node needs to be restarted.
```bash
sudo service cellframe-node stop
sudo service cellframe-node start
```
To check that the node is running, you can use the command:
```bash
systemctl status cellframe-node.service
```
The expected result:
```bash
● cellframe-node.service - Cellframe Node
Loaded: loaded (/etc/systemd/system/cellframe-node.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-07-27 05:14:24 PDT; 4s ago
Main PID: 52072 (cellframe-node)
Tasks: 8 (limit: 4558)
Memory: 568.6M
CGroup: /system.slice/cellframe-node.service
└─52072 /opt/cellframe-node/bin/cellframe-node
```
Hooray! Your node now not only has a master role in the KelVPN network and participates in the network consensus, but also provides a VPN service!
### Part 5. Reading VPN node log file
Cellframe-node log file is located at:
`/opt/cellframe-node/var/log/cellframe-node.log`
All node activity is written into it. To display only the entries related to the VPN service, use the following command:
```bash
cat /opt/cellframe-node/var/log/cellframe-node.log | grep "dap_stream_ch_chain_net_srv\|dap_chain_mempool\|dap_chain_net_srv_vpn" | grep -v "Filter removed:"
```
Below are some of the most frequent interactions between a client and a VPN node.
Client connects to a VPN node.
```bash
[10/26/23-08:01:41] [ * ] [dap_stream_ch_chain_net_srv_session] created service session
[10/26/23-08:01:41] [ * ] [dap_stream_ch_chain_net_srv_session] Added service riemann:0x0000000000000001 , usage id: 230796362
[10/26/23-08:01:41] [INF] [dap_stream_ch_chain_net_srv] Valid pricelist is founded. Start service in pay mode.
[10/26/23-08:01:41] [ * ] [dap_stream_ch_chain_net_srv] Transaction 0x36D92BE34E603850610B34900CF955372AF6DC9625832FB5DC4AE93005D341EE can't be found. Start the grace period for 600 seconds
[10/26/23-08:01:41] [INF] [dap_chain_net_srv_vpn] s_callback_response_success is called
[10/26/23-08:01:41] [ * ] [dap_chain_net_srv_vpn] Enable VPN service
[10/26/23-08:01:41] [INF] [dap_stream_ch_chain_net_srv] Start grace timer successfuly..
[10/26/23-08:01:42] [INF] [dap_chain_net_srv_vpn] Received address request
[10/26/23-08:01:42] [DBG] [dap_chain_net_srv_vpn] new_address = 10.11.12.2
new_address_max = 10.11.12.255
[10/26/23-08:01:42] [INF] [dap_chain_net_srv_vpn] VPN client new IP address 10.11.12.2 leased
gateway 10.11.12.1
net mask 255.255.255.0
net addr 10.11.12.0
last_addr 10.11.12.2
[10/26/23-08:01:42] [DBG] [dap_chain_net_srv_vpn] Tun:1 message: addr 10.11.12.2 assigned for worker #1 on tun #u
[10/26/23-08:01:42] [DBG] [dap_chain_net_srv_vpn] Tun:0 message: addr 10.11.12.2 assigned for worker #1 on tun #u
```
A transaction made by the client is processed by the network. Grace period ends and service providing begins.
Part of the grace period that client used for VPN service is accounted for when paid VPN service begins.
```bash
[10/26/23-08:08:14] [INF] [dap_stream_ch_chain_net_srv] Found tx in ledger by notify. Finish grace.
[10/26/23-08:08:14] [INF] [dap_stream_ch_chain_net_srv] Grace period is over! Check tx in ledger.
[10/26/23-08:08:14] [INF] [dap_stream_ch_chain_net_srv] Tx is found in ledger.
[10/26/23-08:08:14] [DBG] [dap_chain_net_srv_vpn] Checkout user 0xBCE3BFE876D75733DB57C872DC29A3680527A518202455810340F23C91B0F16E in group local.srv_pay.riemann.vpn_srv.remain_limits
[10/26/23-08:08:14] [INF] [dap_stream_ch_chain_net_srv] Send first receipt to sign
[10/26/23-08:08:14] [ * ] [dap_stream_ch_chain_net_srv] Trying create input tx cond from tx 0x36D92BE34E603850610B34900CF955372AF6DC9625832FB5DC4AE93005D341EE with active receipt
[10/26/23-08:08:14] [ * ] [dap_chain_mempool] Datum transaction with hash 0x563A568DB15C9C369C7A46B0BD33367822A7D3FA72D72303057F76BF1867EBB7 was placed in mempool group riemann.chain-main.mempool
[10/26/23-08:08:14] [ * ] [dap_stream_ch_chain_net_srv] Formed tx 0x563A568DB15C9C369C7A46B0BD33367822A7D3FA72D72303057F76BF1867EBB7 for input with active receipt
[10/26/23-08:08:14] [ * ] [dap_stream_ch_chain_net_srv] Receipt with client sign is accepted, start service providing
```
Client closes connection to a VPN node.
```bash
[10/26/23-07:35:18] [INF] [dap_chain_net_srv_vpn] Unassigned 10.11.12.2 address from tun sock #0
[10/26/23-07:35:18] [DBG] [dap_stream_ch_chain_net_srv] Stream ch chain net srv delete
[10/26/23-07:35:18] [INF] [dap_chain_net_srv_vpn] Unassigned 10.11.12.2 address from tun sock #1
```
Client tried to connect to a VPN node and wasn't able to pay for service.
After the end of the grace period, the client is added to the ban list for the time of grace period.
```bash
[10/26/23-07:49:04] [INF] [dap_stream_ch_chain_net_srv] Grace period is over! Check tx in ledger.
[10/26/23-07:49:04] [WRN] [dap_stream_ch_chain_net_srv] No tx cond transaction
[10/26/23-07:49:04] [WRN] [dap_chain_net_srv_vpn] Response error code 0x00000400
[10/26/23-07:49:04] [DBG] [dap_stream_ch_chain_net_srv] Add client to banlist
[10/26/23-07:49:04] [INF] [dap_chain_net_srv_vpn] Usage inactivation: switch off packet input & output channels
[10/26/23-07:49:04] [INF] [dap_chain_net_srv_vpn] Unassigned 10.11.12.2 address from tun sock #1
[10/26/23-07:49:04] [INF] [dap_chain_net_srv_vpn] Unassigned 10.11.12.2 address from tun sock #0
[10/26/23-07:49:04] [DBG] [dap_stream_ch_chain_net_srv] Stream ch chain net srv delete
```
Banned client attempts to connect to a VPN node.
```bash
[10/26/23-07:58:36] [ * ] [dap_stream_ch_chain_net_srv_session] Added service riemann:0x0000000000000001 , usage id: -1538328107
[10/26/23-07:58:36] [INF] [dap_stream_ch_chain_net_srv] Valid pricelist is founded. Start service in pay mode.
[10/26/23-07:58:36] [INF] [dap_stream_ch_chain_net_srv] Client pkey is banned!
[10/26/23-07:58:36] [WRN] [dap_chain_net_srv_vpn] Response error code 0x00000503
[10/26/23-07:58:36] [DBG] [dap_stream_ch_chain_net_srv] Stream ch chain net srv delete
```
Client closes connection to a VPN node, and paid VPN service period wasn't used fully.
```bash
[10/26/23-08:26:53] [INF] [dap_chain_net_srv_vpn] Unassigned 10.11.12.2 address from tun sock #1
[10/26/23-08:26:53] [INF] [dap_chain_net_srv_vpn] Unassigned 10.11.12.2 address from tun sock #0
[10/26/23-08:26:53] [DBG] [dap_stream_ch_chain_net_srv] Stream ch chain net srv delete
[10/26/23-08:26:53] [DBG] [dap_chain_net_srv_vpn] Save user 0xBCE3BFE876D75733DB57C872DC29A3680527A518202455810340F23C91B0F16E remain service into group local.srv_pay.riemann.vpn_srv.remain_limits
[10/26/23-08:26:53] [INF] [dap_stream_session] Close session id 1217913730 ...
[10/26/23-08:26:53] [INF] [dap_stream_session] Delete session context [stm_sess:0x7fb3c407e8e0, id:1217913730, ts:1698307301]
[10/26/23-08:26:53] [ * ] [dap_stream] Stream connection is over
```
Upon the client's next connection, the period that was left over is taken into consideration.
```bash
[10/26/23-08:27:44] [ * ] [dap_stream_ch_chain_net_srv_session] Added service riemann:0x0000000000000001 , usage id: 359293158
[10/26/23-08:27:44] [INF] [dap_stream_ch_chain_net_srv] Valid pricelist is founded. Start service in pay mode.
[10/26/23-08:27:44] [DBG] [dap_chain_net_srv_vpn] Checkout user 0xBCE3BFE876D75733DB57C872DC29A3680527A518202455810340F23C91B0F16E in group local.srv_pay.riemann.vpn_srv.remain_limits
[10/26/23-08:27:44] [INF] [dap_stream_ch_chain_net_srv] User has 893 SEC remain service. Start service without paying.
[10/26/23-08:27:44] [INF] [dap_chain_net_srv_vpn] s_callback_response_success is called
[10/26/23-08:27:44] [ * ] [dap_chain_net_srv_vpn] Enable VPN service
[10/26/23-08:27:44] [INF] [dap_chain_net_srv_vpn] Received address request
[10/26/23-08:27:44] [DBG] [dap_chain_net_srv_vpn] new_address = 10.11.12.2
new_address_max = 10.11.12.255
[10/26/23-08:27:44] [INF] [dap_chain_net_srv_vpn] VPN client new IP address 10.11.12.2 leased
gateway 10.11.12.1
net mask 255.255.255.0
net addr 10.11.12.0
last_addr 10.11.12.2
[10/26/23-08:27:44] [DBG] [dap_chain_net_srv_vpn] Tun:1 message: addr 10.11.12.2 assigned for worker #1 on tun #u
[10/26/23-08:27:44] [DBG] [dap_chain_net_srv_vpn] Tun:0 message: addr 10.11.12.2 assigned for worker #1 on tun #u
```