0

I'm developing a DApp, and I need some logic to handle events. This shouldn't be done in the Frontend of the application, right? So what would a good approach look like. I thought about a Java-Backend (if thats even possible), how would I connect it to the Frontend in a good way. Also if I would put my logic in the same project as my frontend and deploy it on a domain, how would I be safe, that no access to the backend is granted.

Greetings

2
  • See The Graph. Sep 23, 2021 at 17:09
  • You could manage events client-side if you wish. But, in my opinion, you should do this in very specific cases – e.g. fixed number of contracts, or if your application necessitates a wallet connection, you can extract event logs from the transaction receipts instead of querying the blockchain.
    – Sloth Man
    Sep 23, 2021 at 20:21

2 Answers 2

0

I found a tutorial which helped me get started initially. Please check and I hope it helps. https://dev.to/dabit3/the-complete-guide-to-full-stack-ethereum-development-3j13

0

You are looking for an API, It can be written with nodeJS and will act as a Centralized Endpoint in your backend.

Note that a Dapp, exist only in the front-end, on the users terminal. It's decentralized in this way. So you have to consider who will query the API?. Because a decentralized app will query your API from all over the world.

And you will also be limited in the authentication procedure because you will try to authenticate anyone from any endpoint. Cors will not like that.

It really depends on what kind of event you want to listen for, from where, to where.

If you need to run some specific action on your contract event you might want to look at Open Zeppelin Defender.

1
  • Well, my DApp is good to go, but I have to store values and stuff from events in a database, and I dont know how to connect it. For example storing everyone who commited something on the DApp in a List and printing it onto the Frontend.
    – Luex
    Sep 24, 2021 at 15:16

Your Answer

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

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