Remix, previously known as Browser Solidity, is a web browser based IDE that allows you to write, deploy and run Solidity smart contracts.

You can run Remix from your web browser or by installing and running it on your local computer.

 

Install Browser Solidity, called Remix, as follows:

a. Download the .zip file for Remix (in this case, the version corresponds to “remix-70f02ab.zip”)

b. Unzip the file into a personal folder and open the index.html that is in the file.

This opens the browser working with Solidity and is completely offline, local. The startup page is the Solidity Code. It has an explorer panel to the left and the debug (and other tools) on the right panel.

Create a new file by clicking on the top left:

 

Enter the code for a greeting contract. Check the auto-compile checkbox while you are typing it which tells you if you have errors.

 

When done with the code successfully, in the right pane displays the bytecode of the contract, the web3 deploy, etc.

 

Now, to deploy this contract to the blockchain, we have to create instances of it and send it to the blockchain.

Create a node on Geth for the local blockchain:

geth — datadir=”c:\eth-nodes\node1″ — port 3034 –networkid 1234 — rpc –rpcport “8545” –-rpccorsdomain “*” console 2> console.log

Or, if you want to specify a genesis block:

geth — datadir=”c:\eth-nodes” init genesis.json

geth — mine — rpc — networkid=39318 — cache=2048 — maxpeers=0 — datadir=”c:\eth-nodes\node1″ -–rpcport “8545” — rpccorsdomain “*” — rpcapi “eth,web3,personal,net,miner,admin,debug” — verbosity 0 console

 

Then, create a new account and unlock it.

> personal.newAccount(“748159263”)

“0xc55529184f0ca81cbe9c371291a4bd5bd0f21332”

> personal.unlockAccount(“0xc55529184f0ca81cbe9c371291a4bd5bd0f21332”)

Unlock account 0x08db97cf3b42a36f7010dfef4a83d753ba4ee072

Passphrase:

true

>

Now, we have to set the provider to Web3 and connect our browser to the localhost:8545

 

Then accept the following popup windows, taking into account the values that are displayed. Notice that the account is updated to show the same local node as the one that was originally created.

A test blockchain should be generated for any transaction and should display the following:

 

Running Remix from your local computer enables you to communicate with an Ethereum node client running on your local machine. You can then execute your smart contracts in Remix while connected to your local development blockchain, the Testnet blockchain, or the Mainnet blockchain.

Leave a comment