diff --git a/README.md b/README.md index 79432c91b73a285a75a0d9b92196ed15d166432a..eebf50928516078c9ba1616a71f55ed6434c8a50 100644 --- a/README.md +++ b/README.md @@ -231,48 +231,6 @@ $ curl --data '{"jsonrpc":"2.0","id":0,"method":"hive.db_head_state","params":{} {"jsonrpc": "2.0", "result": {"db_head_block": 19930795, "db_head_time": "2018-02-16 21:35:42", "db_head_age": 10}, "id": 0} ``` -## Rewriter -Nginx acts as a rewriter, redirecting all JSON-RPC 2.0 calls to the `/rpc/home` endpoint to maintain compatibility with -the previous system version. The recently introduced PostgREST supports REST API, while legacy JSON-RPC calls must still -be handled. Nginx ensures that incoming JSON-RPC requests are rewritten as parameters to the REST `/rpc/home/` endpoint. -There are plans to introduce a proper REST API for Hivemind in the future. - -Using the rule: - -```log -rewrite ^/(.*)$ /rpc/home break; -``` -All URLs are rewritten to `/rpc/home`, where further request processing takes place, including the conversion from -JSON-RPC to SQL queries. - -This section describes how to build and run the Nginx container, which serves as a URL rewriter for JSON-RPC calls. - -1. Build the Docker image -```bash - docker build -t hivemind-nginx-rewriter . -```` - -2. Run the container -```bash - docker run -d --name hivemind-nginx-rewriter -p 80:80 hivemind-nginx -``` - -3. Configuration Files - -The container uses the following configuration files: -```log - nginx.conf.template – the main Nginx configuration. - rewrite_rules.conf – contains the rewrite rules. - rewriter_entrypoint.sh – the entrypoint script executed when the container starts. -``` -These files are copied into the container at build time. - -4. Stopping the container -```bash - docker stop hivemind-nginx -``` - - ## Tests To run api tests: