1

How to install solc on windows and then build smart contract ?

I use following command :

npm install -g solc

Is it enough to use it ?

Finally, I want to deploy my smart contract

3

Yup, as long as you installed solc, you can use it to compile solidity code into bytecode, the command to use is something like solc <contract>.sol --bin --abi --optimize -o <output-dir>/ However it cannot deploy it to the Ethereum network as it's just a compiler.

For simple smart contract testing and deployment, you cna simply use the Mist/Ethereum Wallet. You can download the latest version here https://github.com/ethereum/mist/releases Start the wallet application, go to Contracts tab, select Deploy New Contract, and you can simply paste solidity source code into it and the wallet will compile it and you can select contract to deploy. You can also paste the compiled bytecode into the right place of the wallet UI and deploy it to the Ethereum network.

For more complex and serious smart contract development and deployment, I suggest you use an IDE like Remix IDE https://remix.ethereum.org/ and a more professional development and deployment framework like Truffle http://truffleframework.com/

  • Could you please say that how to deploy a smart contract by remix IDE ? and web3.js ? – Questioner Apr 10 '18 at 10:03
  • @sas, actually, I think the better way to build and deploy a complex smart contract project is via Truffle Framework. Nonetheless, deploy a smart contract by Remix IDE is quite easy, you just put the code in the IDE, wait for it to compile successfully, select "Run", select "Web3 Provider" for "Environment", enter the rpc address of your geth node, select your account, select the contract to deploy, and click "Create". – hellopeach Apr 10 '18 at 14:19
  • @sas, for web3js, you need to have the compiled bytecode of the contract ready, and then use the "deploy" method of the web3.eth.Contract API to deploy it to the Ethereum network web3js.readthedocs.io/en/1.0/web3-eth-contract.html#deploy Of course I presume you already know how to connect to a provider and unlock your account with web3js. – hellopeach Apr 10 '18 at 14:28
  • @ hellopeach thank you, but when I use "localhost:8545" it's OK but when I put server IP address i.e. "18.221.104.179:8545" I receive: Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC). before anything I run testrpc in git cmd. – Questioner Apr 10 '18 at 14:57
  • @ hellopeach I have read tutorial but really I did not understand how can I use myContract.deploy(options) I created bytecode and ABI files. Could you explain briefly? Thank you. – Questioner Apr 10 '18 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.