We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there some way to add support for .cookie connection? I was not able to establish a connection.
Thanks!
The text was updated successfully, but these errors were encountered:
You can use your cookie file out of the box!
Its easy, the only think what you do is to create an small script which you must load before your app starts.
Example:
set-env-vars.js:
import fs from 'fs'; const COOKIE_FILE_PATH = '/<PATH_TO_YOUR_COOKIE_FILE>/.cookie'; const content = fs.readFileSync(COOKIE_FILE_PATH, 'utf8'); const [user, pass] = content.split(':'); process.env.BITCOIN_RPC_USER = user; process.env.BITCOIN_RPC_PASS = pass;
Load this script on the start of your application by adding import './set-env-vars.js';
import './set-env-vars.js';
Thats is it. You can test it with restart your bitcoin-node and comparing the .cookie files with the console.log output ;)
console.log(`${process.env.BITCOIN_RPC_USER} : ${process.env.BITCOIN_RPC_PASS}`);
Sorry, something went wrong.
No branches or pull requests
Is there some way to add support for .cookie connection? I was not able to establish a connection.
Thanks!
The text was updated successfully, but these errors were encountered: