I started using Geth. and make a shell script which will end txn to another ETH address.
Step 1: Run command 'geth --fast --cache=1024' in one terminal and wait for full blockchain update. Step 2: Run below code as send.sh in another shell. Command: sh send.sh 'ETH address to send ETH' 'Amount'
Code for send.sh: #!/bin/sh
geth attach << EOF | grep "RESULT:" | sed "s/RESULT: //"
personal.unlockAccount("My ETH Address", "password")
var txnid = web3.eth.sendTransaction({from: "My ETH Address", to: "$1", value: web3.toWei($2, "ether")});
console.log("RESULT: " + txnid);
EOF
Output: Txn id [This works perfectly, no issues but want to send transaction from another server using javascript API by connecting this server geth]
All looks fine to me. But I want to use same functionality in https://github.com/ethereum/wiki/wiki/JavaScript-API
when I try to connect localhost:8545 not working and run Javascript API call. Not sure how to convert this code to Javascript. I am new hers any help will be great to my start up with Ethereum Javascript API.