From 9e239765e6dd253819a7aa77a87caa528be549db Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Mon, 1 Apr 2024 11:27:45 +0100 Subject: [PATCH] fix(create-mud): run anvil in its own process (#2538) --- .changeset/tender-jars-brush.md | 5 +++++ examples/minimal/mprocs.yaml | 10 ++++++++++ examples/multiple-accounts/mprocs.yaml | 9 ++++++--- templates/phaser/mprocs.yaml | 9 ++++++--- templates/phaser/packages/contracts/worlds.json | 2 +- templates/react-ecs/mprocs.yaml | 9 ++++++--- templates/react-ecs/packages/contracts/worlds.json | 2 +- templates/react/mprocs.yaml | 9 ++++++--- templates/react/packages/contracts/worlds.json | 2 +- templates/threejs/mprocs.yaml | 9 ++++++--- templates/threejs/packages/contracts/worlds.json | 2 +- templates/vanilla/mprocs.yaml | 9 ++++++--- templates/vanilla/packages/contracts/worlds.json | 2 +- 13 files changed, 56 insertions(+), 23 deletions(-) create mode 100644 .changeset/tender-jars-brush.md create mode 100644 examples/minimal/mprocs.yaml diff --git a/.changeset/tender-jars-brush.md b/.changeset/tender-jars-brush.md new file mode 100644 index 0000000000..fb41f473c2 --- /dev/null +++ b/.changeset/tender-jars-brush.md @@ -0,0 +1,5 @@ +--- +"create-mud": patch +--- + +Templates now run anvil in its own process (via mprocs) for better visibility into anvil logs. diff --git a/examples/minimal/mprocs.yaml b/examples/minimal/mprocs.yaml new file mode 100644 index 0000000000..f01b91a0a9 --- /dev/null +++ b/examples/minimal/mprocs.yaml @@ -0,0 +1,10 @@ +procs: + client: + cwd: packages/client + shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 diff --git a/examples/multiple-accounts/mprocs.yaml b/examples/multiple-accounts/mprocs.yaml index 89cf2bd606..f01b91a0a9 100644 --- a/examples/multiple-accounts/mprocs.yaml +++ b/examples/multiple-accounts/mprocs.yaml @@ -1,7 +1,10 @@ procs: - contracts: - cwd: packages/contracts - shell: pnpm run dev client: cwd: packages/client shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 diff --git a/templates/phaser/mprocs.yaml b/templates/phaser/mprocs.yaml index 89cf2bd606..f01b91a0a9 100644 --- a/templates/phaser/mprocs.yaml +++ b/templates/phaser/mprocs.yaml @@ -1,7 +1,10 @@ procs: - contracts: - cwd: packages/contracts - shell: pnpm run dev client: cwd: packages/client shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 diff --git a/templates/phaser/packages/contracts/worlds.json b/templates/phaser/packages/contracts/worlds.json index bd48105fd7..43a5a6f4e5 100644 --- a/templates/phaser/packages/contracts/worlds.json +++ b/templates/phaser/packages/contracts/worlds.json @@ -1,5 +1,5 @@ { "31337": { - "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" + "address": "0x4f4ddafbc93cf8d11a253f21ddbcf836139efdec" } } \ No newline at end of file diff --git a/templates/react-ecs/mprocs.yaml b/templates/react-ecs/mprocs.yaml index 89cf2bd606..f01b91a0a9 100644 --- a/templates/react-ecs/mprocs.yaml +++ b/templates/react-ecs/mprocs.yaml @@ -1,7 +1,10 @@ procs: - contracts: - cwd: packages/contracts - shell: pnpm run dev client: cwd: packages/client shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 diff --git a/templates/react-ecs/packages/contracts/worlds.json b/templates/react-ecs/packages/contracts/worlds.json index bd48105fd7..43a5a6f4e5 100644 --- a/templates/react-ecs/packages/contracts/worlds.json +++ b/templates/react-ecs/packages/contracts/worlds.json @@ -1,5 +1,5 @@ { "31337": { - "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" + "address": "0x4f4ddafbc93cf8d11a253f21ddbcf836139efdec" } } \ No newline at end of file diff --git a/templates/react/mprocs.yaml b/templates/react/mprocs.yaml index 89cf2bd606..f01b91a0a9 100644 --- a/templates/react/mprocs.yaml +++ b/templates/react/mprocs.yaml @@ -1,7 +1,10 @@ procs: - contracts: - cwd: packages/contracts - shell: pnpm run dev client: cwd: packages/client shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 diff --git a/templates/react/packages/contracts/worlds.json b/templates/react/packages/contracts/worlds.json index a3a1b09f18..43a5a6f4e5 100644 --- a/templates/react/packages/contracts/worlds.json +++ b/templates/react/packages/contracts/worlds.json @@ -1,5 +1,5 @@ { "31337": { - "address": "0x6e9474e9c83676b9a71133ff96db43e7aa0a4342" + "address": "0x4f4ddafbc93cf8d11a253f21ddbcf836139efdec" } } \ No newline at end of file diff --git a/templates/threejs/mprocs.yaml b/templates/threejs/mprocs.yaml index 89cf2bd606..f01b91a0a9 100644 --- a/templates/threejs/mprocs.yaml +++ b/templates/threejs/mprocs.yaml @@ -1,7 +1,10 @@ procs: - contracts: - cwd: packages/contracts - shell: pnpm run dev client: cwd: packages/client shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 diff --git a/templates/threejs/packages/contracts/worlds.json b/templates/threejs/packages/contracts/worlds.json index bd48105fd7..43a5a6f4e5 100644 --- a/templates/threejs/packages/contracts/worlds.json +++ b/templates/threejs/packages/contracts/worlds.json @@ -1,5 +1,5 @@ { "31337": { - "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" + "address": "0x4f4ddafbc93cf8d11a253f21ddbcf836139efdec" } } \ No newline at end of file diff --git a/templates/vanilla/mprocs.yaml b/templates/vanilla/mprocs.yaml index 89cf2bd606..f01b91a0a9 100644 --- a/templates/vanilla/mprocs.yaml +++ b/templates/vanilla/mprocs.yaml @@ -1,7 +1,10 @@ procs: - contracts: - cwd: packages/contracts - shell: pnpm run dev client: cwd: packages/client shell: pnpm run dev + contracts: + cwd: packages/contracts + shell: pnpm mud dev-contracts --rpc http://127.0.0.1:8545 + anvil: + cwd: packages/contracts + shell: anvil --base-fee 0 diff --git a/templates/vanilla/packages/contracts/worlds.json b/templates/vanilla/packages/contracts/worlds.json index bd48105fd7..43a5a6f4e5 100644 --- a/templates/vanilla/packages/contracts/worlds.json +++ b/templates/vanilla/packages/contracts/worlds.json @@ -1,5 +1,5 @@ { "31337": { - "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" + "address": "0x4f4ddafbc93cf8d11a253f21ddbcf836139efdec" } } \ No newline at end of file