PatrickAlphaC / ethers-simple-storage-fcc

91 stars 128 forks source link

2 weeks stuck on Deploy ethers-simple-storage-fcc #80

Open malommey opened 1 year ago

malommey commented 1 year ago

please help... i cant Deploy my simple-storage-fcc on external Blockchain but when i deploy using the hardhat without Importing new network to my Json package i had no issue deploying my contract and now im trying to Deploy to Ganache im stuck on here.. this is the code snippet "

async function main(){
    const provider = new ethers.providersJsonRPCProvider("http//:127.0.0.1:8545");
``

here is the error i get on this ethers.provider.jsonRPCprovider

"node deploy.js TypeError: ethers.providers.JsonRPCProvider is not a constructor



THANK YOU
gracecampo commented 1 year ago

The method call for ethers.js has changed and should use new ethers. JsonRpcProvider (process. env. RPC_URL). You can try it out

malommey commented 1 year ago

On Fri, Apr 28, 2023 at 3:10 AM gracecampo @.***> wrote:

The method call for ethers.js has changed and should use new ethers. JsonRpcProvider (process. env. RPC_URL). You can try it out

— Reply to this email directly, view it on GitHub https://github.com/PatrickAlphaC/ethers-simple-storage-fcc/issues/80#issuecomment-1526879230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX7CNZGBDARJMVIZBZYONGDXDMRHZANCNFSM6AAAAAAXOPHJBY . You are receiving this because you authored the thread.Message ID: @.***>

should i create an env folder the RPC_URl and also import from packageJson?

GIRISHNP commented 1 year ago

new version of package is not correct to connect ether to network Try this --
yarn add ethers@5.7.2 even if it not works instead of using ubantu terminal use normal terminal it will work

malommey commented 1 year ago

i think the most problem is from how i import ethers

On Mon, May 8, 2023 at 3:48 PM GIRISH N P @.***> wrote:

new version of package is not correct to connect ether to network Try this -- yarn add @.*** even if it not works instead of using ubantu terminal use normal terminal it will work

— Reply to this email directly, view it on GitHub https://github.com/PatrickAlphaC/ethers-simple-storage-fcc/issues/80#issuecomment-1538486054, or unsubscribe https://github.com/notifications/unsubscribe-auth/AX7CNZE27VM6FK2ZSNB245TXFEBUZANCNFSM6AAAAAAXOPHJBY . You are receiving this because you authored the thread.Message ID: @.***>

DMG-01 commented 1 year ago

The method call for ethers.js has changed and should use new ethers. JsonRpcProvider (process. env. RPC_URL). You can try it out

please i am a little confused can you write it and use any value for the RPC_URL

malommey commented 1 year ago

for the RPC_URL, select the blockchain or testnet url you want to deploy to

malommey commented 1 year ago

‘’’ solidity ‘’’ thank you all for participating to help me on deploying my contract to ganache

‘’’ let provider = new ethers.JsonRpcProvider(process.env.RPC_URL)

let wallet = new ethers.Wallet(process.env.PRIVATE_KEY,provider)

‘’’ the above code helped me to import my .env file on deploy.js

‘’’

Thank you All