How to use ethers.js in Cloud Functions #2623
-
Hi, I've been using ethers.js in an angular app with metamask and its working great. But there are some operations on the blockchain I can't expose on the client side, and I"m using Firestore Cloud Functions for that, but can't quite get off the starting block. Right now I have a test setup running which has a hardhat node runing on localhost:8455, and that works fine in the client app. But in the Cloud Function (also running locally, I can't seem to connect with the JsonRPCProvider. The documentation says all I need to do, is
since localhost:8545 will be used by default, but that yields this result in the browser:
I don't really understand any of that or how to address. Advice appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Are you trying to use ENS names? If you want to use ENS you need to install it to your test network and configure it. |
Beta Was this translation helpful? Give feedback.
-
Gee, if this doesn’t make sense to you either I’m up the creek.
Here’s the stack trace in case that helps:
Error: network does not support ENS (operation="ENS", network="unknown", code=UNSUPPORTED_OPERATION, version=providers/5.5.3) at Logger.makeError ***@***.***/logger/lib/index.js:199:21) at Logger.throwError ***@***.***/logger/lib/index.js:208:20) at JsonRpcProvider. ***@***.***/providers/lib/base-provider.js:2021:36) at step ***@***.***/providers/lib/base-provider.js:48:23) at Object.next ***@***.***/providers/lib/base-provider.js:29:53) at fulfilled ***@***.***/providers/lib/base-provider.js:20:58) at processTicksAndRejections (internal/process/task_queues.js:95:5)
From: Richard Moore ***@***.***>
Reply-To: "ethers-io/ethers.js" ***@***.***>
Date: Sunday, January 30, 2022 at 9:52 PM
To: "ethers-io/ethers.js" ***@***.***>
Cc: Josh Kramer ***@***.***>, Author ***@***.***>
Subject: Re: [ethers-io/ethers.js] How to use ethers.js in Cloud Functions (Discussion #2623)
That should not do anything that would complain about ENS. Maybe hardhat is looking for their multicall contract or something? @alcuadrado<https://github.com/alcuadrado>
—
Reply to this email directly, view it on GitHub<#2623 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACCIEBLUY3VXGPQHFOJQA73UYYPTNANCNFSM5NFG6VGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks this problem has been resolved in the meanwhile. Later in the code there was a call to getBalance with a string that looked like an Eth name. |
Beta Was this translation helpful? Give feedback.
Thanks this problem has been resolved in the meanwhile. Later in the code there was a call to getBalance with a string that looked like an Eth name.