peatio icon indicating copy to clipboard operation
peatio copied to clipboard

not able to withdraw and deposit ETH. but successfully generated new ETH address.

Open sg552 opened this issue 8 years ago • 16 comments

Hi @yivo ,

I am not able to deposit nor withdraw. (however, the ETH address could be generated successfully)

I have successfully done the followings:

1.configured the 'pusher' 2.keep running a full node of ETH 3.keep the god daemons running, as below:

$ sudo god status
amqp:deposit_coin: up
amqp:deposit_coin_address: up
amqp:market_ticker: up
amqp:matching: up
amqp:order_processor: up
amqp:pusher_market: up
amqp:pusher_member: up
amqp:slave_book: up
amqp:trade_executor: up
amqp:withdraw_coin: up
coins: up
global_state: up
hot_wallets: up
k: up
payment_transaction: up
stats: unmonitored
websocket_api: up
withdraw_audit: up

4.the RPC-JSON parameters are correct. ( e.g. in "currencies" table , the options column is correct )

{"api_client":"ETH","json_rpc_endpoint":"http://127.0.0.1:8545","bitgo_test_net":true,"bitgo_wallet_id":null,"bitgo_wallet_address":null,"bitgo_wallet_passphrase":null,"bitgo_rest_api_root":"https://test.bitgo.com/api/v2","bitgo_rest_api_access_token":null,"wallet_url_template":"https://etherscan.io/address/#{address}","transaction_url_template":"https://etherscan.io/tx/#{txid}"}
  1. in "payment_addresses", the "address" and "secret" are generated, and correct.

  2. I checked the 'log/daemons' folder, no error message shown.

  3. I did transfer 0.03 ETH to the generated ETH address, but Peatio didn't know that , still shows 0.

My environment:

Ubuntu 16, Ruby 2.5.0, peatio & peatio-trading-ui: 1-6-stable and 1-8-stable .

Did I miss something? Could you give me a clue?

thanks so much! Siwei

sg552 avatar May 08 '18 14:05 sg552

Hi @sg552

  1. You should use the same peatio & trading UI version (e.g. 1.8 and 1.8)
  2. I believe your Go ethereum is not configured properly. You need admin RPC to be enabled.
  3. If you can reproduce this on peatio.trade it means problem in peatio code, otherwise problem in your configuration. ETHD is on the geth, ETH is on the BitGo.

yivo avatar May 08 '18 14:05 yivo

thanks @yivo,

  1. in fact I tried two times:
    (1). peatio 1-6-stable , with peatio-trading-ui 1-6-stable. (failed) (2). peatio 1-8-stable, with peatio-trading-ui 1-8-stable. (failed)

  2. I did some configuration, my eth data folder is: /opt/geth,
    and my geth start command is:

nohup sudo geth --rpc --rpcapi db,eth,net,web3,personal --fast --datadir /opt/geth/ &

I can create new account address via CURL command , looks like:

curl -X POST  -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": ......

Does this indicate my GETH correctly configured?

  1. OK, I haven't tried ETHD, nor BitGo. I will do that later.

sg552 avatar May 08 '18 14:05 sg552

@sg552 Can you try CoinAPI[:eth].create_address!?

yivo avatar May 13 '18 16:05 yivo

@yivo

the command CoinAPI[:eth].create_address! could successfully generate new ETH address. shown as below:

irb(main):003:0> CoinAPI[:eth].create_address
=> {:address=>"0x5b51ca3701af0807bf081c1b0487???c47ed35331", 
:secret=>"yL!*j5r0BZ(6(1Ww3hM@Bbr#C0x3xrX8S8bbbiAwp9fvCHM&?Z1D*RuEoLy8%bdIy"}
irb(main):004:0> CoinAPI[:eth].create_address!
=> {:address=>"0x7056cbcaaedb2e89b37992806aa76e3d3ba12???", :secret=>"X? 
WxG%0&n*/le@v#ykNXQZk99W?)xb6VrQz0bbbFEaU+Q!RJhs)p7$vXu&guwquh"}

sg552 avatar May 14 '18 02:05 sg552

@sg552 Have you started daemons?

yivo avatar May 14 '18 09:05 yivo

Yes , I started all the daemons.

I am working on this issue from the very details, and will give a update post of this issue once finish it.

sg552 avatar May 16 '18 02:05 sg552

Hi, @sg552 ! How are you? Did you solve the ETH problem: not able to withdraw and deposit ETH?

frivolous106 avatar May 28 '18 22:05 frivolous106

hi @frivolous106 , yes, I have re-implemented the part of depositing and withdrawing of ETH/ERC-20 tokens.

Peatio's way: each user has his own ETH wallet. this wallet is used by both depositing and withdrawing. this means, (let's say Jim is the user of Peatio, his wallet on Peatio is named as: JIM-WALLET-ON-PEATIO:

  • deposit: other wallet => JIM-WALLET-ON-PEATIO
  • withdraw: JIM-WALLET-ON-PEATIO => other wallet

This strategy is quite simple to understand. But it's not effective , or it's not suitable for most exchanges.
each exchange should have at least 2 wallet:

  1. PEATIO COLD WALLET: this wallet stores all the tokens/ethers from all the users. it just stores, but not sends token/eth.
  2. PEATIO HOT WALLET: it sends tokens/ETH to every user. ( its token/ETH is tranferred from somewhere( maybe from the COLD WALLET) ) the better strategy for exchange , should be:
    • deposit: other wallet => JIM-WALLET-ON-PEATIO, then => PEATIO-CODE-WALLET
    • withdraw: PEATIO-HOT-WALLET => other wallet.

so I totally rewrite this strategy , not very mature, but enough for an early-exchange to use.

If you want to do this, you have to:

  1. be familiar with Geth RPC tool of "transfer ETH/token" ( to withdraw)
  2. be familiar with etherscan.io API. ( to query the deposit)
  3. be familiar with "generating new wallet", "unlock/authorize"
  4. read codes from: lib/coin_api , and read the tables: deposits, withdraws,

Other suggestions:

  1. setting up the Geth server will cost you some time. for me is about 1 week. make sure you server has big enough memories. such as 24G or more. and disk is 300G.
  2. using the ETH and ERC-20 token the same address for an user. e.g. Jim's ETH wallet is: 0xa1b2...c3d4 Jim's token wallet is: 0xa1b2...c3d4
  3. don't generate the wallet address until the user request a new one. This strategy will save you a lot of work of managing the wallet.
  4. Peatio's code lies in "lib/coin_api", read these code , they are good examples for us to understand. (thank you @yivo ! , good job! )

It's a big project and this cost me about 1-2 weeks.

Good luck!

sg552 avatar May 29 '18 08:05 sg552

Thank very much for @sg552 . As i did guess, you are good at this aspect. Can i discuss with you on skype or QQ? My QQ id is 3027183101. I am eagerly waiting for your request. I want to follow you at soon.

frivolous106 avatar May 29 '18 09:05 frivolous106

I am closing this issue. Seems like problem is resolved. If no – please free to ping me.

yivo avatar May 29 '18 11:05 yivo

Hi, @yivo . How are you? I have not solved my issue. I cannot understand the ETH deposit and withdrawal problem. In Bitcoin case , in bitcoin.conf there is a config item named walletnotify. When the user deposit Bitcoin, the Peatio can be noticed through this item.

In ETH case, how can the peatio platform be noticed that the ETH was sent to the user wallet? Please tell me about the question.

frivolous106 avatar May 29 '18 11:05 frivolous106

It is not possible to make notifications for GETH now. Try Google this.

yivo avatar May 29 '18 11:05 yivo

Thank for your response. What can i refer? Best regards. And bch, dash, xrp and ltc cannot make notifications? Now you can only support about BTC?

frivolous106 avatar May 29 '18 11:05 frivolous106

You can try walletnotify for ETH.

yivo avatar May 29 '18 11:05 yivo

Thank very much for @yivo . I did try, but it cannot get any notifications.

  1. And bch, dash, xrp and ltc cannot make notifications? Now you can only support about BTC?
  2. Now i set btc, bch and ltc JSON-RPC config as the same in currencies.yml. So about above three coin, they are using the same daemon as Bitcoind. Is it right? If i have a mistake, please tell me the install url about three coin.
  3. Xrp and dash I want these too.

Thank @yivo Best regards.

frivolous106 avatar May 29 '18 11:05 frivolous106

Hi, @yivo Please tell me about the solution. I am waiting for 2 hours.

frivolous106 avatar May 29 '18 13:05 frivolous106