ethereum-boilerplate
ethereum-boilerplate copied to clipboard
Can't connect to local dev chain (Failed running cloud function getTokenBalances for user undefined)
Hi, we're unable to connect Moralis to a local dev chain. We posted a question here and were told "web3api calls donât work with local dev chain".
Full post below
Thanks :-)
We are using the Etherium boilerplate project here https://github.com/ethereum-boilerplate/ethereum-boilerplate (lets call this EBP) We are running Ganash locally and have set up the frp reverse proxy. When we look in the moralis dashboard âdevchain proxy serverâ, we show as âconnectedâ.
In metamask we have imported an account using a private key from Ganash. Metamask is showing that we have 100 Eth in the account. We then use this account to authenticate with EBP.
The issue occurs when we navigate to the âWalletâ tab in EBP. We see a 400 error from the getTokenBalanes endpoint.
The curl genreated by Chrome is:
curl âhttps://42sf9cpyfott.usemoralis.com:2053/server/functions/getTokenBalancesâ -H âConnection: keep-aliveâ -H âPragma: no-cacheâ -H âCache-Control: no-cacheâ -H âsec-ch-ua: âGoogle Chromeâ;v=â95â, âChromiumâ;v=â95â, â;Not A Brandâ;v=â99ââ -H âAccept: application/jsonâ -H âDNT: 1â -H âContent-Type: application/jsonâ -H âsec-ch-ua-mobile: ?0â -H âUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36â -H âsec-ch-ua-platform: âWindowsââ -H âOrigin: http://localhost:3000/â -H âSec-Fetch-Site: cross-siteâ -H âSec-Fetch-Mode: corsâ -H âSec-Fetch-Dest: emptyâ -H âReferer: http://localhost:3000/â -H âAccept-Language: en-AU,en;q=0.9,en-US;q=0.8â âdata-raw â{âaddressâ:â0xce24fa85beea429ef601534151db39f0597c81cdâ,âchainâ:â0x539â}â âcompressed
When we look in the Moralis dashboard we see the following error.
Error received 2021-11-02T01:29:12.296Z - Failed running cloud function getTokenBalances for user undefined with: Input: {âaddressâ:â0xce24fa85beea429ef601534151db39f0597c81cdâ,âchainâ:â0x539â} Error: {âmessageâ:"[object Object]",âcodeâ:141}
Yes we will add support for it for some endpoints that donât require indexing đ
Thanks @ivan-liljeqvist . Do you mind if I ask a question? I'm a complete noob at dApps and still trying to get my head around what's going on. It's hard for me to tell the difference between a bug in a tool I'm using or a gap in my understanding.
Untill you add support for local dev chain, what network do you suggest I use with this project? Kovan? Rinkby? Something else?
Thanks very much.
And then see how we can add the rest
I would use Rinkeby as itâs very active testnet - relatively easy to get test coins etc
Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:135:10) at module.exports (P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\NormalModule.js:417:16) at handleParseError (P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\NormalModule.js:471:10) at P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\NormalModule.js:503:5 at P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\NormalModule.js:358:12 at P:\React_Dev\ethereum-boilerplate\node_modules\loader-runner\lib\LoaderRunner.js:373:3 at iterateNormalLoaders (P:\React_Dev\ethereum-boilerplate\node_modules\loader-runner\lib\LoaderRunner.js:214:10) at iterateNormalLoaders (P:\React_Dev\ethereum-boilerplate\node_modules\loader-runner\lib\LoaderRunner.js:221:10) P:\React_Dev\ethereum-boilerplate\node_modules\react-scripts\scripts\start.js:19 throw err; ^
Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:135:10) at module.exports (P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\util\createHash.js:135:53) at NormalModule._initBuildHash (P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\NormalModule.js:417:16) at P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\NormalModule.js:452:10 at P:\React_Dev\ethereum-boilerplate\node_modules\webpack\lib\NormalModule.js:323:13 at P:\React_Dev\ethereum-boilerplate\node_modules\loader-runner\lib\LoaderRunner.js:367:11 at P:\React_Dev\ethereum-boilerplate\node_modules\loader-runner\lib\LoaderRunner.js:233:18 at context.callback (P:\React_Dev\ethereum-boilerplate\node_modules\loader-runner\lib\LoaderRunner.js:111:13) at P:\React_Dev\ethereum-boilerplate\node_modules\react-scripts\node_modules\babel-loader\lib\index.js:59:103 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }
i have been getting this errors. Any quick help