I used truffle to create a smartcontract, and then deployed it on Rinkeby (using a local geth node) with this command. It works well.
truffle migrate --network rinkeby
The smartcontract is an updated version of this sample: https://medium.com/cryptronics/ethereum-development-guide-part-1-ad0c77c3683f
Now I'd like to deploy the smartcontract on the mainnet:
$ geth --syncmode light --rpc --datadir=$HOME/mainnet --nousb --allow-insecure-unlock $ geth --nousb account new --datadir="$HOME/mainnet/" --password ./account-password.txt $ truffle migrate --network mainnet "Migrations" exceeded the block limit (with a gas value you set). * Block limit: 5000 (0x1388) * Gas sent: 4000000 (0x3d0900) * Try: + Sending less gas.
I changed truffle-config.js to use a bas of 10000. By the way, how much ETH does it costs currently to deploy a simple contract, more or less? what gas should I define?
$ truffle migrate --network mainnet "Migrations" -- Returned error: getDeleteStateObject (1422d7ccc0d1b857e00bef1c265b8907071434d9) error: no suitable peers available.
It seems that's not trivial to set-up a geth node. So I tried using a free development node from quiknode.io. But they do not support deploying a contract using truffle from the command line (only from its front end client Drizzle).
How can I deploy the smartcontract to mainnet? I prefer command line tools, rather than graphical interfaces. However, both solutions are appreciated.