New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightchain_shell: run LightChain in the background of interactive shell #189

Merged
merged 1 commit into from Dec 5, 2017

Conversation

Projects
None yet
2 participants
@gsalgado
Collaborator

gsalgado commented Dec 4, 2017

Also extend the quickstart and building_chains docs, and add the asyncio
sphinx extension so that coroutines get special treatment in docs.

@gsalgado gsalgado requested a review from pipermerriam Dec 4, 2017

DemoLightChain = LightChain.configure(
name='Demo LightChain',
privkey=ecies.generate_privkey(),

This comment has been minimized.

@pipermerriam

pipermerriam Dec 4, 2017

Member

doesn't need to be done here, but I think it's ok for us to start storing some data under ~/.py-evm/ which would include generating this value automatically for each chain if it's not already present. This is how other clients do it yes?

@pipermerriam

pipermerriam Dec 4, 2017

Member

doesn't need to be done here, but I think it's ok for us to start storing some data under ~/.py-evm/ which would include generating this value automatically for each chain if it's not already present. This is how other clients do it yes?

This comment has been minimized.

@gsalgado

gsalgado Dec 5, 2017

Collaborator

Created #198

@gsalgado

gsalgado Dec 5, 2017

Collaborator

Created #198

from evm.db.chain import BaseChainDB
from evm.chains.mainnet import MAINNET_GENESIS_HEADER
chain = DemoLightChain.from_genesis_header(BaseChainDB(MemoryDB()), MAINNET_GENESIS_HEADER)

This comment has been minimized.

@pipermerriam

pipermerriam Dec 4, 2017

Member

The amount of imports here make me wonder how we can establish some built-in Chain subclasses which have suitable defaults as well as potentially environment based configuration for the ChainDB class and the BaseDB class. This could reduce this down to

from evm.chains.demo import DemoMainnetLightChain

chain = DemoMainnetLightChain()
chain.run()   # can we put the `asyncio` loop setup into this or another method?
@pipermerriam

pipermerriam Dec 4, 2017

Member

The amount of imports here make me wonder how we can establish some built-in Chain subclasses which have suitable defaults as well as potentially environment based configuration for the ChainDB class and the BaseDB class. This could reduce this down to

from evm.chains.demo import DemoMainnetLightChain

chain = DemoMainnetLightChain()
chain.run()   # can we put the `asyncio` loop setup into this or another method?

This comment has been minimized.

@gsalgado

gsalgado Dec 5, 2017

Collaborator

Yeah, the amount of imports is annoying, and maybe we could have a helper for the asyncio loop, but it should not be in chain.run() because different services will use different asyncio APIs to run the chain (e.g. the interactive shell uses run_until_complete() whereas the RPC server uses ensure_future())

@gsalgado

gsalgado Dec 5, 2017

Collaborator

Yeah, the amount of imports is annoying, and maybe we could have a helper for the asyncio loop, but it should not be in chain.run() because different services will use different asyncio APIs to run the chain (e.g. the interactive shell uses run_until_complete() whereas the RPC server uses ensure_future())

lightchain_shell: run LightChain in the background of interactive shell
Also extend the quickstart and building_chains docs, and add the asyncio
sphinx extension so that coroutines get special treatment in docs.

@gsalgado gsalgado merged commit c5ef62f into ethereum:master Dec 5, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment