Buidler support
See original GitHub issueI’m opening this issue to continue our conversation from #115.
I tried running this reporter with Buidler, and got into these issues:
-
It requires web3, so it would only work in projects using buidler-web3. I think this is a reasonable requirement, and I haven’t checked yet how difficult it would be to make it more general.
-
It assumes that
artifacts
from truffle is available. I workarounded this by installing buidler-truffle5. -
It only works if web3 supports sync calls. Those aren’t supported by Buidler, and I think they aren’t by web3 1.0. I saw this PR, so I commented out this check, but I’m getting this error now:
pato@pmbp:gas% npx buidler test --show-stack-traces
Compiling...
An unexpected error occurred: Cannot read property 'url' of undefined
TypeError: Cannot read property 'url' of undefined
at Object.request (/private/tmp/gas/node_modules/eth-gas-reporter/sync.js:57:10)
at Object.getLatestBlock (/private/tmp/gas/node_modules/eth-gas-reporter/sync.js:21:17)
at Object.mapMethodsToContracts (/private/tmp/gas/node_modules/eth-gas-reporter/gasStats.js:353:22)
at Runner.Gas.runner.on (/private/tmp/gas/node_modules/eth-gas-reporter/index.js:143:65)
at emitNone (events.js:111:20)
at Runner.emit (events.js:208:7)
at start (/private/tmp/gas/node_modules/mocha/lib/runner.js:848:10)
at Runner.run (/private/tmp/gas/node_modules/mocha/lib/runner.js:876:5)
at Mocha.run (/private/tmp/gas/node_modules/mocha/lib/mocha.js:612:17)
at Promise (/private/tmp/gas/node_modules/@nomiclabs/buidler/src/builtin-tasks/test.ts:51:13)
at new Promise (<anonymous>)
at SimpleTaskDefinition.config_env_1.internalTask.addOptionalVariadicPositionalParam.setAction [as action] (/private/tmp/gas/node_modules/@nomiclabs/buidler/src/builtin-tasks/test.ts:50:24)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
It expects a connection
field from web3
. I have no idea what that is. Do you?
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Builder Support
We're here to help empower our customers and make Builder the best product possible. ... You can also always email us at support@builder.io....
Read more >e-Builder Support
e-Builder's elite Professional Services team assists with System Deployment and Implementation across various industries and projects. Request a demo today!
Read more >Builder Support - Van's Aircraft Total Performance RV Kit ...
An extensive support network exists to help you with building your RV. Van's Technical Support. Every RV builder has access to official technical...
Read more >Beaver Builder Support
We take great pride in offering outstanding support. If you have a question or problem, our expert support team is waiting to help...
Read more >LG Builder: Support | LG US Business
Create a space your clients will love. Explore LG's builder appliances, packages and discounts – and find the perfect appliances for any project....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cgewecke here’s the sample project using ethers: https://github.com/alcuadrado/example-buidler-ethers
It has a super basic contract with a few tests, but it may be enough as a test case. Let me know if it’s not.
I also installed typescript in that project, to have it as an example of how to do it, and cause having autocomplete may help you as
buidler-ethers
is not that well documented yet.If
buidler-ethers
is installed, you can do this withethers.provider._buidlerProvider.provider.host
. Or you can useethereum.provider.host
in any Buidler project.This is interesting. I restricted the provider’s config a little to prevent users from passing web3-provider-engine backed providers. I don’t think that is stable enough, and I don’t like that it works as a service (i.e. you need to start and stop it) without any clear reason. As Buidler also works as a library, there isn’t a single place to start/stop it.
I see! I’ll try to avoid doing that. I guess it was an optimization, but it gets things really confusing. At least for tools developers.
Let me know if you need help with anything else 😃