aws-samples / aws-blockchain-node-runners

Run blockchain nodes on cloud
https://aws-samples.github.io/aws-blockchain-node-runners/
MIT No Attribution
50 stars 45 forks source link

What's the best practice to expose Solana RPC calls to the internet with selected ips? #95

Closed day-xy closed 2 months ago

day-xy commented 2 months ago

Please describe your question here

I want to call the RPC methods from my local workspace to test something. I'd like to know what the best practice is to do so. E.g., API gateway? Also, do I need to change any configuration in the script before exposing the RPC calls to the internet?

Provide a link to the example/module related to the question

Additional context

evertonfraga commented 2 months ago

Hi @day-xy.

For testing, the easiest would be to include your IP on the security group that rules over your EC2 instance.

You can choose "My IP" option on Inbound rules. And naturally, if your local IP changes, you'll have to make the change in the security group as well.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#adding-security-group-rule

frbrkoala commented 2 months ago

The more secure way will be to use AWS Client VPN, as described in this post for Arbitrum nodes on ECS: https://aws.amazon.com/blogs/database/run-a-serverless-arbitrum-full-node-on-aws/ . Thanks for the tip, we'll work on adding a doc on how to do that.

frbrkoala commented 2 months ago

UPD: created new Issue with request to add new doc: https://github.com/aws-samples/aws-blockchain-node-runners/issues/104