Asynchronous function to specify provider in truffle-config.js #4588
Unanswered
hughes-ch
asked this question in
General Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a personal project trying to learn about web3 development, and I'm trying to set up a system where the users pay for gas using ERC20 tokens. I've found the OpenGSN project to do most of the heavy lifting and I'm trying to integrate it with truffle.
The way OpenGSN works is by wrapping the web3 provider. Then any calls to the provider is routed through their network where ETH is traded behind the scenes. It does just what I need it to, but I'm having an issue integrating the provider in truffle-config.js. From the docs, I see a custom provider can be specified:
From my perusing of the truffle code, it looks like the provider can be a string, function, or object. However, OpenGSN's provider wrapper is asynchronous, so it returns a Promise. Before I resolve to using a super-hack or dropping OpenGSN/truffle altogether, does anyone know if asynchronous providers are supported by truffle?
Beta Was this translation helpful? Give feedback.
All reactions