32

Geth uses leveldb. Some of the reasons behind choosing it was: In process database (i.e. I don't need to run an additional software) Native implementation in Go (i.e. cross platform to everything Go supports) Key/value store (i.e. values are arbitrary binary blobs, no schema constraints) Modern data storage (i.e. multiple layers on disk, organized in the ...


21

Your geth client is already running in the background. You can attach to it by typing: $ geth attach in your command line. This will allow you to run commands on the geth client console.


16

Data structures are stored in Merkle Patricia tries (read this and this), usually inside a LevelDB store. The chaindata is exactly that. I think the structure might slightly depend on the actual node implementation? Here are two of the trie implementations, could be a good starting point: in Go (geth): https://github.com/ethereum/go-ethereum/tree/master/...


14

There is state trie pruning in the works, which would be able to constantly delete old data that is not needed any more. Hand in hand with pruning is the fast sync, which sync to the network in such a way that it doesn't generate all the intermediate junk, but rather downloads the latest state from the get go. Pruning is aimed to be included in Geth 1.5. ...


11

I'm one of parity devs. We use Rocksdb. It's a key-value database developed by Facebook. We chose it mostly because of it's performance. In our benchmarks it was faster than LevelDB From their webpage: RocksDB is optimized for fast, low latency storage such as flash drives and high-speed disk drives. RocksDB exploits the full potential of high read/write ...


10

I am also interested in analysing the Ethereum blockchain. In fact, I'm primarily looking into smart contracts. While I was researching papers and articles about this, I stumbled upon this paper where the authors analyse Ethereum, namecoin, and peercoin. They have quite some intersting findings around number of contracts, termination of contracts, and ...


7

Blockchains are databases from a high-level view, but the underlying technology is different enough to make some assumptions inaccurate. An Excel file is also a database, but with characteristics unneeded/harmful for say, a NoSQL database. The data "is" on every full node. That is, every client replicates the entire blockchain. This is indeed inefficient, ...


7

The best way to start is to understand the following few concepts and learnings. what is Smart contracts ? What is solidity and how to start writing your domain data or objects in solidity. Understand event logging, to store searchable data , and how to use it. Be aware your questions is too broad.But this three points will answer your most practical ...


6

It's very difficult to answer with any precision based on a general description of a modest data model with 6 entities. Some comments to hopefully help clarify the big topics. Ethereum consensus will ensure the correct execution of a Smart Contract. Within that contract, you can ensure the mission-critical data is dependable. The storage and processing ...


6

I am interested in the same project. Currently, it appears to me that the javascript API provides the most robust access to the blockchain data: https://github.com/ethereum/wiki/wiki/JavaScript-API You can use this API from Geth or a standalone Node.js script. I populated a table of transactions in PostgreSQL using this API. However I am not aware of a ...


6

account is a local object to easily track changes on the accounts (with a StateObject db). The size depends on the nbr of transactions you execute with this account. An unused account should be less than 1kB. The maximum theoretical size for a contract is beyond technology limits, and actually around 90kB. The block.Body contains Transactions. The minimum ...


6

While Péter Szilágyi's answer is in no way wrong, there's also an other possibility. If you redownload the blockchain with Parity instead of geth, the size of the blockchain is reduced from your 10 GB to a mere 1.5 GB!


4

Parity is using RocksDB as it's database. From reading here it seems the reason for choosing it was performance. Faster than LevelDB in their tests. Lately though they have hit some performance issues and a lot of corruption issues with RocksDB and are developing a proprietary DB to better suit Parity, ParityDB. Progress can be tracked in this issue.


4

Couple of ideas that might help simplify this and reduce the cost by removing redundant storage. This line: mapping(string => OrganisationObject[]) organisations; seems heavy. I would incline to just let the factory be a factory and track just the contract addresses it creates; no unnecessary details. I changed it to an address[]. I'm a little leery ...


3

...or a Go API library, or to explain me what part of Geth accesses the chain files, for being able to develop it myself? Have a look at Geth's database.go, which is part of the ethdb package. For the actual interface that's provided, check interface.go: type Database interface { Put(key []byte, value []byte) error Get(key []byte) ([]byte, error)...


3

I can wait a second or so before the response. This is a crucial requirement, because reading is way slower than with MySQL at al. What you need to do is to set up a private network learn about writing and reading data to/from smart contracts (what is possible, and what's not yet) create a private network make one node mine connect your applications ...


3

That is your location: provide full transparency of the smart contract execution: https://live.ether.camp/ Here is how smart contract is traceable


3

You can use live.ether.camp to see all of the accounts that have your token. That link goes to the MistCoin contract. If you click the mapping in the "storage" section, you can see the mapping from addresses to balances. If you want to be able to check balances easier, try using an iterable mapping in your contract to store the balances.


3

Hmm.. you should seriously research Ethereum alot more before proposing this. because it is expensive does not begin to describe how expensive and slow this will be if you wrote all your GPS data to Ethereum. Here's a simple string of 1 GPS location data $GPGGA,053855.33,3756.9296,N,12737.8335,E,3,08,0.0,0.0,M,0.0,M,0.0,0000*74 Let's make a simple contract ...


3

An SSTORE of a non-zero value costs 20,000 gas. Each SSTORE can store 32 bytes of information. Double check my math: 1TB / 32 bytes = 31,250,000,000 31,250,000,000 * 20,000 gas * 1 gwei/gas = 625,000 ether * $750/ether = $468,750,000 So yes, a contract could store a terabyte of data and require all nodes to replicate it. But it would cost hundreds of ...


3

The contents are private only in the sense that other contracts can't read them if you set them private, but otherwise everything is public. All nodes need to be able to process the data so they also have access to all the data (including private variables). More reading: Store secret data in contract (and its duplicate)


3

I don't think that is possible, because it will completely break the goal of the ethereum network and may (and should) break the integrity and network validation of transactions and stored data on the blockchain. Making nodes share the same data, would make it absurd to pass transactions along the network for validation since all nodes have the same shared ...


3

As the commenters have correctly pointed out, it depends entirely on what you are trying to achieve. You can, and probably should store full-precision strings so you have all significant digits, i.e. accurate information. When discarding accuracy you should generally have a good reason why you do not need it and never will need it. Discarding precision can ...


2

It's possible to cache the data that's stored on the blockchain in a database and update it frequently (every block?). This can be done simply by querying the blockchain and retrieving an updated application state. For example, EtherScan uses this method to improve the performance of etherscan.io, pulling out data for every new block and storing it in other ...


2

Ethereum offers a platform for anyone to create their own applications which are powered by the blockchain technology. Just like Bitcoin, Ethereum also has a public blockchain. So, you can either run your application on the public blockchain, or you can start your own blockchain. Here are some useful links that'll help you create your own blockchain: http:/...


2

I suggest that you follow the basic tutorial which shows exactly that. I would advise you to not bother with infrastructure and running your own node at first. You can use the entirely browser-based Solidity IDE called Remix to test what you are doing and interact with your contract. You could copy-paste the greeter example that I linked above into Remix (...


2

You are correct, ethereum blockchain is a distributed database but you cannot do any query you want (for example, getting all the transactions for a given account needs you to process the whole blockchain, see this answer for example). That being said, there are several methods that allow you to get information without using another tool for processing/...


2

It is a custom structure, not SQL anyways. It contains the previous hash, Nonce, Merkle tree root and the timestamp, very basically, but also may other informations about the block. You can look at the official wiki post for detailed information. You can read it by using the official javascript or c++ APIs, or more directly whith the JSON RPC API which is ...


2

That would be extremely expensive. As the price for 256 bit word is 20,000 gas as stated in yellow paper and current gas price is about 20 gwei eth network stats we may calculate that with current ETH price $267: 1KB = 0.0128 ETH = $3.41 1MB = 13.1 ETH = $3,497 1GB = 13 421 ETH = $3,583,407 1TB = 13 743 895 ETH = $3,669,619,965 100TB = 1 ...


2

A two-part answer. "you need to loop": This just jumps out at me and deserves a comment. Smart Contracts don't give you indexed storage but this doesn't imply that a contract should loop over disorganized data. In fact, contracts must not loop over unbounded sets. Instead, it means that contracts are responsible for organizing data internally. Organize ...


Only top voted, non community-wiki answers of a minimum length are eligible