@@ -44,19 +44,19 @@ cookbook.
44
44
45
45
::
46
46
47
- from eth.db.backends.memory import MemoryDB
47
+ from eth.db.atomic import AtomicDB
48
48
from eth.chains.mainnet import MAINNET_GENESIS_HEADER
49
49
50
50
# initialize a fresh chain
51
- chain = chain_class.from_genesis_header(MemoryDB (), MAINNET_GENESIS_HEADER)
51
+ chain = chain_class.from_genesis_header(AtomicDB (), MAINNET_GENESIS_HEADER)
52
52
53
53
Since we decided to not add any transactions to our block let's just call
54
54
:func: `~~eth.chains.base.MiningChain.mine_block ` and see what happens.
55
55
56
56
::
57
57
58
58
# initialize a fresh chain
59
- chain = chain_class.from_genesis_header(MemoryDB (), MAINNET_GENESIS_HEADER)
59
+ chain = chain_class.from_genesis_header(AtomicDB (), MAINNET_GENESIS_HEADER)
60
60
61
61
chain.mine_block()
62
62
@@ -163,15 +163,15 @@ Next, we'll create the chain itself using the defined ``GENESIS_PARAMS`` and the
163
163
164
164
from eth import MiningChain
165
165
from eth.vm.forks.byzantium import ByzantiumVM
166
- from eth.db.backends.memory import MemoryDB
166
+ from eth.db.backends.memory import AtomicDB
167
167
168
168
169
169
klass = MiningChain.configure(
170
170
__name__='TestChain',
171
171
vm_configuration=(
172
172
(constants.GENESIS_BLOCK_NUMBER, ByzantiumVM),
173
173
))
174
- chain = klass.from_genesis(MemoryDB (), GENESIS_PARAMS)
174
+ chain = klass.from_genesis(AtomicDB (), GENESIS_PARAMS)
175
175
176
176
177
177
Now that we have the building blocks available, let's put it all together and mine a proper block!
@@ -319,7 +319,7 @@ zero value transfer transaction.
319
319
>>> from eth.chains.base import MiningChain
320
320
>>> from eth.consensus.pow import mine_pow_nonce
321
321
>>> from eth.vm.forks.byzantium import ByzantiumVM
322
- >>> from eth.db.backends.memory import MemoryDB
322
+ >>> from eth.db.atomic import AtomicDB
323
323
324
324
325
325
>>> GENESIS_PARAMS = {
@@ -350,7 +350,7 @@ zero value transfer transaction.
350
350
... (constants.GENESIS_BLOCK_NUMBER , ByzantiumVM),
351
351
... ))
352
352
353
- >>> chain = klass.from_genesis(MemoryDB (), GENESIS_PARAMS )
353
+ >>> chain = klass.from_genesis(AtomicDB (), GENESIS_PARAMS )
354
354
>>> vm = chain.get_vm()
355
355
356
356
>>> nonce = vm.state.account_db.get_nonce(SENDER )
0 commit comments