1

I need to check for customers' deposits and need to scan for receiving transactions for those addresses for Ether and in next step ERC-20 tokens. What's the most efficient way to do this with go-ethereum?

  • hard stuff. you better check Etherscan.io if, it helps you , then you are done. If not, you will have to implement everything with web3, download the full blockchain and keep it in sync, lots of work. – Nulik Feb 27 '18 at 4:14
  • yes, that's my work :) – jeff Feb 27 '18 at 6:53
  • make sure you are paid well enough, crypto's experts are highly quoted today – Nulik Feb 27 '18 at 12:56
  • I think the best way would be to run a crone job to check their balances. If the balance is updated, you can subtract from previous balance to get deposits. – Prashant Prabhakar Singh Apr 12 '18 at 19:16
0

I am looking for the same solution, as far as I know, web3js can watch events, but after received the events, also need to wait for more confirmations(say 30) in case of rollback(double spending). My target solution is to use golang to interactive with geth(installed in local and open rpc service), but haven't find the way. Node may do the work.

Don't use javascript to do it.

0

One options is to run your own node and enable tracing.

With this, code can :

  1. Listen for new blocks (E.g.: Event on Mining of a new block )
  2. For each new block, iterate over all transactions ("transactions" property of Block)
  3. For each transaction, trace the transaction to find out all value transfers (geth : https://github.com/ethereum/go-ethereum/wiki/Tracing:-Introduction ; parity : https://github.com/paritytech/wiki/blob/master/JSONRPC-trace-module.md#trace_replaytransaction. Some details : Instrumenting EVM)
  4. This should provide list of all addresses that were impacted by a particular transaction (By direct value transfer or internal transactions as part of contract)
  5. For each address; Either implement your own code to reconstruct value from trace or query value as of that block
  6. Update your own DB / Storage with these changes
0

No easy to answer to this. You'll need to run a node or use infura and index every event log topic and data in every new transaction in every new block. You may use a pub/sub mechanism such as redis to publish new events when your indexing worker comes across events that you're interested in.

-2

You don't need to use geth to do this, you can just create a smart contract that accepts ETH and gives the ERC20 in return.

  • We are not doing an ICO - there are no tokens we want to issue. We need to keep track of received deposits which could be Ether or tokens. Smart contract is an option but currently we decided against it. Cons contract: we can not track funds received from other contracts and exchanges, users have to submit tracking information which identifies them which makes usability more complicated. – jeff Feb 26 '18 at 21:11

Your Answer

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

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