Skip to content

Commit

Permalink
debug for l2 deployer
Browse files Browse the repository at this point in the history
  • Loading branch information
otherview committed Dec 19, 2023
1 parent 85b72c2 commit ca36858
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions testnet/launcher/l2contractdeployer/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ func NewDockerContractDeployer(cfg *Config) (*ContractDeployer, error) {
func (n *ContractDeployer) Start() error {
fmt.Printf("Starting L2 contract deployer with config: \n%s\n\n", litter.Sdump(*n.cfg))

cmds := []string{
"npx", "hardhat", "obscuro:deploy",
"--network", "layer2",
cmds := []string{"npx"}
var ports []int

// inspect stops operation until debugger is hooked on port 9229 if debug is enabled
if n.cfg.debugEnabled {
cmds = append(cmds, "--node-options=\"--inspect-brk=0.0.0.0:9229\"")
ports = append(ports, 9229)
}

cmds = append(cmds, "hardhat", "obscuro:deploy", "--network", "layer2")

envs := map[string]string{
"PREFUND_FAUCET_AMOUNT": n.cfg.faucetPrefundAmount,
"MGMT_CONTRACT_ADDRESS": n.cfg.managementContractAddress,
Expand Down Expand Up @@ -73,7 +79,7 @@ func (n *ContractDeployer) Start() error {
`, n.cfg.l1HTTPURL, n.cfg.l1privateKey, n.cfg.l2Host, n.cfg.l2Port, n.cfg.l2PrivateKey, n.cfg.hocPKString, n.cfg.pocPKString),
}

containerID, err := docker.StartNewContainer("hh-l2-deployer", n.cfg.dockerImage, cmds, nil, envs, nil, nil)
containerID, err := docker.StartNewContainer("hh-l2-deployer", n.cfg.dockerImage, cmds, ports, envs, nil, nil)
if err != nil {
return err
}
Expand Down

0 comments on commit ca36858

Please sign in to comment.