@@ -15,32 +15,32 @@ after you define the VM ranges. For example, to set up a chain that would track
15
15
the mainnet Ethereum network until block 1920000, you could create this chain
16
16
class:
17
17
18
- ::
18
+ .. doctest ::
19
19
20
- from eth import constants, Chain
21
- from eth.vm.forks.frontier import FrontierVM
22
- from eth.vm.forks.homestead import HomesteadVM
23
- from eth.chains.mainnet import HOMESTEAD_MAINNET_BLOCK
24
-
25
- chain_class = Chain.configure(
26
- __name__='Test Chain',
27
- vm_configuration=(
28
- (constants.GENESIS_BLOCK_NUMBER, FrontierVM),
29
- (HOMESTEAD_MAINNET_BLOCK, HomesteadVM),
30
- ),
31
- )
20
+ >>> from eth import constants, Chain
21
+ >>> from eth.vm.forks.frontier import FrontierVM
22
+ >>> from eth.vm.forks.homestead import HomesteadVM
23
+ >>> from eth.chains.mainnet import HOMESTEAD_MAINNET_BLOCK
24
+
25
+ >>> chain_class = Chain.configure(
26
+ ... __name__ = ' Test Chain' ,
27
+ ... vm_configuration= (
28
+ ... (constants.GENESIS_BLOCK_NUMBER , FrontierVM),
29
+ ... (HOMESTEAD_MAINNET_BLOCK , HomesteadVM),
30
+ ... ),
31
+ ... )
32
32
33
33
Then to initialize, you can start it up with an in-memory database:
34
34
35
- ::
35
+ .. doctest ::
36
36
37
- from eth.db.backends.memory import MemoryDB
38
- from eth.chains.mainnet import MAINNET_GENESIS_HEADER
37
+ >>> from eth.db.backends.memory import MemoryDB
38
+ >>> from eth.chains.mainnet import MAINNET_GENESIS_HEADER
39
39
40
- # start a fresh in-memory db
40
+ >>> # start a fresh in-memory db
41
41
42
- # initialize a fresh chain
43
- chain = chain_class.from_genesis_header(MemoryDB(), MAINNET_GENESIS_HEADER)
42
+ >>> # initialize a fresh chain
43
+ >>> chain = chain_class.from_genesis_header(MemoryDB(), MAINNET_GENESIS_HEADER )
44
44
45
45
46
46
Using the LightPeerChain object
0 commit comments