script to deploy locally

This commit is contained in:
Moon Man 2023-08-20 10:27:29 -04:00
parent f19428e409
commit 1b8ecb5c37
2 changed files with 26 additions and 3 deletions

View File

@ -17,17 +17,23 @@ const config: HardhatUserConfig = {
networks: { networks: {
"base-mainnet": { "base-mainnet": {
url: "https://mainnet.base.org", url: "https://mainnet.base.org",
accounts: [process.env.WALLET_KEY as string], accounts: {
mnemonic: process.env.MNEMONIC as string
},
gasPrice: 1000000000, gasPrice: 1000000000,
}, },
"base-goerli": { "base-goerli": {
url: "https://goerli.base.org", url: "https://goerli.base.org",
accounts: [process.env.WALLET_KEY as string], accounts: {
mnemonic: process.env.MNEMONIC as string
},
gasPrice: 1000000000, gasPrice: 1000000000,
}, },
"base-local": { "base-local": {
url: "http://localhost:8545", url: "http://localhost:8545",
accounts: [process.env.WALLET_KEY as string], accounts: {
mnemonic: process.env.MNEMONIC as string
},
gasPrice: 1000000000, gasPrice: 1000000000,
}, },
}, },

17
scripts/deploy-local.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh
NODE_ENV=local
export NODE_ENV
nc -z "127.0.0.1" 8545 >/dev/null 2>&1
if [ "$?" -ne 0 ]
then
echo "local node not running" >&2
exit 1
fi
npx hardhat compile
# Same network, for testing reasons only
npx hardhat --network base-local run scripts/deploy-l1.ts
npx hardhat --network base-local run scripts/deploy-l2.ts