https://github.com/codeincrypt/bitcoin-rpc-nodejs-api
Bitcoin RPC API migration with Node Js Rest API
https://github.com/codeincrypt/bitcoin-rpc-nodejs-api
Last synced: 7 days ago
JSON representation
Bitcoin RPC API migration with Node Js Rest API
- Host: GitHub
- URL: https://github.com/codeincrypt/bitcoin-rpc-nodejs-api
- Owner: codeincrypt
- Created: 2023-02-02T17:08:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-23T18:02:15.000Z (about 3 years ago)
- Last Synced: 2025-11-27T13:29:43.230Z (7 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Configuring Login Information
In order to use the Bitcoin RPC API, a username and password are required in the Bitcoin Core configuration file. This will allow us to connect with the node remotely using HTTP. You can add these values to the bitcoin.conf file by selecting
inside of Bitcoin Core, which will open a text file. Add the following lines to this file:
```bash
rpcuser=bitcoinuser
rpcpassword=bitcoinpassword
```
## Using packages
Next we can install the additional javascript packages we’ll be using. Packages (or dependencies) are 3rd party javascript code we will utilize in our application. Install the needed dependencies with the following two commands
### Dependencies:
```bash
npm install dotenv express request
```
- dotenv - reads our bitcoin login info from the .env file
- express - our routing framework, lets us specify method endpoints
- request - allows us to send HTTP requests to the bitcoin client
# Project Setup
Once you have bitcoin installed and synced, create a folder for your application and navigate to it
```bash
git clone https://github.com/codeincrypt/bitcoin-rpc-nodejs-api
cd bitcoin-rpc-nodejs-api
```
Start the application by entering the command:
```bash
npm run server
```
If the server has started correctly, in your console you should see
```bash
Server running on port 8000
```
Now open your browser and navigate to:
```bash
http://localhost:8000/api/getbalance
```