### Install Wheel Files Source: https://github.com/meejah/txtorcon/blob/main/docs/installing.rst Procedure to upgrade setuptools and pip before installing a local wheel file. ```bash virtualenv foo . foo/bin/activate pip install --upgrade setuptools pip install --upgrade pip pip install path/to/txtorcon-*.whl ``` -------------------------------- ### Install and Serve Onion Service Source: https://github.com/meejah/txtorcon/blob/main/README.rst Commands to install txtorcon on Debian/Ubuntu and start a web server as an onion service. ```shell-session $ sudo apt-get install --install-suggests python3-txtorcon $ twistd -n web --port "onion:80" --path ~/public_html ``` -------------------------------- ### Install from Debian Backports Source: https://github.com/meejah/txtorcon/blob/main/docs/installing.rst Commands to add the wheezy-backports repository and install the package as root. ```shell-session # echo "deb http://ftp.ca.debian.org/debian/ wheezy-backports main" >> /etc/apt/sources.list # apt-get update # apt-get install python-txtorcon ``` -------------------------------- ### Basic txtorcon Usage Example Source: https://github.com/meejah/txtorcon/blob/main/docs/introduction.rst A foundational example demonstrating how to interact with the Tor control port using txtorcon. ```python from twisted.internet import reactor, defer from txtorcon import connect, launch @defer.inlineCallbacks def setup(tor): print("Connected to Tor version {}".format(tor.version)) state = yield tor.create_state() print("This Tor has {} circuits.".format(len(state.circuits))) # create a hidden service hs = yield tor.create_onion_service(80, [8080]) print("Created hidden service: {}".format(hs.hostname)) # either launch a new Tor or connect to an existing one # d = launch(reactor, tor_binary='/usr/bin/tor') d = connect(reactor) d.addCallback(setup) reactor.run() ``` -------------------------------- ### Set Up Development Environment Source: https://github.com/meejah/txtorcon/blob/main/docs/installing.rst Commands to clone the repository, create a virtual environment, and install development dependencies. ```shell-session $ git clone https://github.com/meejah/txtorcon.git $ echo "if you later fork it on github, do this:" $ git remote add -f github git+ssh://git@github.com//txtorcon.git $ cd txtorcon $ virtualenv venv $ source venv/bin/activate (venv)$ pip install --editable .[dev] # "dev" adds more deps, like Sphinx (venv)$ make doc (venv)$ make test (venv)$ tox # run all tests, in all supported configs ``` -------------------------------- ### Install Txtorcon Dependencies with pip (User) Source: https://github.com/meejah/txtorcon/blob/main/docs/installing.rst Installs core Txtorcon dependencies and development tools using pip for the current user. This is an alternative to system-wide installation. ```shell $ pip install --user Twisted ipaddress pygeoip $ echo "for development:" $ pip install --user GeoIP Sphinx repoze.sphinx.autointerface coverage ``` -------------------------------- ### Install and Run Onion Service via twistd Source: https://github.com/meejah/txtorcon/blob/main/docs/introduction.rst Use the shell to install txtorcon and launch a web server as an onion service using Twisted's twistd. ```shell-session $ sudo apt-get install --install-suggests python-txtorcon $ twistd web --port "onion:80" --path ~/public_html ``` -------------------------------- ### Verify SHA256 Checksums via Shell Source: https://github.com/meejah/txtorcon/blob/main/docs/release-checklist.rst Example of how to verify checksums using a heredoc and sha256sum. ```bash cat <