Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate SSL only coins_config.json #821

Merged
merged 12 commits into from
Sep 21, 2023
Merged

generate SSL only coins_config.json #821

merged 12 commits into from
Sep 21, 2023

Conversation

smk762
Copy link
Collaborator

@smk762 smk762 commented Sep 15, 2023

To avoid SSL warnings / errors in browser, I've tweaked the script to exclude any nodes, electrums or lightwallets which are not using SSL, and add these to a new file called coins_config_ssl.json. Web based apps can use this file instead of the coins_config.json file which remains complete (excluding non responsive electrums)

@cipig
Copy link
Member

cipig commented Sep 15, 2023

utils/coins_config_ssl.json also contains non-SSL electrums
is it only meant to be valid for tokens?
EDIT: i know what the problem is... non-SSL electrums sometimes also have ws_url set... so it's better to just check for "protocol": "SSL"

@smk762
Copy link
Collaborator Author

smk762 commented Sep 19, 2023

utils/coins_config_ssl.json also contains non-SSL electrums is it only meant to be valid for tokens? EDIT: i know what the problem is... non-SSL electrums sometimes also have ws_url set... so it's better to just check for "protocol": "SSL"

Is this ws_url not wss?

        {
            "url": "electrum3.cipig.net:10057",
            "contact": [
                {
                    "email": "cipi@komodoplatform.com"
                },
                {
                    "discord": "cipi#4502"
                }
            ],
            "ws_url": "electrum3.cipig.net:30057"
        },

@cipig
Copy link
Member

cipig commented Sep 19, 2023

Is this ws_url not wss?

It is, everything is WSS, but "url": "electrum3.cipig.net:10057" is TCP and it gets added to SSL config

Maybe we should consolidate the config and only add either TCP or SSL ports to it, not both (if both are available). That would make it easier and also prevent double connections to same electrum server (just different port).
Or generate distinct configs, one only with TCP, the other one only with SSL.

@smk762
Copy link
Collaborator Author

smk762 commented Sep 20, 2023

I've modified it to now generate:

  • the original, complete coins_config.json
  • coins_config_tcp.json which only contains non-WSS protocol entries for electrum coins (TCP and SSL)
  • coins_config_ssl.json which only contains the SSL protocol entries for electrum coins
  • coins_config_wss.json which only contains only the ws_url entries for electrum coins
    The filtered json files also limit the number of entries to 3, as too many electrums can create timeouts when iterated for coins with lots of electrums (thanks @cipig for the tip)

Script now also outputs a summary after completion like

...
CRNC: [SSL True] [TCP True] [WSS True]
COLX: [SSL False] [TCP False] [WSS False]
ZET: [SSL False] [TCP True] [WSS False]

Total coins: 682
Total coins with SSL: 650
Total coins with TCP: 682
Total coins with WSS: 650

@cipig
Copy link
Member

cipig commented Sep 21, 2023

utils/coins_config_tcp.json contains both http and https for BEP20 tokens like this (should not contain duplicates)

        "nodes": [
            {
                "url": "http://bsc1.cipig.net:8655"
            },
            {
                "url": "http://bsc2.cipig.net:8655"
            },
            {
                "url": "http://bsc3.cipig.net:8655"
            },
            {
                "url": "https://bsc1.cipig.net:18655"
            },
            {
                "url": "https://bsc2.cipig.net:18655"
            },
            {
                "url": "https://bsc3.cipig.net:18655"
            }
        ],

some electrum servers are duplicated, like for BTX

        "electrum": [
            {   
                "url": "btx-electrumx.coinsmunity.com:50002",
                "protocol": "SSL",
                "disable_cert_verification": true,
                "contact": [
                    {
                        "discord": "[MadCatMining]#0677"
                    }
                ],
                "ws_url": "btx-electrumx.coinsmunity.com:50003"
            },
            {
                "url": "btx-electrumx.coinsmunity.com:50002",
                "protocol": "SSL",
                "disable_cert_verification": true,
                "contact": [
                    {
                        "discord": "[MadCatMining]#0677"
                    }
                ],
                "ws_url": "btx-electrumx.coinsmunity.com:50003"
            }
        ],

BTX can't be enabled, shows error

21 03:01:50, coins::utxo::utxo_builder::utxo_coin_builder:852] ERROR Electrum btx-electrumx.coinsmunity.com:50002 server.version error: JsonRpcError { client_info: "coin: BTX", request: JsonRpcRequest { jsonrpc: "2.0", id: "1", method: "server.version", params: [String("Komodo Wallet 0.6.1-beta GUI/MM2 1.1.0-beta_edf9ba1"), Array([String("1.2"), String("1.4")])] }, error: Response(btx-electrumx.coinsmunity.com:50002, Object({"code": Number(1), "message": String("server.version already sent")})) }

Copy link
Member

@cipig cipig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate electrums are gone, all coins can be enabled
the duplicate ERC20 and BEP20 entries are fixed here: #824

@smk762 smk762 merged commit 02c907f into master Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants