cryptoadvance.spectrum


Namecryptoadvance.spectrum JSON
Version 0.6.9 PyPI version JSON
download
home_pageNone
SummaryImplements A Bitcoin Core API which querying an Electrum
upload_time2024-06-25 12:30:01
maintainerNone
docs_urlNone
authorStepan Snigirev, k9ert
requires_python>=3.10
licenseMIT License Copyright (c) 2023 specter.solutions Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Spectrum - Specter Desktop + Electrum

This is a electrum-adapter. It exposes a Bitcoin-Core style API while using an electron API in the backend. It might be useful in specific usecases, e.g. having better performance when connecting to a electrum-server via Tor. In order to do that, it needs a Database. Quite easily you can use a kind of builtin SQLite. Depending on your usecase, you might want to use an external DB.

## Modes of usage

This can be used either in standalone mode or as a specter-extension. The second option is probably the main use-case.

## Standalone

Get this to work with something like that:
```
python3 --version # Make sure you have at least 3.8. Might also work with lower versions though
virtualenv --python=python3 .env
. ./.env/bin/activate
pip3 install -e .

# If you have a electrum server running on localhost:
python3 -m cryptoadvance.spectrum server --config cryptoadvance.spectrum.config.NigiriLocalElectrumLiteConfig

# If you want to run on mainnet and use emzy's Server
python3 -m cryptoadvance.spectrum server --config cryptoadvance.spectrum.config.EmzyElectrumLiteConfig

# Using Emzy's server but with a postgres
export DB_USERNAME=bla
export DB_PASSWORD=blub
python3 -m cryptoadvance.spectrum server --config cryptoadvance.spectrum.config.EmzyElectrumPostgresConfig
```

Check the `config.py` for the env-vars which need to be exported in order to connect to something different than localhost.

## Specter Extension

In order to get a development environment:
```
virtualenv --python=python3 .env
. ./.env/bin/activate
pip3 install -e .
pip3 install cryptoadvance.specter
python3 -m cryptoadvance.specter server --config DevelopmentConfig --debug
```


## TODO:

- refill keypool when address is used or new address is requested
- flask `debug=True` flag creates two electrum sockets that notify twice - this causes duplications in the database
- reconnect with electrum on disconnect
- add support for credentials / cookie file for RPC calls


## Run the Tests

```sh
pip3 install -e ".[test]"
pytest
```

## Development

Before your create a PR, make sure to [blackify](https://github.com/psf/black) all your changes. In order to automate that,
there is a git [pre-commit hook](https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/) which you can simply install like this:
```
pre-commit install
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cryptoadvance.spectrum",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Stepan Snigirev, k9ert",
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# Spectrum - Specter Desktop + Electrum\n\nThis is a electrum-adapter. It exposes a Bitcoin-Core style API while using an electron API in the backend. It might be useful in specific usecases, e.g. having better performance when connecting to a electrum-server via Tor. In order to do that, it needs a Database. Quite easily you can use a kind of builtin SQLite. Depending on your usecase, you might want to use an external DB.\n\n## Modes of usage\n\nThis can be used either in standalone mode or as a specter-extension. The second option is probably the main use-case.\n\n## Standalone\n\nGet this to work with something like that:\n```\npython3 --version # Make sure you have at least 3.8. Might also work with lower versions though\nvirtualenv --python=python3 .env\n. ./.env/bin/activate\npip3 install -e .\n\n# If you have a electrum server running on localhost:\npython3 -m cryptoadvance.spectrum server --config cryptoadvance.spectrum.config.NigiriLocalElectrumLiteConfig\n\n# If you want to run on mainnet and use emzy's Server\npython3 -m cryptoadvance.spectrum server --config cryptoadvance.spectrum.config.EmzyElectrumLiteConfig\n\n# Using Emzy's server but with a postgres\nexport DB_USERNAME=bla\nexport DB_PASSWORD=blub\npython3 -m cryptoadvance.spectrum server --config cryptoadvance.spectrum.config.EmzyElectrumPostgresConfig\n```\n\nCheck the `config.py` for the env-vars which need to be exported in order to connect to something different than localhost.\n\n## Specter Extension\n\nIn order to get a development environment:\n```\nvirtualenv --python=python3 .env\n. ./.env/bin/activate\npip3 install -e .\npip3 install cryptoadvance.specter\npython3 -m cryptoadvance.specter server --config DevelopmentConfig --debug\n```\n\n\n## TODO:\n\n- refill keypool when address is used or new address is requested\n- flask `debug=True` flag creates two electrum sockets that notify twice - this causes duplications in the database\n- reconnect with electrum on disconnect\n- add support for credentials / cookie file for RPC calls\n\n\n## Run the Tests\n\n```sh\npip3 install -e \".[test]\"\npytest\n```\n\n## Development\n\nBefore your create a PR, make sure to [blackify](https://github.com/psf/black) all your changes. In order to automate that,\nthere is a git [pre-commit hook](https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/) which you can simply install like this:\n```\npre-commit install\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 specter.solutions  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Implements A Bitcoin Core API which querying an Electrum",
    "version": "0.6.9",
    "project_urls": {
        "Homepage": "https://github.com/cryptoadvance/spectrum"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc3e454d51c30bbe43162466223dd2c56f9666f86c1fe12e6d5b541258e8de08",
                "md5": "8c89b31d8115ffcd82dfb184959410ef",
                "sha256": "c7d69e81afbd255368fe369f6d9c5da0b9d32ed3bc8e582f8ca61576cd13efac"
            },
            "downloads": -1,
            "filename": "cryptoadvance.spectrum-0.6.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8c89b31d8115ffcd82dfb184959410ef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 38679,
            "upload_time": "2024-06-25T12:30:01",
            "upload_time_iso_8601": "2024-06-25T12:30:01.861270Z",
            "url": "https://files.pythonhosted.org/packages/dc/3e/454d51c30bbe43162466223dd2c56f9666f86c1fe12e6d5b541258e8de08/cryptoadvance.spectrum-0.6.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-25 12:30:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cryptoadvance",
    "github_project": "spectrum",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "cryptoadvance.spectrum"
}
        
Elapsed time: 0.61651s