Skip to content

Closes #195 custom genesis_data #207

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions populus/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def reset_chain(data_dir):


class LoggedDevGethProcess(LoggingMixin, DevGethProcess):
def __init__(self, project_dir, blockchains_dir, chain_name, overrides):
def __init__(self, project_dir, blockchains_dir, chain_name, overrides, genesis_data):
stdout_logfile_path = get_geth_logfile_path(
project_dir,
chain_name,
Expand All @@ -99,6 +99,7 @@ def __init__(self, project_dir, blockchains_dir, chain_name, overrides):
base_dir=blockchains_dir,
stdout_logfile_path=stdout_logfile_path,
stderr_logfile_path=stderr_logfile_path,
genesis_data=genesis_data
)


Expand Down Expand Up @@ -677,7 +678,7 @@ class BaseGethChain(Chain):
geth = None
provider_class = None

def __init__(self, project, chain_name, provider=IPCProvider, **geth_kwargs):
def __init__(self, project, chain_name, provider=IPCProvider, genesis_data=None, **geth_kwargs):
super(BaseGethChain, self).__init__(project, chain_name)

if geth_kwargs is None:
Expand All @@ -698,6 +699,7 @@ def __init__(self, project, chain_name, provider=IPCProvider, **geth_kwargs):
key: value
for key, value in geth_kwargs.items() if key in GETH_KWARGS
}
self.genesis_data = genesis_data
self.geth = self.get_geth_process_instance()

_web3 = None
Expand Down Expand Up @@ -774,6 +776,7 @@ def get_geth_process_instance(self):
blockchains_dir=self.project.blockchains_dir,
chain_name=self.chain_name,
overrides=self.geth_kwargs,
genesis_data=self.genesis_data
)


Expand All @@ -787,6 +790,7 @@ def get_geth_process_instance(self):
blockchains_dir=blockchains_dir,
chain_name=self.chain_name,
overrides=self.geth_kwargs,
genesis_data=self.genesis_data
)

has_registrar = True
Expand Down