What is the best way to verify a (Metamask) transaction has happened on NodeJS?
Use case:
A user buys a digital card with ether. After the user buys the digital card, a route on the server runs some code, makes a PDF, etc..
What is the recommended way to have a server (ExpressJS) verify that a tx has happened and is successful?
I was thinking of two options, but I'm pretty new to Ethereum so I'm probably missing some details here.
- Have the server listen to events from the contract. When an event comes in, it'll have the user's address and prove they paid. Than I can make the card.
The only thing that I'm concerned here with is that maybe some details of the card are private. And if it's in the logs, it'll be public. 🤔
or..
- OR have the user sign the message locally, push it to the server and somehow send it to the contract. I'm not sure what the details are with this route.
Are there any recommended ways to accomplish something like this?