Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: bte on December 02, 2022, 06:13:43 AM



Title: NFT Tutorial (need help)
Post by: bte on December 02, 2022, 06:13:43 AM
Can you help me deploy my contract on Ethereum Mainnet?

I am not a programmer, and I read tutorial at Ethereum.org and I managed to do everything in Goerli, I see my NFT in MM:
https://ethereum.org/en/developers/tutorials/how-to-write-and-deploy-an-nft/  (https://ethereum.org/en/developers/tutorials/how-to-write-and-deploy-an-nft/)

But when I change Alchemy API to Mainnet and run:
npx hardhat run scripts/deploy.js --network mainnet

I saw the error:
Error HH100: Network mainnet doesn't exist

How I can deploy my contract from this tutorial to Ethereum Mainnet?


Title: Re: NFT Tutorial (need help)
Post by: TryNinja on December 02, 2022, 08:36:06 AM
Open hardhat.config.js and look for networks. Did you setup the Ethereum mainnet network there? Is "mainnet" the name you're using?

It should look like this:

Code:
networks: {
    mainnet: {
        url: "json-rpc provider url",
        accounts: ["private-key"]
    }
}

P.S, You should definitely read the docs: https://hardhat.org/hardhat-runner/docs/config#networks-configuration


Title: Re: NFT Tutorial (need help)
Post by: vv181 on December 02, 2022, 06:18:03 PM
As an additional resource besides the Hardhat documentation page. Do in mind and try to comprehend what each step of the Ethereum site tutorial explains to you, and adjust accordingly the network with mainnet.

For example, step 11 requires you to have the environment variables using goerli API, and it is interconnected with the next step where the hardhat.config.js consumes the env variables. So if there is some step that affects the whole NFT tutorial step, try to change the part where the network using goerli with mainnet.


Title: Re: NFT Tutorial (need help)
Post by: bte on December 06, 2022, 04:23:21 PM
Open hardhat.config.js and look for networks. Did you setup the Ethereum mainnet network there? Is "mainnet" the name you're using?

It should look like this:

Code:
networks: {
    mainnet: {
        url: "json-rpc provider url",
        accounts: ["private-key"]
    }
}



Thanks,
I repeated all the steps several times and in the end everything worked out. I had to delete and create a new Alchemy App.
Now I have the task of verifying my NFT contract, created according to the instructions from the Ethereum website. An error is coming out:
ParserError: Multiple SPDX license identifiers found in source file. Use “AND” or “OR” to combine multiple licenses

I flat my contract and uploaded it to Etherscan, but it didn't help

But this is probably another topic?