Bitcoin Forum
May 21, 2024, 02:23:08 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Good Programming Tutorials? [MeanStack]  (Read 750 times)
imabauss (OP)
Member
**
Offline Offline

Activity: 104
Merit: 10

The Premier Digital Asset Management Ecosystem


View Profile
March 20, 2014, 09:55:57 PM
 #1

I'm a Meanstack dev aka mongodb, express, angular, nodejs

I can't seem to find any good tutorials on working directly with bitcoind etc
I want to understand all the api calls etc but its so much to grasp that I'm just not getting it.

if you know any great resources please link me!

-thanks

yabtcl
Full Member
***
Offline Offline

Activity: 189
Merit: 103



View Profile
March 20, 2014, 10:14:46 PM
 #2

All I know about the RPC's call I got from from the wiki and also playing with the RPC call and the console on testnet.

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
https://en.bitcoin.it/wiki/Elis-API
https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29

As the result is always a json, it will be easy to call the commands in nodeJS

imabauss (OP)
Member
**
Offline Offline

Activity: 104
Merit: 10

The Premier Digital Asset Management Ecosystem


View Profile
March 20, 2014, 10:55:01 PM
 #3

All I know about the RPC's call I got from from the wiki and also playing with the RPC call and the console on testnet.

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
https://en.bitcoin.it/wiki/Elis-API
https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29

As the result is always a json, it will be easy to call the commands in nodeJS

Thanks I'm definitely going to play around with this!
I was just wondering if anyone has examples for actually doing basic things like:

checking for confirmations securely,
generating a deposit address,
etc etc

yabtcl
Full Member
***
Offline Offline

Activity: 189
Merit: 103



View Profile
March 20, 2014, 11:33:39 PM
 #4

all this can be acomplished with the RPC calls


get how many confirmations a transaction has:
gettransaction <txid>

generation addresses:
getnewaddress [account]


If you type "help" in the console on bitcoin gui interface, you will get a list of all commands available via RPC, and if you type "help <command>" you will get a explanation about the specific command.

Linkeex
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
March 20, 2014, 11:43:01 PM
 #5

Hi!

It's pretty easy to get going.
You could use npm bitcoin: https://www.npmjs.org/package/bitcoin

It just converts a method call to a bash command.
For example you want to generate a new address in your wallet you could connect to your bitcoind client and execute

Code:
client.cmd('getnewaddress', function(err, address, resHeaders){
  if (err) return console.log(err);
  console.log('New Address:', address);
});

or you could just do it by implementing the above mentioned library in your code.
To make a connection to your node call this:

Code:
// all config options are optional
var client = new bitcoin.Client({
  host: 'localhost',
  port: 8332,
  user: 'username',
  pass: 'password',
  timeout: 5000
});


With the client variable you can now execute its implemented methods:
Code:
client.getNewAddress('*', function(err, address) {
  if(err) return err;
  console.log('Address: '+ address);
});


Also, if you want to get started and do not want to download the whole blockchain, blockchain.info has a wallet API for you to play: https://blockchain.info/de/api/json_rpc_api

+++ Informatik-Student würde für Bitcoins alles tun: Javascript, Java, Nodejs, Angularjs, Express, Objective-C, SQL, Webdesign + + +
==> https://bitcointalk.org/index.php?topic=356002.msg3808815#msg3808815
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!