Unfortunately I'm using Linux, and bitcoin.conf is not maked auto ! so i make a file in the "/root/.bitcoin" path with this content:
prune=600
maxconnections=12
maxuploadtarget=20
rpcuser=user
rpcpassword=user
daemon=1
keypool=10000
So tell me why i cant connect to rpc json and i get following error : HTTP_UNAUTHORIZED
when i remove rpc user and rpc password, then in "terminal" everything is work, but when i set credential, i get following error:
Authorization failed: Incorrect rpcuser or rpcpassword
so this code not work:
bitocin-cli -rpcuser user -rpcpassword user getnewaddress
or
bitocin-cli -rpcuser=user -rpcpassword=user getnewaddress
my user is: "user" and password is "user". but why not work ?
why bitcoin have bug ?
this is very simple things. why this not work ?
php code not work:
$bitcoin = new Bitcoin('user','user', '127.0.0.1', '8332');
$info = $bitcoin->getBalance();
var_dump($info); // FALSE
var_dump($bitcoin); //HTTP_UNAUTHORIZED
nodejs code not work:
var bitcoin = require('bitcoin');
var client = new bitcoin.Client({
host: '127.0.0.1',
port: '8332',
user: 'user',
oass: 'user',
ssl: false,
sslStrict: false
});
client.getWalletInfo(function (err, result) {
if (err) {
res.send(err.message); // 401 status
}
else {
res.send(result);
}
});
just worked in terminal without creditnal.
how can fix this.