Skip to content

Description of the sdp.json file

ronnylov edited this page Jun 26, 2019 · 1 revision

SDP is an abbreviation for Service Description Protocol and the sdp.json file cointains data of the services that are provided by the exit node. We need to customize the content of this file to describe the exit node and the services.

The contents of the sdp.json file generated by the deploy script looks something similar to this:

{
   "protocolVersion": 1,
   "provider": {
      "certificates": [
         {
            "cn": "ignored",
            "content": "-----BEGIN CERTIFICATE-----MIIFGDCCAwCgAwIBAgIJAMt6wFAS9JyQMA0GCSqGSIb3DQEBCwUAMBkxFzAVBgNVBAMMDkxUSE5FYXN5RGVwbG95MB4XDTE5MDYwNTE0NDkyN1oXDTM5MDUzMTE0NDkyN1owGTEXMBUGA1UEAwwOTFRITkVhc3lEZXBsb3kwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDSfb9fVnTJOaCuP9fp/s9rPeLguIzgsjkWNIpd5Mqalxy/oDz/ymk74C2O8f3lekrO9HXu/tgmawQPXs02IFtHTOV69iAsytHuLHgFwOpT3QYEKbkHgWlWbjBjLlvtfCHYt7MhnPcJ2hTDUH1PMKFwa+9PiXNFNU+LbZMHPMQ7cAmh5Bu4L6YdzfE0EwNLc7AJuG/5xeV2kokzMkSUyr6SWm3A/wgbo0mxHHAWJDNMJy0OWKqQArlfiGziCrGw0v1IATM5MDUzMTE0NDkyN1owGTEXMBUGA1UEAwwOTFRITkVhc3lEZXBsb3kwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDSfb9fVnTJOaCuP9fp/s9rPeLguIzgsjkWNIpd5Mqalxy/oDz/ymk74C2O8f3lekrO9HXu/tgmawQPXs02IFtHTOV69iAsytHuLHgFwOpT3QYEKbkHgWlWbjBjLlvtfCHYt7MhnPcJ2hTDUH1PMKFwa+9PiXNFNU+LbZMHPMQ7cAmh5Bu4L6YdzfE0EwNLc7AJuG/5xeV2kokzMkSUyr6SWm3A/wgbo0mxHHAWJDNMJy0OWKqQArlfiGziCrSQb8aFzuULSuqXtT2JgZ/6t2leyGJiOn4iL2ZjyyySnqOQ/ktTo60NBa6tZ6yj0ojOQ1iJHocgsUZbHpcxlg+4PZAIf1BnX7TfUQ2l7arcfHP4hGoch74/+Ld00+AtnDeensR5psVmsq2WVe0J+UT5RlhprbilNIMc01vID1IOIU6DVlc55f6t+46OzLgfd9Zx52P3Xk7IO5SOKsHvtrAkauh0c8IuHuZoqTLoKAlVg2DKaQBGBQYWrIqfpZS1c1yqt1kVe/4nAWVhaiTK6FNST4TXop24edPaHoKbBXPkE7SPw7fys1Y3zEyQlf5SymQ8vi/hrVOn+GzUoUBlUdHvksWRK3BQ+dLqAU6q5AT+RVQ91zDRxoi+NkIBFut7JtHd8gNAoaWt7WxqnK3JnNHDBerE5U4jvN9fJChgFoTwRmuAVkHVx/HbI-----END CERTIFICATE-----",
            "id": 0
         }
      ],
      "id": "2e257307d9e17b5a04aa00ed45019efefb24c9c0fe1f07d9e17b5a04aacf4a76e",
      "name": "EasyProvider",
      "nodeType": "commercial",
      "terms": "{providerterms}",
      "wallet": "iz4GWcmt8BVbct3GhaEBNAJBknfb2yL1iQkCcfDgnEm2g3q7UrwukXoMteJGhUyFAyME6QNMFJddQ1jUdJBEQR6U2jQi1Z2zn"
   },
   "services": [
      {
         "allowRefunds": false,
         "certificates": [
            {
               "id": 0
            }
         ],
         "cost": "0.00100000",
         "disable": false,
         "downloadSpeed": 1000000,
         "firstPrePaidMinutes": 10,
         "firstVerificationsNeeded": 0,
         "id": "1A",
         "name": "proxy",
         "proxy": [
            {
               "endpoint": "usnode.extremenet.com",
               "port": "8081/TCP"
            }
         ],
         "subsequentPrePaidMinutes": 30,
         "subsequentVerificationsNeeded": 1,
         "type": "proxy",
         "uploadSpeed": 1000000,
         "vpn": []
      }
   ]
}

Take a look at sourcecode for sdp.py to get all the details about the fields.

"protocolVersion": Don't change this

Provider description

"provider": Information regarding your provider. See description of fields below.

"certificates": Don't change. These are generated by the deploy script.

"id": This is the Provider ID. Should be the same as the content of the file /etc/lthn/provider.public and is set by the deploy script so you should not need to change it.

"name": 'Enter provider name. This will be displayed to users. Use up to 16 alphanumeric characters, symbols allowed: ' You should change this, otherwise the node will be called "EasyProvider" in exit node list in the wallet and on nodes.lethean.io. In our example we call it "SuperEasyNode".

"nodeType": validNodeTypes = ['residential', 'commercial', 'government'] Set the same as in dispatcher.ini. This is currently only for information and does not affect the function of your node. Default is residential which means it is located at home. If you rent a server I think commercial is more accurate. Or perhaps it means if you run it as company or privately? I am not sure but it does not matter much for now. If you are a government I guess you set it to government :-)

"terms": 'Enter provider terms. These will be displayed to users. Up to 50000 characters. ' Should be set same as in dispatcher.ini. It is the terms of usage of your exit node. Maybe could e a link to a description on your website or a short text. I don't think it is used anywhere yet.

"wallet": This is the wallet address to where users of your exit node pay for usage. This is also set by the deploy script and should only be changed if you manually replace the wallet afterwards. In our example it is the same address as the contents of the /var/lib/lthn/supereasynode.address.txt file. If you never changed wallet file in the deploy script variables it would be /var/lib/lthn/wallet.address.txt

Services description

"services": This field describes the services on the exit node. Can be one or more proxy and VPN services. Default is one proxy service. You need to edit some fields to match your exit node. See below.

"allowRefunds": This is not implemented yet so don't change it. Keep it set to false.

"certificates": I never change this but I think it is possible to generate different certificates and choose which one to use here. Just keep it and don't change this field unless you really know what you are doing :-)

"cost": The price of the service in LTHN per minute. Change this to the price you wan't your customers to pay for this service.

"disable": This field is set to false before uploading the sdp.json file to have the service visible in GUI wallet and on nodes.lethean.io. To remove your service you set this field to true and upload sdp.json again. Keep this in mind in case you want to reinstall your exit node, generating new certificates or quit your node from being published. You need to disable it and upload before removing the installation on your exit node. If not there will be a non-working exit node published in the wallet which is bad. In time it will be removed if you don't pay subscription but keep it clean please! Also if doing maintenance it is good to first disable the exit node before stopping the services. After maintenance you enable it again when everything is working.

"downloadSpeed": This is information to your users what the download speed in bits/second is. This setting does not affect the speed of your exit node, it is information only. So test your node and adjust to the real speed your users normally can get. To set 10 Mbit/s set it to 10000000

"firstPrePaidMinutes": 'How many minutes of access are required to be prepaid for the first payment from a client? Minimum 10, maximum 1440 minutes.' This is the first payment period. I reccomend at least 30 minutes to make your node work properly. The price of the first payment will be this value multiplicated with the price setting. Keep in mind that each payment have a transfer fee (currently around 0.1 LTHN) so in order to make the exit node get most of the payments you should make sure that each payment is not too low. I recommend at least 1 LTHN per payment. So if price is set to 0.001 LTHN / min the payment period should be at least 1000 minutes. Otherwise a big part of customers payments would be lost as fees to miners. The fees could change in future, especially if "bulletproofs" is implemented from Monero.

"firstVerificationsNeeded": This is how many blockchain verifications is needed to accept the payment for the first payment. This value must be set to 0 to make the exit node connect fast enough. Don't change this to anything else than 0!

"id": # we use two hex digits to represent the service ID (range = 16 [0x10] to 255 since two digits must be used) This is the identification of this particular service. It must be in range 10 - FF in hex. You can leave this as "1A" for your first service. Only need to change this when having multiple services on one exit node.

"name": 'Specify name of service [32 characters, numbers and spaces allowed] ' [a-zA-Z0-9 ,.-_] This is a description of the service. There is a limitation of the length (32 characters max) and what characters that are allowed. You will get error message when uploading sdp.json if not set properly. Use it to let your users know what this service do. Many just leave it as Proxy or VPN but maybe you have some special thing you want to describe like "superfast proxy", "adblock" or whatever. The text is visible in GUI wallet and on nodes.lethean.io below the provider name.

"proxy": This field have subfields "endpoint": describing what address/IP and "port" which incoming port to connect to. You must change it to match your exit node and if set in deploy script it is already prefilled but check that it is correct. Also you need to make sure that your firewall allows this connection.

"subsequentPrePaidMinutes": This is payment periods after the first one. Set it in minutes and at least 30.

"subsequentVerificationsNeeded": Set it to how many verifications are needed in blockchain to accept payment. This is up to you to decide. Default value 1 works without problems.

"type": "proxy" for a proxy service and "vpn" for VPN.

"uploadSpeed": The upload speed in bits/second. See description of downloadspeed above. Only information to customers and you should set it to show the real speed of the connection the users can get.

"vpn": Contents of field should not be changed. [] If you have a vpn service this field is "proxy" instead of "vpn". Don't know what it is used for but is specified by the protocol.