So I've followed the greeter contract tutorial from here to deploy a contract to my private cloud. It works fine and all, but it is rather difficult that I need to create a string from my contract and then deploy that. It would be easier if I could create a contract.sol
file and compile that.
So I put the greeter code into a file:
contract mortal {
address owner;
function mortal() {
owner = msg.sender;
}
function kill() {
if (msg.sender == owner) selfdestruct(owner);
}
}
contract greeter is mortal {
string greeting;
function greeter(string _greeting) public {
greeting = _greeting;
}
function greet() constant returns(string) {
return greeting;
}
}
and ran the following command:
solc --optimize --bin contract.sol
This creates two new files:
greeter.bin
mortal.bin
But from here I'm kinda lost. Does anybody know how I can deploy this greeter contract using geth
and these two bin files? All tips are welcome!