mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-19 20:36:19 +00:00
Update demo hardhat configs to use env variable for eth endpoint (#277)
* Use an env variable for eth RPC endpoint in hardhat config * Add a task to get main account address in erc20 watcher
This commit is contained in:
parent
9566dff466
commit
a834250259
@ -9,6 +9,7 @@ import './test/tasks/token-transfer';
|
|||||||
import './test/tasks/token-approve';
|
import './test/tasks/token-approve';
|
||||||
import './test/tasks/token-transfer-from';
|
import './test/tasks/token-transfer-from';
|
||||||
import './test/tasks/block-latest';
|
import './test/tasks/block-latest';
|
||||||
|
import './test/tasks/account';
|
||||||
|
|
||||||
// You need to export an object to set up your config
|
// You need to export an object to set up your config
|
||||||
// Go to https://hardhat.org/config/ to learn more
|
// Go to https://hardhat.org/config/ to learn more
|
||||||
@ -20,7 +21,7 @@ export default {
|
|||||||
solidity: '0.8.0',
|
solidity: '0.8.0',
|
||||||
networks: {
|
networks: {
|
||||||
docker: {
|
docker: {
|
||||||
url: 'http://geth:8545'
|
url: process.env.ETH_RPC_URL
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
paths: {
|
paths: {
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
"token:transfer-from:docker": "hardhat --network docker token-transfer-from",
|
"token:transfer-from:docker": "hardhat --network docker token-transfer-from",
|
||||||
"block:latest": "hardhat --network localhost block-latest",
|
"block:latest": "hardhat --network localhost block-latest",
|
||||||
"block:latest:docker": "hardhat --network docker block-latest",
|
"block:latest:docker": "hardhat --network docker block-latest",
|
||||||
|
"account": "hardhat --network localhost account",
|
||||||
|
"account:docker": "hardhat --network docker account",
|
||||||
"reset": "DEBUG=vulcanize:* node --enable-source-maps dist/cli/reset.js",
|
"reset": "DEBUG=vulcanize:* node --enable-source-maps dist/cli/reset.js",
|
||||||
"reset:dev": "DEBUG=vulcanize:* ts-node src/cli/reset.ts"
|
"reset:dev": "DEBUG=vulcanize:* ts-node src/cli/reset.ts"
|
||||||
},
|
},
|
||||||
|
12
packages/erc20-watcher/test/tasks/account.ts
Normal file
12
packages/erc20-watcher/test/tasks/account.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//
|
||||||
|
// Copyright 2022 Vulcanize, Inc.
|
||||||
|
//
|
||||||
|
|
||||||
|
import { task } from 'hardhat/config';
|
||||||
|
import '@nomiclabs/hardhat-ethers';
|
||||||
|
|
||||||
|
task('account', 'Prints the account', async (taskArgs, hre) => {
|
||||||
|
const [account] = await hre.ethers.getSigners();
|
||||||
|
|
||||||
|
console.log(account.address);
|
||||||
|
});
|
@ -20,7 +20,7 @@ export default {
|
|||||||
solidity: '0.8.0',
|
solidity: '0.8.0',
|
||||||
networks: {
|
networks: {
|
||||||
docker: {
|
docker: {
|
||||||
url: 'http://geth:8545'
|
url: process.env.ETH_RPC_URL
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
paths: {
|
paths: {
|
||||||
|
@ -32,7 +32,8 @@
|
|||||||
"nft:transfer:docker": "hardhat --network docker nft-transfer",
|
"nft:transfer:docker": "hardhat --network docker nft-transfer",
|
||||||
"block:latest": "hardhat --network localhost block-latest",
|
"block:latest": "hardhat --network localhost block-latest",
|
||||||
"block:latest:docker": "hardhat --network docker block-latest",
|
"block:latest:docker": "hardhat --network docker block-latest",
|
||||||
"account": "hardhat --network localhost account"
|
"account": "hardhat --network localhost account",
|
||||||
|
"account:docker": "hardhat --network docker account"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
Reference in New Issue
Block a user