Bitcoin Forum
May 06, 2024, 01:59:59 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [CLOSED] Storing a blockchain in SQL database?  (Read 1221 times)
kotovup (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 08, 2015, 09:17:43 PM
Last edit: November 11, 2015, 07:05:56 AM by kotovup
 #1

Hello. I want to duplicate and store all blockchain data in SQL database, periodically making a sync. This period will be based on confirmation of every new block. So, for example, if current block height equals to 1000, and I have successfully store all blockchain data up to this height, next block which I will store will be the next confirmed block at number 1001. I want to know about that is this way to synchronise blockchain with SQL database is safe and I will not need to change already stored data? Which way to do it is most right?
1714960799
Hero Member
*
Offline Offline

Posts: 1714960799

View Profile Personal Message (Offline)

Ignore
1714960799
Reply with quote  #2

1714960799
Report to moderator
1714960799
Hero Member
*
Offline Offline

Posts: 1714960799

View Profile Personal Message (Offline)

Ignore
1714960799
Reply with quote  #2

1714960799
Report to moderator
The Bitcoin software, network, and concept is called "Bitcoin" with a capitalized "B". Bitcoin currency units are called "bitcoins" with a lowercase "b" -- this is often abbreviated BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
OshiMike
Member
**
Offline Offline

Activity: 102
Merit: 10


View Profile
November 08, 2015, 09:24:16 PM
 #2

You will probably want to write a script that queries an api like blockchain.info and extract the data you want to store in your database.  I would imagine this being the easiest way

oshi.io Bitcoin Casino Fun!
kotovup (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 08, 2015, 09:51:04 PM
 #3

Oh, thank you. But my question is not about this. I want to know that is this method of storage is safe? At this word I assume that I will not want to change any data that was already stored. I want to know about right way to do that. I do not know is there any situation exists which can trigger me to work with some data included in blocks which are already stored?
kotovup (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 10, 2015, 02:16:46 AM
 #4

OK, here is a question for someone, who already stores a blockchain copy in SQL database. Are you found himself in situation in which you have to rewrite blockchain data which are already stored? No matters by which reason it was been caused by.
spin
Sr. Member
****
Offline Offline

Activity: 362
Merit: 261


View Profile
November 10, 2015, 09:03:25 AM
 #5

You will probably want to write a script that queries an api like blockchain.info and extract the data you want to store in your database.  I would imagine this being the easiest way

This won't work.  You will hit query limits with them. And/or it will be slow.

Run your own node and extract the data you need using rpc.

If you liked this post buy me a beer.  Beers are quite cheap where I live!
bc1q707guwp9pc73r08jw23lvecpywtazjjk399daa
altcoinhosting
Hero Member
*****
Offline Offline

Activity: 896
Merit: 1005


View Profile
November 10, 2015, 09:05:25 AM
 #6

try bitcoin-abe

BUT you NEED to find a database dump that is not to old, load the dump, then parse the rest of the blockchain... If you try to install bitcoin core, sync, then install bitcoin-abe and let it parse the whole blockchain, you'll be waiting for weeks...

Kozlov
Full Member
***
Offline Offline

Activity: 212
Merit: 100



View Profile
November 10, 2015, 05:16:11 PM
 #7

That's gonna take a massive amount of storage space, are you sure that's the most efficient way to store it? SQL DBs are huge and pretty unwieldy.

I think the suggestion about RPC and using nodes is more on the money. You'll find some devs who can help you out here I'm sure.

altcoinhosting
Hero Member
*****
Offline Offline

Activity: 896
Merit: 1005


View Profile
November 10, 2015, 05:43:54 PM
 #8

That's gonna take a massive amount of storage space, are you sure that's the most efficient way to store it? SQL DBs are huge and pretty unwieldy.

I think the suggestion about RPC and using nodes is more on the money. You'll find some devs who can help you out here I'm sure.

You can always use the barracuda engine in mysql to compress the data, but RPC is indeed a good choice to... You don't need a dev to do this, just some basic php knowledge

kotovup (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 11, 2015, 07:00:55 AM
 #9

Hey... Question is not about where from query a data. Not about that, no. I know how to get and extract data that I need.

try bitcoin-abe

Your answer give me a though to see how existing block explorers works.

That's gonna take a massive amount of storage space, are you sure that's the most efficient way to store it?

Yes, there is will be some overhead while converting from Level to some SQL database, and I am ready for that.

I think, this question can be marked as closed.

Thank you all.
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!