Reputation: 1549
Was looking at libraries for bitcoin node implementation like bitcoin-ruby and toshi. I guess my question is quite basic but I'm a newby here: Is it necessary to download the entire blockchain (and even set a node) in order interact with it as sending/receiving transactions, getting block data or create an address?
Upvotes: 2
Views: 449
Reputation: 439
It is possible to interact with the bitcoin network without downloading the entire blockchain.
You should check how to interact with the peers in the bitcoin developer guide p2p section.
There are also a lot of libraries that allow you to interact with the bitcoin network, for example, with bitcore p2p you can interact with a pool of peers with:
var Pool = require('bitcore-p2p').Pool;
var Networks = require('bitcore-lib').Networks;
var pool = new Pool({network: Networks.livenet});
// connect to the network
pool.connect();
// attach peer events
pool.on('peerinv', function(peer, message) {
// a new peer message has arrived
});
// Send a message, as soon as the response arrives, the pool will emit the related event.
// If your request is a getheaders message https://en.bitcoin.it/wiki/Protocol_documentation#getheaders
// you should listen for 'peerheaders'
pool.sendMessage(message)
// will disconnect all peers
pool.disconnect()
For checking an address balance, if you don't download the entire blockchain, you should download the header chain. When you want to check if an address is or not in a block, you can request a merkleblock.
Here and here you can find more about the spv clients.
Upvotes: 1
Reputation: 93
Things you can do offline, without syncing fully with the blockchain
Things you can do with a connected, without syncing fully with the blockchain -
Check out implementations of SPV wallets such as breadwallet to know more.
Upvotes: 2