Private Blockchain – How to Deploy Smart Contract on Private Blockchain

contract-deploymentprivate-blockchaintruffle-contract

I have created a Private Block chain Server on AWS with one Peer. Now if I want to deploy a smart contract at my AWS Node from my local system, how can I do that?

Regards
AKM.

Best Answer

NOte: This is not recommened with production or main chain. Please follow the instructions if you know what are you doing.

I generally recommend using third party tools like Remix or myEtherWallet to deploy smart contracts easily if you are in test environment.

So you can run geth with these flags

--rpcaddr 0.0.0.0 --rpcport "9816" --rpccorsdomain "*" --rpcapi "web3,eth,admin,debug,miner,personal,net" --wsorigins "*"

Now you can make 9816 port of your instance public for a while and connec remix or MEW for your geth instance and deploy your smart contracts easily. You can close rpc port once you are finished.

PS: If you are running main-net, do not expose RPC calls like this to an external environment. The best way is to deploy contract from your geth instance.

PS: You can follow the artcile for Deploying contract using byteCode (MyEtherWallet and Remix)

Related Topic