0

Let's say I run my own full node. I also use some browser extention-based wallet that'd normally use Infura as a gateway. Think of Metamask.

Now I want to switch "Infura" to my own full node. However, I also want allow some kind of authorization/authentication. That is, only certain wallets, from white-list, may be allowed to connect to and use my node. It's not about restricting by IP, but by wallet address.

How to do it?

P.S. if that has to involve writing custom code on any level, or even recompilation of a node with custom code, I'll be ok with it.

1
  • As said by Mikko the easiest solution is tu put a proxy in front of geth. You could use a server like nginx to authenticate the connection and forward the requests to geth.
    – Ismael
    Commented Nov 12, 2022 at 1:37

3 Answers 3

1

Backend generally has no say in what wallets it connects to. It just gets the signed requests to process and dont care who or what is used to sign the request. . If there is a front end, you could do that.

2
  • why "generally"? In what case it'll have a say? Commented Jul 12, 2022 at 12:43
  • I should remove that generally.
    – AoS
    Commented Jul 14, 2022 at 4:49
1

It's not about restricting by IP, but by the wallet address.

You need to run a proxy server that checks API calls against your own set of logic rules.

5
  • How to extract, in order to check, an API call from a request that's sent to my node? Commented Jul 12, 2022 at 12:42
  • With programming languages like JavaScript, Python, understanding of HTTP protocol, JSON-RPC and so on. Commented Jul 13, 2022 at 4:26
  • Will I also need a computer? and electricity? Why haven't you mentioned that? How about eyes? Commented Jul 13, 2022 at 4:50
  • You are asking a question that implies some weeks of programming work. It is outside of the scope of StackExchange to have anyone do this work for you. If you want to be ironic it's totally on you. I suggest hiring a programmer. Commented Jul 13, 2022 at 4:52
  • It's not outside of the scope of StackExchange. But your answer is. Commented Jul 13, 2022 at 5:33
0

This is a not a full Answer but I am trying to do the same thing as OP:

Looks like in geth source in /core/vm/evm.go, function "create" (line 406 in 1.10.26) is the single point call for contract creation and the address is in the param caller.

I was able to put a breakpoint there and looks promising, so next step is to test variable caller agains a list of whitelisted address.

I will keep updating my answer as I progress with my investigation.

I wish I could just write this a comment and not a answer but I am too green for StackExchange to comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.