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 x-node-url response header to requests #747

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

zomglings
Copy link
Contributor

Changes

The x-node-url response header specifies which node a JSONRPC request served by a blockchain (not database) was served from.

How to test these changes?

Tested locally with curl:

curl -v --request POST "http://127.0.0.1:8544/nb/polygon/jsonrpc?access_id=$NB_CONTROLLER_ACCESS_ID&data_source=blockchain" \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "jsonrpc":"2.0",
        "method":"eth_blockNumber",
        "id":1
    }'

Related issues

@zomglings
Copy link
Contributor Author

@bugout-dev check

@zomglings
Copy link
Contributor Author

I don't want to merge this. I would like to add a name field for nodes and then use the name in a response header instead of hte full JSONRPC URL. The current implementation could leak access keys to third party node providers.

@kompotkot kompotkot marked this pull request as draft January 12, 2023 15:35
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

Successfully merging this pull request may close these issues.

None yet

1 participant