These are chat archives for Nethereum/Nethereum

29th
Sep 2017
Andres G. Aragoneses
@knocte
Sep 29 2017 03:30
I vote for staying in gitter
at least I can use their IRC bridge
I don't want yet another chat-tab open in my browser...
Juan Blanco
@juanfranblanco
Sep 29 2017 06:17
IRC bridge awesome :)
@knocte what client do you use in Android? (If any)
Andres G. Aragoneses
@knocte
Sep 29 2017 06:20
I don't use IRC in Android
in desktop I use smuxi
Lucas Cullen
@bitcoinbrisbane
Sep 29 2017 07:03
when passing a Bytes32, is there a converter from a string?
Juan Blanco
@juanfranblanco
Sep 29 2017 08:27
@knocte Oh I haven't trised smuxi
@bitcoinbrisbane you can use strings to encode and decode bytes32
Daniel Hursan
@hdany
Sep 29 2017 11:26
Hello, @juanfranblanco . Do you know by any chance if , when using truffle deploy, I must always use the coinbase address as the contract deployer?
but in my case, I forgot the private key to the coinbase account (local geth development)
although, in geth, I unlock a newly created account, and I get "true" as response, I still get the error in the original post, when deploying.
but you can always ask the tim in the gitter of truffle
he will know best :D
Daniel Hursan
@hdany
Sep 29 2017 12:09
thanks!
Chandra Sekhar
@tcsekhar
Sep 29 2017 21:25

I was reading through the documentation and still couldn't figure out how to do this simple thing. I'm spending too much time on it. Can you please help?

I need to get the state of a contract transaction and pass back a variable value in that state from the contract. Can you please help me in how to pass the block number and the block hash to the GetFunction CallAsync method to get the value back?

I'm able to get the current state variable value but not a historic or for a point of time transaction.

code

public async Task getStoredStateName(HexBigInteger blockno, string blockhash)
{   var senderAddress = "0x12890d2cce102216644c59daE5baed380d84830c";
    var password = "password";
    var abi = @"[{'constant':false,'inputs':[],'name':'getName','outputs':[{'name':'','type':'string'}],'payable':false,'type':'function'},{'constant':false,'inputs':[{'name':'name','type':'string'},{'name':'datetime','type':'string'}],'name':'storeData','outputs':[],'payable':false,'type':'function'},{'constant':false,'inputs':[],'name':'getSender','outputs':[{'name':'','type':'address'}],'payable':false,'type':'function'},{'constant':false,'inputs':[],'name':'getDateTime','outputs':[{'name':'','type':'string'}],'payable':false,'type':'function'}]";
    var byteCode = "***";
    var account = new ManagedAccount(senderAddress, password);
    var web3 = new Nethereum.Geth.Web3Geth(account);
    var transactionHash = await web3.Eth.DeployContract.SendRequestAsync(byteCode, senderAddress, new HexBigInteger(900000));
    var receipt = await MineAndGetReceiptAsync(web3, transactionHash);
    var contractAddress = receipt.ContractAddress;
    var contract = web3.Eth.GetContract(abi, contractAddress);
    var result = await contract.GetFunction("getName").CallAsync<string>();
    Console.WriteLine("Name:" + result);
}