not able to withdraw and deposit ETH. but successfully generated new ETH address.
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}"}
-
in "payment_addresses", the "address" and "secret" are generated, and correct.
-
I checked the 'log/daemons' folder, no error message shown.
-
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
Hi @sg552
- You should use the same peatio & trading UI version (e.g. 1.8 and 1.8)
- I believe your Go ethereum is not configured properly. You need admin RPC to be enabled.
- 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.
thanks @yivo,
-
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) -
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?
- OK, I haven't tried ETHD, nor BitGo. I will do that later.
@sg552 Can you try CoinAPI[:eth].create_address!?
@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 Have you started daemons?
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.
Hi, @sg552 ! How are you? Did you solve the ETH problem: not able to withdraw and deposit ETH?
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:
- PEATIO COLD WALLET: this wallet stores all the tokens/ethers from all the users. it just stores, but not sends token/eth.
- 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:
- be familiar with Geth RPC tool of "transfer ETH/token" ( to withdraw)
- be familiar with etherscan.io API. ( to query the deposit)
- be familiar with "generating new wallet", "unlock/authorize"
- read codes from: lib/coin_api , and read the tables: deposits, withdraws,
Other suggestions:
- 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.
- 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
- 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.
- 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!
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.
I am closing this issue. Seems like problem is resolved. If no – please free to ping me.
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.
It is not possible to make notifications for GETH now. Try Google this.
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?
You can try walletnotify for ETH.
Thank very much for @yivo . I did try, but it cannot get any notifications.
- And bch, dash, xrp and ltc cannot make notifications? Now you can only support about BTC?
- 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.
- Xrp and dash I want these too.
Thank @yivo Best regards.
Hi, @yivo Please tell me about the solution. I am waiting for 2 hours.