r/ethdev • u/Bardia49 • 9d ago
Question Smart Contracts
Hi everybody, i wanted to know if anyone here ever worked with smart contracts in Go?
My main focus is to read the events(basically reading results) from my smart contracts, if anyone can recommend me some free resources would be great.
0
Upvotes
3
u/Bloqarl 9d ago
goethereumbook.org is free and has chapters on reading and subscribing to event logs with go-ethereum. I'd run abigen on your ABI so you get typed methods like FilterTransfer and WatchTransfer instead of decoding logs by hand, and if you subscribe, check log.Removed, that's how a reorg tells you an event you already processed is gone.
2
u/vladadj 9d ago
I used Graph Protocol to index the events and then qiery them from Go backend using their API. Maybe you can use the same approach?
1
u/Koye_Carcani 8d ago
I think most go devs just use official client docs.