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

Add support for gzip compressing the grinnode.live node's HTTP responses #36

Open
NicolasFlamel1 opened this issue Dec 30, 2022 · 0 comments

Comments

@NicolasFlamel1
Copy link

Several Grin wallets, including the version of Ledger Live Desktop & Mobile with Grin support and the Grin version of the MimbleWimble Coin web wallet, are capable of processing gzip compressed HTTP responses and use the grinnode.live node as their default Grin mainnet node.

Adding support for gzip compressing the grinnode.live node's HTTP responses will reduce syncing times and data usage for the users of those wallets.

You can test this feature by running the following command.

curl -v -H 'Accept-Encoding: gzip' https://grinnode.live:3413/v2/foreign -d '{"jsonrpc":"2.0","id":1,"method":"get_unspent_outputs","params":[2, 12730570, 2000, true]}'

The HTTP request shown will include the Accept-Encoding: gzip header which indicates that the client supports a gzip compressed response.

> POST /v2/foreign HTTP/1.1
> Host: grinnode.live:3413
> User-Agent: curl/7.68.0
> Accept: */*
> Accept-encoding: gzip
> Content-Length: 90
> Content-Type: application/x-www-form-urlencoded

The HTTP response shown won't include the Content-Encoding: gzip header and isn't gzip compressed since the grinnode.live node doesn't currently support this feature.

< HTTP/1.1 200 OK
< access-control-allow-origin: *
< access-control-allow-headers: Content-Type, Authorization
< content-type: application/json
< content-length: 3469833
< date: Fri, 30 Dec 2022 13:03:41 GMT
< vary: Accept-Encoding,Origin
< vary: Accept-Encoding,Origin
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

No branches or pull requests

1 participant