0

I'm working on a web project where I need to have the ability to accept crypto payments. Implementing bitcoin was fairly easy as there were api's whom allowed me to directly subscribe to a specific address and handle the rest that way, but with ethereum I find this to be much harder.
I'm working with a Nodejs server, I have installed and read the docs to web3js; with Infura as a provider, and I've come to the conclusion that I either need to

  • Write a smart contract - firing events when payments to my address are received
  • Subscribe to all new transactions and look for my address to pop up.

It feels like there has to be a better way to do this "simple" task. As of what I have heard, you simply can't use Web3 to subscribe to a "non contract address" which makes everything a bit harder.

Questions

  • What is the best thing to do in my situation? Write a smart contract to handle the incoming transactions

  • Iterate through all new transactions and look for my "subscribed" addresses to pop up?

  • Can this be achieved any other way than using my examples from above?

As it may sound - I would consider myself to be rather lost at this point. All guidance is deeply appreciated.

  • 1
    In your NodeJS code, you can poll your address endlessly, in order to catch incoming transactions. – goodvibration Oct 13 '19 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.