Bitcoin Forum
November 06, 2024, 12:05:21 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Newbie in "bitcoin core"  (Read 365 times)
Jessica432 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 1


View Profile
September 24, 2018, 03:31:49 AM
 #1

I am new to bitcoin world. I have installed bitcoin core (https://bitcoincore.org/en/download/) on windows machine and running the full node. Now I want to develop nodejs code on the same machine, using which I can get 'balance/transfer funds/create wallet/etc' which connects to my locally running full node. I will really appreciate any pointers or sample code to achieve that.

THanks,
Jessica
HeRetiK
Legendary
*
Offline Offline

Activity: 3108
Merit: 2177


Playgram - The Telegram Casino


View Profile
September 24, 2018, 09:52:54 AM
 #2

Look into the bitcoin-core and bitcoind-rpc npm packages.

https://www.npmjs.com/package/bitcoin-core

https://www.npmjs.com/package/bitcoind-rpc

Unfortunately they don't seem to be as well maintained as they used to be, but both come with enough example code to get you started.

▄▄███████▄▄███████
▄███████████████▄▄▄▄▄
▄████████████████████▀░
▄█████████████████████▄░
▄█████████▀▀████████████▄
██████████████▀▀█████████
████████████████████████
██████████████▄▄█████████
▀█████████▄▄████████████▀
▀█████████████████████▀░
▀████████████████████▄░
▀███████████████▀▀▀▀▀
▀▀███████▀▀███████

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 
Playgram.io
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

▄▄▄░░
▀▄







▄▀
▀▀▀░░
▄▄▄███████▄▄▄
▄▄███████████████▄▄
▄███████████████████▄
▄██████████████▀▀█████▄
▄██████████▀▀█████▐████▄
██████▀▀████▄▄▀▀█████████
████▄▄███▄██▀█████▐██████
█████████▀██████████████
▀███████▌▐██████▐██████▀
▀███████▄▄███▄████████▀
▀███████████████████▀
▀▀███████████████▀▀
▀▀▀███████▀▀▀
██████▄▄███████▄▄████████
███▄███████████████▄░░▀█▀
███████████░█████████░░
░█████▀██▄▄░▄▄██▀█████░
█████▄░▄███▄███▄░▄█████
███████████████████████
███████████████████████
██░▄▄▄░██░▄▄▄░██░▄▄▄░██
██░░░░██░░░░██░░░░████
██░░░░██░░░░██░░░░████
██▄▄▄▄▄██▄▄▄▄▄██▄▄▄▄▄████
███████████████████████
███████████████████████
 
PLAY NOW

on Telegram
[/
Joel_Jantsen
Legendary
*
Offline Offline

Activity: 2030
Merit: 1324

Get your game girl


View Profile
September 24, 2018, 10:29:52 PM
 #3

I am new to bitcoin world. I have installed bitcoin core (https://bitcoincore.org/en/download/) on windows machine and running the full node. Now I want to develop nodejs code on the same machine, using which I can get 'balance/transfer funds/create wallet/etc' which connects to my locally running full node. I will really appreciate any pointers or sample code to achieve that.

THanks,
Jessica
It would be very complex if you don't rely on third-party libraries to interact with the bitcoin-core. As someone mentioned above, most of the npm packages to interact with the core are not being maintained. If your use case lies just between getting balance/transfer funds/create a wallet, you can use this library https://github.com/bitcoinjs/bitcoinjs-lib They're widely used and have a strong community.
Jessica432 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 1


View Profile
September 25, 2018, 06:12:30 AM
 #4

If I use: https://github.com/bitcoinjs/bitcoinjs-lib   How would I connect it to local running node (bitcoin-core)?
Jessica432 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 1


View Profile
September 25, 2018, 01:19:07 PM
 #5

From https://bitcoin.org/en/developer-examples - I am not able to locate bitcoin.conf after installing bitcoin core and running 'bitcoin core testnet' on my box.
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
September 25, 2018, 01:45:23 PM
 #6

From https://bitcoin.org/en/developer-examples - I am not able to locate bitcoin.conf after installing bitcoin core and running 'bitcoin core testnet' on my box.

I assume you're running windows 7/8/10.

If so, it should be located in the following path:

Quote
Windows Vista, 7, 10C:\Users\<username>\AppData\Roaming\Bitcoin                                            
As per https://bitcoin.stackexchange.com/questions/11190/where-is-the-configuration-file-of-bitcoin-qt-kept
       
That is ofcourse, if you have already generated it. (By going to Settings -> "Open Configuration File")  - https://bitcoin.stackexchange.com/a/11210/ (See comments)



And;
https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File
Quote
Note: if running Bitcoin in testnet mode, the sub-folder "testnet" will be appended to the data directory automatically.


Jessica432 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 1


View Profile
September 26, 2018, 08:27:07 AM
 #7

I realised I can not get balance of any address using bitcoin core. See here: https://bitcoin.stackexchange.com/questions/59237/determine-address-balance-using-bitcoin-core?rq=1

This is weird!
Joel_Jantsen
Legendary
*
Offline Offline

Activity: 2030
Merit: 1324

Get your game girl


View Profile
September 26, 2018, 09:33:59 AM
 #8

I realised I can not get balance of any address using bitcoin core. See here: https://bitcoin.stackexchange.com/questions/59237/determine-address-balance-using-bitcoin-core?rq=1

This is weird!
That question has an accepted answer, have you tried that? Also, remember you're a programmer, you should always post your questions with code that you tried and the resulting error you see on the console to help us understand the issue better. No one will be able to assist you with inadequate information.
lightningslotmachine
Newbie
*
Offline Offline

Activity: 22
Merit: 6


View Profile WWW
September 26, 2018, 01:45:44 PM
 #9

I recommend that you take it one step further and setup both bitcoin and lightning.

Start by running on the test net so you can play around with sending and receiving with no risk at all.

Here is a nice project in nodejs, it shows how to use all bitcoin and lightning commands via API calls and displaying the result in a nice interactive dashboard:

https://github.com/altangent/lnd-explorer

Here is an example of how it looks like:

https://demo1.lndexplorer.com/
lightningslotmachine
Newbie
*
Offline Offline

Activity: 22
Merit: 6


View Profile WWW
September 26, 2018, 01:52:25 PM
 #10

I would also recommend that instead of running a bitcoin node on your desktop computer, you set up a dedicated server to do it.
It can be something as simple and cheap as a raspberry pi

Here is a great tutorial

https://github.com/Stadicus/guides/tree/master/raspibolt

The problem with running bitcoin core (and lightning especially) on your desktop is that it's not online 24/7 and have a bunch of other stuff running at the same time.
There is also a security issue, better to have a securely setup Linux box dedicated for only bitcoin.
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
September 26, 2018, 04:38:30 PM
 #11

I recommend that you take it one step further and setup both bitcoin and lightning.

Start by running on the test net so you can play around with sending and receiving with no risk at all.

Here is a nice project in nodejs, it shows how to use all bitcoin and lightning commands via API calls and displaying the result in a nice interactive dashboard:

https://github.com/altangent/lnd-explorer

Here is an example of how it looks like:

https://demo1.lndexplorer.com/

Why would he make it more difficult than needed? He clearly states that he's new to bitcoin. I'm not entirely sure if diving into LN is something you'd want to do when you barely understand Bitcoin Core yet. Especially with the amount of bugs/development that is going on around LN.


-x-

The problem with running bitcoin core (and lightning especially) on your desktop is that it's not online 24/7 and have a bunch of other stuff running at the same time.

A raspberry pi? Do people still use these?

Also, he wants to use his node to get "balances/transfer (I presume his own) funds". There really wouldn't be any reason to run a node specifically for that purpose 24/7.

Quote
There is also a security issue, better to have a securely setup Linux box dedicated for only bitcoin.
What exactly are you referring to? What exploit?

yangchigi
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
September 28, 2018, 04:23:13 AM
 #12

you can use bitpay's  library.

bitpay's nodejs library's  can use interface bitcoin-core.

and you can use insight.bitcoin.com , that site api is using bitcoin api (like balance,tx , send rawtrasactions ) without bitcoin-core deamon.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!