Created
May 26, 2018 04:08
-
-
Save vasa-develop/ec2a9fbbbfad15bd63ec335f232b4747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = eth.accounts[0] | |
web3.eth.defaultAccount = a; | |
// abi and bytecode generated from simplestorage.sol: | |
// > solcjs --bin --abi simplestorage.sol | |
var abi = <ABI>; | |
var Contract = web3.eth.contract(abi); | |
var contract = Contract.at(<ContractAddress>); | |
console.log(contract); | |
//string pubKey, string userHash, string metadataHash, string userClass, bool isOrg | |
contract.createAccount("<pubKey>","<userHash>","<metahash>","userclass",true,function(error, result){ | |
if(!error) | |
{ | |
console.log("RESULT: "); | |
console.log(result); | |
} | |
else{ | |
console.log("ERROR: "); | |
console.error(error); | |
} | |
}); | |
//The Result must contain the details entered above, but the result comes out to blank. Thus the transaction was not executed. | |
contract.getAccount("<userHash>",function(error, result){ | |
if(!error) | |
{ | |
console.log("RESULT: "); | |
console.log(result); | |
} | |
else{ | |
console.log("ERROR: "); | |
console.error(error); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment