Hi guys, if anyone has an abundance of generosity, please clue me in as to what I'm doing wrong.
I've successfully uploaded the Coin smart contract from
https://github.com/ethereum/wiki/wiki/Solidity-Tutorial#subcurrency-example(I've used the exact same code and also code which removes the check for sender == minter). However, when running this code in geth I can't actually access the data. I'm using a private network and have successfully initiated a hello world contract.
using geth on mac OSX
> coin.mint(eth.coinbase, 10)
invalid address
> coin.queryBalance(eth.coinbase)
0
proof my method exists
coin
{
address: "0x1b2a2b88b9bd992b847324f7c953e2ad8fcbc369",
transactionHash: "0x5f23d5e0c6f1b3577f9e4b6709c6976efca4b13211edfc6a1948641907310138",
Send: function(),
allEvents: function(),
mint: function(),
queryBalance: function(),
send: function()
}
Command line started with the following (trying to test with private network)
geth --networkid="12345" --bootnodes "enode://be474a567c4f661fff49a5cf932823968f62c067981439872c022322278e0946d
[email protected]10.0.5.75:30303" --mine --minerthreads 1 --rpc --rpcport "8545" console
Answers
- have you set your coinbase?
- have you enabled it to spend ether? [personal.unlockAccount(eth.coinbase)]
- also note that the code merely transfers the amount in an internal map:
mapping (address => uint) balances;
there is no real transfer of ether from one account to another?
Regards,
Like coin.mint(eth.coinbase, 10, {from:eth.coinbase})