Author

Topic: Good Programming Tutorials? [MeanStack] (Read 782 times)

member
Activity: 74
Merit: 10
March 20, 2014, 06: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
full member
Activity: 189
Merit: 103
March 20, 2014, 06:33:39 PM
#4
all this can be acomplished with the RPC calls


get how many confirmations a transaction has:
gettransaction

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 " you will get a explanation about the specific command.
member
Activity: 104
Merit: 10
The Premier Digital Asset Management Ecosystem
March 20, 2014, 05: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
full member
Activity: 189
Merit: 103
March 20, 2014, 05: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
member
Activity: 104
Merit: 10
The Premier Digital Asset Management Ecosystem
March 20, 2014, 04: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
Jump to: