Skip to content
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

Added tenderly proxy to help debugging #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,23 @@ The project follows the Truffle framework basic structure:

All tests are running against Truffle's Ganache.
We have the `docker-compose.yml` file with default setup for ganache to speed up environment setup.
See `package.json` for available testing commands.

To run the tests:

```
npm test
```

To run the tests with the [tenderly proxy](https://github.com/Tenderly/tenderly-cli/);

```
// in one shell
npm run tenderly-proxy
// in another shell
NETWORK=proxy npm test
```

See `package.json` for other available testing commands.

# Running migrations

Expand Down
58 changes: 56 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
"ganache-down": "docker-compose down",
"build": "truffle compile && cross-env NETWORK=ganache npm run deploy-contracts",
"test": "npm-run-all ganache-up test-contracts ganache-down --continue-on-error",
"test-contracts": "cross-env NODE_ENV=test truffle test --network ganache",
"test-contracts": "cross-env NODE_ENV=test truffle test --network ${NETWORK:-ganache}",
"lint": "npm run solium",
"solium": "solium -d contracts/",
"solium-autofix": "solium -d contracts/ --fix",
"predeploy-contracts": "mkdir -p ./build/contracts && find ./artifacts/deployed/ -name \\*.json -exec cp {} ./build/contracts/ \\;",
"deploy-contracts": "cross-env ACCOUNT_PASSWORD=privatenet123 NODE_ENV=test truffle migrate --network ${NETWORK}",
"check": "npm-run-all test lint",
"check-ci": "npm-run-all test-contracts lint"
"check-ci": "npm-run-all test-contracts lint",
"pretenderly-proxy": "npm run ganache-up",
"tenderly-proxy": "tenderly proxy --target-port 8545"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -55,6 +57,7 @@
"npm-run-all": "^4.1.5",
"solc": "^0.4.23",
"solium": "^1.1.8",
"solium-plugin-zeppelin": "0.0.2"
"solium-plugin-zeppelin": "0.0.2",
"tenderly": "^0.1.4"
}
}
9 changes: 9 additions & 0 deletions truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ module.exports = {
network_id: '*', // Match any network id
from: '0x48089757dbc23bd8e49436247c9966ff15802978'
},
// using tenderly to improve debug and error output
proxy: {
host: 'localhost',
port: 9545,
gas: 3141592,
gasPrice: 100000000000,
network_id: '*', // Match any network id
from: '0x48089757dbc23bd8e49436247c9966ff15802978'
},
// local or CI integration testing with a privatenet node
// we need to separate this from the development network due to a bug with ganache-cli
// https://github.com/trufflesuite/ganache-cli/issues/405
Expand Down