admin.register gives Invalid address error

someone235someone235 Member Posts: 10
edited August 2015 in web3-js
I try to run this code:
primary = eth.accounts[0];
source = "contract test {\n" +
"   /// @notice will multiply `a` by 7.\n" +
"   function multiply(uint a) returns(uint d) {\n" +
"      return a * 7;\n" +
"   }\n" +
"} ";
contract = eth.compile.solidity(source).test;
txhash = eth.sendTransaction({from: primary, data: contract.code });
// after it is uncluded
contractaddress = eth.getTransactionReceipt(txhash).contractAddress;
filename = "/tmp/info.json";
contenthash = admin.saveInfo(contract.info, filename);
admin.register(primary, contractaddress, contenthash);
But when I get to the last line I get this error:
Invalid address
at InvalidResponse (:-81076:-61)
at send (:-154580:-61)
at registerUrl (:-131712:-61)
at :1:1

Someone knows what I did wrong and how to fix this?
Post edited by StephanTual on

Comments

Sign In or Register to comment.