web3pi-proxy


Nameweb3pi-proxy JSON
Version 0.1a1 PyPI version JSON
download
home_pagehttps://github.com/Web3-Pi/web3-reverse-proxy
SummaryA Web3 Pi Node Manager - proxy to Web3 Pi Ethereum nodes
upload_time2024-07-05 10:08:18
maintainerNone
docs_urlNone
authorNone
requires_python<4.0,>=3.10
licenseGNU GENERAL PUBLIC LICENSE Version 3
keywords web3pi web3 rpi raspberry geth ethereum proxy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Web3Pi Reverse Proxy

A reverse proxy for Geth intended for use within Web3Pi ecosystem.

Web3Pi Reverse Proxy comes out-of-the-box with several features:
 
 - Multiple geth nodes - you can hide multiple Geth nodes under single instance of reverse proxy
 - JSON-RPC parser - our custom parser validates JSON-RPC requests before they reach the nodes
 - Admin portal - comes embedded in, allowing you the following:
	- Authentication - generate API-keys and control access to your reverse proxy
	- User plans - control how much data users can process
	- Activity stats - see how much data each user processes, monitor node usage
	- Admin API - use JSON-RPC based API to perform various operations on your reverse proxy
 
## Setup

Simply install `web3pi-proxy` package using your Python package manager, using **pip** for example:

```bash
pip install web3pi-proxy
```

Web3Pi Reverse Proxy expects you to provide **ETH_ENDPOINTS** environment variable to your system.

It should be a list of endpoint descriptors for JSON-RPC over HTTP communication with Geth.

Refer to the following example:

```bash
export ETH_ENDPOINTS='[{"name": "rpi geth 1", "url": "http://eop-1.local:8545/"}, {"name": "infura", "url": "https://mainnet.infura.io/v3/<YOUR_INFURA_API_KEY>"}]'
```

You can define as many endpoints as you wish and chose their names however suits you.

## Run

After configuring endpoints, you can run your reverse proxy with command

```bash
web3pi-proxy
```

## Admin service

Admin service starts alongside the reverse proxy.

You can access admin webpage with your browser using admin server's URL and providing **admin auth token** as a 'token' query param, like so:

```
http://0.0.0.0:6561/?token=<ADMIN_AUTH_TOKEN>
```

The **admin auth token** will be output to your terminal, during the launch.

Token is not stored and will be randomly generated on each launch.

Outside of admin portal, the admin service allows several operations, performed by submitting JSON-RPC requests.
Use **admin auth token** in **Authorization** header of your HTTP POST request for authentication.

### get_endpoints
Get list of currently configured endpoints, no parameters required.

### add_endpoint
Add new endpoint at runtime by providing its **name** and **URL**. For example, in order to add endpoint ***local*** under URL ***localhost:8545*** :

```
{"jsonrpc": "2.0", "method": "add_endpoint", "params": ["local", "http://localhost:8545/"], "id": 0}
```

**IMPORTANT:** Resulting changes are saved in local `.env` file for reuse.

### update_endpoint
Change existing endpoint's configuration at runtime by providing its **name** and **URL**. For example, in order to change endpoint's ***local*** port to ***8546*** :

```
{"jsonrpc": "2.0", "method": "update_endpoint", "params": ["local", "http://localhost:8546/"], "id": 0}
```

**IMPORTANT:** Resulting changes are saved in local `.env` file for reuse.

### remove_endpoint
Remove endpoint at runtime by providing its **name**. For example, in order to remove endpoint ***local*** :

```
{"jsonrpc": "2.0", "method": "update_endpoint", "params": ["local"], "id": 0}
```

**IMPORTANT:** Resulting changes are saved in local `.env` file for reuse.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Web3-Pi/web3-reverse-proxy",
    "name": "web3pi-proxy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "web3pi, web3, rpi, raspberry, geth, ethereum, proxy",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/65/b8/35fabc2f18a4c081ed2725418d42b0df11afa85df543e4f711e3beb413ed/web3pi_proxy-0.1a1.tar.gz",
    "platform": null,
    "description": "# Web3Pi Reverse Proxy\n\nA reverse proxy for Geth intended for use within Web3Pi ecosystem.\n\nWeb3Pi Reverse Proxy comes out-of-the-box with several features:\n \n - Multiple geth nodes - you can hide multiple Geth nodes under single instance of reverse proxy\n - JSON-RPC parser - our custom parser validates JSON-RPC requests before they reach the nodes\n - Admin portal - comes embedded in, allowing you the following:\n\t- Authentication - generate API-keys and control access to your reverse proxy\n\t- User plans - control how much data users can process\n\t- Activity stats - see how much data each user processes, monitor node usage\n\t- Admin API - use JSON-RPC based API to perform various operations on your reverse proxy\n \n## Setup\n\nSimply install `web3pi-proxy` package using your Python package manager, using **pip** for example:\n\n```bash\npip install web3pi-proxy\n```\n\nWeb3Pi Reverse Proxy expects you to provide **ETH_ENDPOINTS** environment variable to your system.\n\nIt should be a list of endpoint descriptors for JSON-RPC over HTTP communication with Geth.\n\nRefer to the following example:\n\n```bash\nexport ETH_ENDPOINTS='[{\"name\": \"rpi geth 1\", \"url\": \"http://eop-1.local:8545/\"}, {\"name\": \"infura\", \"url\": \"https://mainnet.infura.io/v3/<YOUR_INFURA_API_KEY>\"}]'\n```\n\nYou can define as many endpoints as you wish and chose their names however suits you.\n\n## Run\n\nAfter configuring endpoints, you can run your reverse proxy with command\n\n```bash\nweb3pi-proxy\n```\n\n## Admin service\n\nAdmin service starts alongside the reverse proxy.\n\nYou can access admin webpage with your browser using admin server's URL and providing **admin auth token** as a 'token' query param, like so:\n\n```\nhttp://0.0.0.0:6561/?token=<ADMIN_AUTH_TOKEN>\n```\n\nThe **admin auth token** will be output to your terminal, during the launch.\n\nToken is not stored and will be randomly generated on each launch.\n\nOutside of admin portal, the admin service allows several operations, performed by submitting JSON-RPC requests.\nUse **admin auth token** in **Authorization** header of your HTTP POST request for authentication.\n\n### get_endpoints\nGet list of currently configured endpoints, no parameters required.\n\n### add_endpoint\nAdd new endpoint at runtime by providing its **name** and **URL**. For example, in order to add endpoint ***local*** under URL ***localhost:8545*** :\n\n```\n{\"jsonrpc\": \"2.0\", \"method\": \"add_endpoint\", \"params\": [\"local\", \"http://localhost:8545/\"], \"id\": 0}\n```\n\n**IMPORTANT:** Resulting changes are saved in local `.env` file for reuse.\n\n### update_endpoint\nChange existing endpoint's configuration at runtime by providing its **name** and **URL**. For example, in order to change endpoint's ***local*** port to ***8546*** :\n\n```\n{\"jsonrpc\": \"2.0\", \"method\": \"update_endpoint\", \"params\": [\"local\", \"http://localhost:8546/\"], \"id\": 0}\n```\n\n**IMPORTANT:** Resulting changes are saved in local `.env` file for reuse.\n\n### remove_endpoint\nRemove endpoint at runtime by providing its **name**. For example, in order to remove endpoint ***local*** :\n\n```\n{\"jsonrpc\": \"2.0\", \"method\": \"update_endpoint\", \"params\": [\"local\"], \"id\": 0}\n```\n\n**IMPORTANT:** Resulting changes are saved in local `.env` file for reuse.\n",
    "bugtrack_url": null,
    "license": "GNU GENERAL PUBLIC LICENSE Version 3",
    "summary": "A Web3 Pi Node Manager - proxy to Web3 Pi Ethereum nodes",
    "version": "0.1a1",
    "project_urls": {
        "Homepage": "https://github.com/Web3-Pi/web3-reverse-proxy",
        "Repository": "https://github.com/Web3-Pi/web3-reverse-proxy"
    },
    "split_keywords": [
        "web3pi",
        " web3",
        " rpi",
        " raspberry",
        " geth",
        " ethereum",
        " proxy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84b90b0e034ec899c4cd102ff34d2d6ee55017d709414743fad91e73c25bca27",
                "md5": "a35ffddb4acbfc8d54079e58a391bbc5",
                "sha256": "3f504b5d6b68b4d543742f8d8844d709a5c26329f1e2a9df292bd3f95f8f7397"
            },
            "downloads": -1,
            "filename": "web3pi_proxy-0.1a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a35ffddb4acbfc8d54079e58a391bbc5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 86986,
            "upload_time": "2024-07-05T10:08:16",
            "upload_time_iso_8601": "2024-07-05T10:08:16.453493Z",
            "url": "https://files.pythonhosted.org/packages/84/b9/0b0e034ec899c4cd102ff34d2d6ee55017d709414743fad91e73c25bca27/web3pi_proxy-0.1a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65b835fabc2f18a4c081ed2725418d42b0df11afa85df543e4f711e3beb413ed",
                "md5": "52e196068888fafeec294a0e67b25695",
                "sha256": "63d1d7cf218d9492df06be2a2a074fedd2f803743775c1aa0eb18b8a60558e07"
            },
            "downloads": -1,
            "filename": "web3pi_proxy-0.1a1.tar.gz",
            "has_sig": false,
            "md5_digest": "52e196068888fafeec294a0e67b25695",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 60613,
            "upload_time": "2024-07-05T10:08:18",
            "upload_time_iso_8601": "2024-07-05T10:08:18.272056Z",
            "url": "https://files.pythonhosted.org/packages/65/b8/35fabc2f18a4c081ed2725418d42b0df11afa85df543e4f711e3beb413ed/web3pi_proxy-0.1a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-05 10:08:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Web3-Pi",
    "github_project": "web3-reverse-proxy",
    "github_not_found": true,
    "lcname": "web3pi-proxy"
}
        
Elapsed time: 0.29893s