neoneo-go/pkg/core/storage
Roman Khimov 920d7c610c core: remove blockCache, use MemoryStore, redesign persist()
Commit 578ac414d4 was wrong in that it saved
only a part of the block, so depending on how you use blockchain, you may
still see that the block was not really processed properly. To really fix it
this commit introduces intermediate storage layer in form of memStore, which
actually is a MemoryStore that supports full Store API (thus easily fitting
into the existing code) and one extension that allows it to flush its data to
some other Store.

It also changes AddBlock() semantics in that it only accepts now successive
blocks, but when it does it guarantees that they're properly added into the
Blockchain and can be referred to in any way. Pending block queing is now
moved into the server (see 8c0c055ac657813fe3ed10257bce199e9527d5ed).

So the only thing done with persist() now is just a move from memStore to
Store which probably should've always been the case (notice also that
previously headers and some other metadata was written into the Store
bypassing caching/batching mechanism thus leading to some inefficiency).
2019-09-27 15:42:35 +03:00
..
boltdb_store.go storage: fix BoltDB batched Put() 2019-09-23 09:27:18 +03:00
boltdb_store_test.go storage: fix BoltDB batched Put() 2019-09-23 09:27:18 +03:00
helpers.go io: move BinReader/BinWriter there, redo Serializable with it 2019-09-16 23:39:51 +03:00
leveldb_store.go storage: close function 2019-09-16 18:52:47 +03:00
leveldb_store_test.go Persist blockchain with leveldb on disk (#48) 2018-03-17 12:53:21 +01:00
memory_store.go core: remove blockCache, use MemoryStore, redesign persist() 2019-09-27 15:42:35 +03:00
memory_store_test.go core: remove blockCache, use MemoryStore, redesign persist() 2019-09-27 15:42:35 +03:00
redis_store.go storage: close function 2019-09-16 18:52:47 +03:00
redis_store_test.go storage: close function 2019-09-16 18:52:47 +03:00
store.go storage: close function 2019-09-16 18:52:47 +03:00
store_config.go storage: add boltDB support 2019-09-14 10:28:43 +03:00
store_test.go Persist blockchain with leveldb on disk (#48) 2018-03-17 12:53:21 +01:00