When run peatio in Production environment it does not feth Bitcoin RPC user name And Password
When run in development it fetches btc rpc user name and password but when rub in production environment it does not fetch it following in amqq_deposit_coin_address.log
#<Faraday::Error: -- HTTP 401 Unauthorized --
-- Request URL -- http://127.0.0.1:18332/
-- Request Method -- POST
-- Request headers -- {"Authorization":"Basic dXNlcjpwYXNzd29yZA==","User-Agent":"Faraday v0.14.0","Accept":"application/json","Content-Type":"application/json"}
-- Request body -- {"jsonrpc":"1.0","method":"getnewaddress","params":[]}
-- Response headers -- {"www-authenticate":"Basic realm="jsonrpc"","date":"Mon, 25 Jun 2018 07:15:53 GMT","content-length":"0","content-type":"text/html; charset=ISO-8859-1","connection":"close"}
-- Response body --
/home/ubuntu/code/peatio-1-8-stable/config/initializers/faraday.rb:22:in assert_success!'
/home/ubuntu/code/peatio-1-8-stable/lib/coin_api/btc.rb:65:in json_rpc'
/home/ubuntu/code/peatio-1-8-stable/lib/coin_api/btc.rb:32:in create_address!'
/home/ubuntu/code/peatio-1-8-stable/app/models/worker/deposit_coin_address.rb:18:in block (2 levels) in process'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/activerecord-4.2.10/lib/active_record/locking/pessimistic.rb:72:in block in with_lock'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in block in transaction'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/transaction.rb:184:in within_new_transaction'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in transaction'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:220:in transaction'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/activerecord-4.2.10/lib/active_record/transactions.rb:277:in transaction'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/activerecord-4.2.10/lib/active_record/locking/pessimistic.rb:70:in with_lock'
/home/ubuntu/code/peatio-1-8-stable/app/models/worker/deposit_coin_address.rb:14:in block in process'
/home/ubuntu/code/peatio-1-8-stable/app/models/worker/deposit_coin_address.rb:13:in tap'
/home/ubuntu/code/peatio-1-8-stable/app/models/worker/deposit_coin_address.rb:13:in process'
lib/daemons/amqp_daemon.rb:60:in call'
lib/daemons/amqp_daemon.rb:60:in block (2 levels) in call'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/bunny-2.9.2/lib/bunny/channel.rb:1717:in block in handle_frameset'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/bunny-2.9.2/lib/bunny/consumer_work_pool.rb:107:in block (2 levels) in run_loop'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/bunny-2.9.2/lib/bunny/consumer_work_pool.rb:102:in loop'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/bunny-2.9.2/lib/bunny/consumer_work_pool.rb:102:in block in run_loop'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/bunny-2.9.2/lib/bunny/consumer_work_pool.rb:101:in catch'
/home/ubuntu/.rvm/gems/ruby-2.5.0/gems/bunny-2.9.2/lib/bunny/consumer_work_pool.rb:101:in run_loop'
Received: {"account_id":5,"locale":"en"}
[1m[36mAccount Load (0.4ms)[0m [1mSELECT accounts.* FROM accountsWHEREaccounts.id= 5 LIMIT 1[0m
[1m[35mCurrency Load (0.3ms)[0m SELECT currencies.* FROM currenciesWHEREcurrencies.id= 5 LIMIT 1
[1m[36mPaymentAddress Load (0.4ms)[0m [1mSELECT payment_addresses.* FROM payment_addressesWHEREpayment_addresses.account_id= 5 ORDER BYpayment_addresses.idDESC LIMIT 1[0m
[1m[35m (0.1ms)[0m BEGIN
[1m[36mPaymentAddress Load (0.5ms)[0m [1mSELECT payment_addresses.* FROM payment_addressesWHEREpayment_addresses.id= 11 LIMIT 1 FOR UPDATE[0m
[1m[35mCurrency Load (0.3ms)[0m SELECT currencies.* FROM currenciesWHEREcurrencies.code` = 'ltc' LIMIT 1
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
It sends username & password. Do you see "Authorization":"Basic dXNlcjpwYXNzd29yZA==",?
You have to try this manually using cURL.
I know it is username and password. But it is not fetching from database which i have save. according to btc.rb def connection Faraday.new(@json_rpc_endpoint).tap do |connection| unless @json_rpc_endpoint.user.blank? connection.basic_auth(@json_rpc_endpoint.user, @json_rpc_endpoint.password) end end end
here you can see it is using user as user and password as password means user is blank
@HafeezRai Try changing env from development to production in peatio/lib/daemons/daemons.god on first line
I have changed to production but it is still not fetching
@HafeezRai Not sure why, did you tried it with 8332 port maybe testnet is not working in production
this is 18332 for testnet. i have also tried CoinAPI[:btc].create_address! This is generating address but in web it does not show and also fetching user and password from db