7

To expand the other response, to provide offline transaction signing in Nethereum you can do the following: First, you will need your private key, and sender address. You can retrieve the sender address from your private key using Nethereum.Core.Signing.Crypto.EthECKey.GetPublicAddress(privateKey); if you only have the private key. var privateKey = "...


6

Nethereum now supports offline transaction signing, so there is no longer a need to use EdgeJs or similar to run node scripts inside the .NET environment.


6

Nethereum implements Filters. Raw Filters are part of Eth and can be accessed using: web3.Eth.Filters.GetFilterChangesForBlockOrTransaction web3.Eth.Filters.GetFilterChangesForEthNewFilter web3.Eth.Filters.GetFilterLogsForBlockOrTransaction web3.Eth.Filters.GetFilterLogsForEthNewFilter web3.Eth....


4

It seems that from the official doc, that web3.eth.filter is not implemented yet: We currently have: Eth, Net, Miner, Admin, Personal and DebugGeth. Eth, Net are as described before generic to the standard Eth and Miner, Admin, Personal and DebugGeth belong to the management RPC. > web3.Eth.Transactions.GetTransactionReceipt; > web3.Eth....


4

Try the Nethereum.Portable which has a wider compatibility. It includes Web3,RPC, ABI, Hex and supporting libraries. In the future all the libraries will target netstandard 1.2 when is widely available. There is an example now using Nethereum Portable, Xamarin.Forms and MVVM Cross for a portable example using UWP (Windows 10, Phone, Xbox, Raspberry PI), ...


4

There is a helper converter function in Web3, similar to one implemented in web3.js. It can be used as following: web3.Convert.ToWei() or web3.Convert.FromWei() or as a static method Nethereum.Web3.Web3.Convert.ToWei() or Nethereum.Web3.Web3.Convert.FromWei() please have a look at the code for the different overloads https://github.com/Nethereum/...


4

I happened to stumble upon the same problem and after weeks of trial and error this worked for me: var web3 = new Nethereum.Geth.Web3Geth("http://127.0.0.1:8454"); var mine = await web3.Miner.Start.SendRequestAsync(6); NB:// please use the local address and port that applies to you, mine in this case is 127.0.0.1:8454


3

"Confirmed" can mean a few different things. When you see an event, it means the transaction was successfully mined into a block. Because there's a race to add a block to the end of the blockchain, it's always possible that there are two competing chains for a while. By definition, the longest blockchain is the truth, but if two blocks are mined at almost ...


3

You should get the transactionReceipt result that is something like this: { "transactionHash": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b", "transactionIndex": 0, "blockHash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46", "blockNumber": 3, "contractAddress": "...


3

The Nethereum.Web.Sample shows you how to interact with the DAO. In the sample there is a generic DAO service Source code in Github A simple pattern to create a contract service, is to instantiate it with your Web3 class and ABI. public class DaoService { private readonly Web3.Web3 web3; private string abi = @"abi..."; private Contract ...


3

Using the GitHub master branch of Nethereum (this is not available yet in nuget), you are able to do the following: Automatically guessing the types, as per web3js. var abiEncode = new ABIEncode(); var result = abiEncode.GetSha3ABIEncodedPacked(234564535, "0xfff23243".HexToByteArray(), true, -10); Or using specific types: var result = ...


2

Thought it might be helpful to add the code here for posting the transaction using Nethereum: var txCount = await web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(senderAddress); var encoded = web3.OfflineTransactionSigning.SignTransaction(myPrivateKey, receiverAddress, amount: 0, nonce: txCount.Value, ...


2

Smart contracts can store any data, including document hashes contract MyHashRegistry { mapping (uint => uint) hashes: function storeHash(uint documentId, uint hash) { hashes[documentId] = hash; } } It seems that you do not have yet relevant experience in Ethereum to build your own things, so jumping into conclusion instead of ...


2

In ethereum there is no script opcodes so there is no op_return (like in Bitcoin). However you could store data in a similar way by using : eth.sendTransaction({from:eth.accounts[0],to:eth.accounts[1],value:web3.toWei(1‌​00,'finney'),data:web3.toHex('My Message')})


2

The value parameter refers to the amount of Ether you want to send to the contract with that transaction. When sending a transaction there are common parameters: To (the address where you sending the transaction, in this case, the contract address which is automatically set) From (the address from) Gas (the total amount of gas you want to spend, or gas ...


2

I thought that by using web3.Eth.GetBalance API I would already be using the https://api.myetherapi.com/eth endpoint instead of the root https://api.myetherapi.com, but I was wrong, I had to use the former URL.


2

This works blockHash = (await _web3.Eth.Blocks.GetBlockWithTransactionsByNumber.SendRequestAsync( new HexBigInteger(relevantBlockNumber))).BlockHash;


2

Basically, the difference between the two is where the private key or the key file is stored. With a ManagedAccount, the key file for your wallet is stored on or managed by the blockchain client (Geth, Parity, ...). When sending a transaction, you have to provide your wallet address and the password for the key file. The blockchain client does then decrypt ...


2

This is a very good explanation by Juan Blanco in my opinion. Quote from Gitter chat: There is no catching of events as such everything has a level of polling to get that data even the javascript watch It has not been implemented any watching mechanism as there are many ways to do it.. depending on your set up.


2

Fixed it! Forgot to add a variable for returning. Changed the get methods to return (string s), before it was constant return (string). So, function DocumentTitle() constant returns (string) { return docTitle; } now looks like function DocumentTitle() returns (string s) { return docTitle; } Simple right ?...


2

Nethereum 2.0.0 has moved all the specific Geth methods to Nethereum.Geth. To start the mining process, you will need to use Web3Geth instead of Web3. Steps: install nuget package with Geth Install-Package Nethereum.Geth -Pre 2. Create and use Web3Geth var web3Geth = new Web3Geth(); async web3Geth.Miner.Start.SendRequestAsync(6);


2

I can see the price that you are using is rather low already (it needs to be converted from Gwei to Wei), but you will also benefit of estimating the gas of the transaction, and use other features of Nethereum. First of all, we can just have a TransferFunction. This is mainly an object that describes the Transfer function from the ERC20 contract and the ...


2

I have found the answer myself after downloading Nethereum source code and trying to debug myself. The latest version requires us to put the [Event()] attribute for Event DTO


2

You can encode them like this, ParameterEncoder is in the namespace Nethereum.ABI.FunctionEncoding public byte[] GetABIParamsEncoded<T>(T functionInput) { var type = typeof(T); return new ParametersEncoder().EncodeParametersFromTypeAttributes(type, functionInput); } This simpler function will be available in 3.1 in the ...


2

The problem is that there are different type of Transfer events which share the same signature. The ERC20 transfer event is defined as: Transfer(address indexed _from, address indexed _to, uint256 _value) And the ERC721 (the standard for non-fungible/unique assets on the Ethereum blockchain) defines the transfer event as: Transfer(address indexed _from, ...


2

ERC20 tokens consist of smart contracts which are built on top of the Ethereum network. This mean you must comply with the protocol specific pillars of this network, i.e. paying fees for network addition of your transactions etc. If you can't pay the network fee, then you can't add the transaction. Now if you can't add the transaction then you can't make ...


1

suppose my_function is a payable function why not to use? function.SendTransactionAsync(addressFrom, gas, valueAmount, augEvent);. } in the valueAmount you specify the ethers to send. For example : var my_functionFunction = contract.GetFunction("my_function"); var tx = await my_functionFunction.SendTransactionAsync(addressFrom, gas, ...


1

The new version of Nethereum separated the shared RPC APIs, from the Client specific APIs and functionality provided by Geth and Parity. To interact with the Geth client Miner, you need now to add the nuget package Nethereum.Geth, and use the Web3Geth class instead, not the Web3 class: var web3 = new Web3Geth(myAccount); web3.Miner.Start.SendRequestAsync(6)...


1

Ok I found it: "web3.Net.Version" Looking at https://github.com/ethereum/wiki/wiki/JSON-RPC is better then looking at the web3.js docs (at least in some cases) for Nethereum


1

I think I got it sorted- I think I was calling GetAllChanges on the function instead of the event. In any case- I can see the events being raised now. I added in event RequestReceived(string s); So I could track how far in the contract functions the execution was getting to.


Only top voted, non community-wiki answers of a minimum length are eligible