1. Geth and Eth
The packages are available in chocolatey. So first step is download chocolatey
Once you get chocolatey, go to where the exe is located or set PATH.
Once you have decided (cd to the location or set PATH), then
choco install geth-stable -version 1.0.1.2
this will install geth for you.
To get eth, this is the simplest way.
Go to
https://build.ethdev.com/builds/ and downlaod the latest exe from there
Note!
geth.exe will be available in a path similar to this
HomeDirectory:/Chocolatey / lib / geth-stable / tools
eth.exe will be available in a path similar to this
C:\Program Files\Ethereum (++) 0.9.40\Release
Now -- you decide which one you are going to use. I have decided to use Geth.
2. Start a test network
geth --networkid 12345 --genesis ~/test/genesis.json --datadir ~/.ethereum_experiment console
now replace this "~/test/genesis.json" with the path where you can find the json file called genesis.json.
Kindly note that this is a RPC-Json instalation of geth. if you want change the 12345 but really you do not need to.
To locate the genesis.json, just google it or send me a PM and I shall provide this to you.
Now replace ~/.ethereum_experiment with the actual path on your computer where .ethereum_expriement is present
So the geth statement will look like this for me
(first Cd to the geth.exe location or set path)
geth --networkis 123445 --genesis C:/stuff/genesis.json --datadir C:/stuff/.ethereum_expriment console
This will start getting all the blocks and will give you a promt (within the command prompt)
That is the geth prompt
3. Getting Ethers
Best way is to provide your address in a forum like this and ask for test ethers and some good souls will provide you with one!!!
4. Smart Contracts
2 steps here
Compile
Deploy
Compile
2 steps here
1. Get Solifity

Now, if you folow the instructions present in the ethereum website it will not work

Remember we spoke about eth in STep1. Well one of the advanatges is it also downlods solc automatically.
so all you have to do is this
admin.setSolc("C:/Program Files/Ethereum (++) 0.9.40/Release/solc")
and then type
geth.getCompilers() and its done.
Neat!!!
NOw you can follow the things mentioned in the ethereum webiste and it will work.
2. Now if you are not too bothered (like me), then use the online compiler from our dear friend Chris.
https://chriseth.github.io/browser-solidity/Here on the left hand side, delete the default stuff and put our own contract. Generate stuff and on the right hand sige you will get something like
Geth Deploy and a text box by the SIDE of it. Copy the contents of this and this is your compiled contract.
Deploy
1. Either follow the instructions in the website -- if you have solidity
2. If you used online compiler, copy the text present in Geth Deplpoy text box and paste it in the geth console
Now it will ask you to to unlock your account (I presume you would have followed instructions and created an account for yourself once you had geth going)
Just type the password!
if you had enough GAS, then you will receive a contract mined message else just the same address with a 0X at front.
Sample compiled code
var _greeting = "I told you that my ny name is Neo!!!" ;
var greeterContract = web3.eth.contract([{"constant":false,"inputs":[],"name":"kill","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"greet","outputs":[{"name":"","type":"string"}],"type":"function"},{"inputs":[{"name":"_greeting","type":"string"}],"type":"constructor"}]);
var greeter = greeterContract.new(
_greeting,
{
from: web3.eth.accounts[0],
data: '60606040526040516102b43803806102b48339016040526060805160600190602001505b5b33600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b806001600050908051906020019082805482825590600052602060002090601f01602090048101928215609e579182015b82811115609d5782518260005055916020019190600101906081565b5b50905060c5919060a9565b8082111560c1576000818150600090555060010160a9565b5090565b50505b506101dc806100d86000396000f30060606040526000357c01000000000000000000000000000000000000000000000000000000009004806341c0e1b514610044578063cfae32171461005157610042565b005b61004f6004506100ca565b005b61005c60045061015e565b60405180806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156100bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561015b57600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b5b565b60206040519081016040528060008152602001506001600050805480601f016020809104026020016040519081016040528092919081815260200182805480156101cd57820191906000526020600020905b8154815290600101906020018083116101b057829003601f168201915b505050505090506101d9565b9056',
gas: 1000000
}, function(e, contract){
if (typeof contract.address != 'undefined') {
console.log(e, contract);
console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);
}})
Comments
I have the same issues this guy was having: https://github.com/ethereum/frontier-release/issues/113 . Although he got frustrated whereas I want to know how to resolve this.
I also noticed that If I make an error and try to hit backspace to fix it, it will start indenting and before you know it I get "the pipe is being closed" and every other command I type I get "Access is denied". I then have close the window and open another command window.
Any ideas how I can copy and paste text w/o having it duplicate and roll all over the screen?
OR
The example was the "Greeter" -- can I save this as a file and then just load it into the command line w/o having to copy and paste?
>loadScript('greeter.js')
greeter.js is in the same folder as geth.exe
I copied the code from online Solidity realtime compiler (from the geth deploy text box) and placed it in a file called greeter.js
any ideas?
Try providing a path and let me know, sometimes it is better to mention explicit path - though I understand you do not need to.
I tried with loadScript("C/homedirectory/filename.js") and it worked
So kindly provide a full path and it will work
Cheers,
Neo
loadScript("C/homedirectory/filename.js")
loadScript("C/ProgramData/chocolatey/lib/geth-stable/tools/filename.js")
loadScript("filename.js")
I even tried with your sample compiled code but to no avail and running eth.getCompilers() does return ['solidity']
These are my steps:
C:\WINDOWS\system32>geth attach
instance: Geth/v1.0.2/windows/go1.4.2
datadir: C:\Users\eriqa\.ethereum_experiment
coinbase: 0x##########################
at block: 0 (1969-12-31 16:00:00)
modules: admin:1.0 db:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 shh:
1.0 txpool:1.0 web3:1.0
>loadScript("C/homedirectory/filename.js")
false
Does it return false because I don't have enough gas or ethers? I am running on a private testnet.
{
DiscPort: 30303,
IP: '::',
ListenAddr: '[::]:30303',
Name: 'Geth/v1.0.2/windows/go1.4.2',
NodeID: '8c29b0b1aa367b008d1c50d2f70df2e0416ce849c8e03cc8cdcf4311d4ccb0eab81b4
10d12b93231909c1c9cdc7f10cdb5f4af0347042543bbeee8de3557f960',
NodeUrl: 'enode://8c29b0b1aa367b008d1c50d2f70df2e0416ce849c8e03cc8cdcf4311d4cc
b0eab[email protected][::]:30303'
,
TCPPort: 30303,
Td: '17179869184'
}
IP was empty...does that look right?
But this article: https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console shows an IP in the example.
I am definitely at an impasse
I switched over to Ubuntu and everything is working now. Thanks for helping!!