Skip to content

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 zomglings requested a review from kompotkot January 12, 2023 00:56
@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.

2 participants