These are chat archives for Nethereum/Nethereum

12th
Dec 2018
Juan Blanco
@juanfranblanco
Dec 12 2018 04:48
@Shammah yes that is great, what I did is mainly keep the original Observable implementations but with your idea of having extensions over events, so you can have them too, mainly let the user decided which direction to go. If not enough acceptance goes for one, then another can be used.
Juan Blanco
@juanfranblanco
Dec 12 2018 04:54
On the implementation of all rpc methods as streaming methods, I believe the value is the subscription part, other methods can be used in traditional routes. (Mainly maintenance over value). In these scenarios, yes composition through extensions will be the best way to go.
On the composition side, I thought about having a generic type T which all the rpc methods could have, this could be an observable or event driven implementation, but that would force users to do something like (blockSubscription.Handler.Event) or (blockSubscription.Handler.AsObservable)
but creating will be done as new BlockSubsbcription<RpcStreamingSubscriptionResponseEvent<Block>>() which is very verbose
Juan Blanco
@juanfranblanco
Dec 12 2018 04:59
although you could have the BlockSubscriptionEventHandler which inherits from the other one
Mosin Pathan
@mosinms7711
Dec 12 2018 09:43
hi
i trying to get data from smart contract in struct format…if there are less than 5 object i am able to get data but if it is more than 5 then it gives me error...
Message:Index and count must refer to a location within the buffer.
Parameter name: bytes
this is error i am getting while retriving more than 5 objects
from struct

GetDataFunction getDataFunction = new GetDataFunction();

var getFileOfOwnerHandler = web3.Eth.GetContractQueryHandler<GetDataFunction>();
getDataFunction.FromAddress = AppConstants.walletAddress;

var getFileOfOwnerResult = await getFileOfOwnerHandler.QueryDeserializingToObjectAsync<GetDataOutputDTO>(getDataFunction, contract.Address);

public partial class GetDataFunction : GetDataFunctionBase { }

[Function("getFilesOfOwner", typeof(Test))]
public class GetDataFunctionBase : FunctionMessage
{

}

public partial class GetDataOutputDTO : GetDataOutputDTOBase { }

[FunctionOutput]
public class GetDataOutputDTOBase : IFunctionOutputDTO
{
//Struct return, created manually the type
[Parameter("tuple", "test", 1)]
public virtual Test Test { get; set; }
}

//This is the struct, created manually
public class Test
{
[Parameter("bytes32", "fileName", 1)]
public virtual string imageName { get; set; }
[Parameter("string", "kfsHash", 2)]
public virtual string imageHash { get; set; }
}

Roy
@Shammah
Dec 12 2018 09:43
Actually, the way I currently do it in my local branch is to have a simple, non-streaming RPC request, like for example EthBlockNumber, and from it in an Observable.FromAsync. So I wrote extension methods that basically do the following: Observable.FromAsync(() => new EthBlockNumber().SendAsync());
So maybe it's indeed not worth the hassle yet to stream everything aside from existing web3 subscriptions
Roy
@Shammah
Dec 12 2018 10:09
s/from it in an/form it into an
turtlewen
@turtlewen
Dec 12 2018 11:16
@juanfranblanco hi
image.png
last time i getting the problem of using nethereum to connect to another nodes
but until now i still cannot solve it><
turtlewen
@turtlewen
Dec 12 2018 11:22
it is still Rpc timeout after 20000 milliseconds'
Online Certification Token
@provetoken
Dec 12 2018 13:45
hi,
is there any way to get all the transactions for a specific HD wallet (which contains a list of addresses)?
ideally will be also to have the ability to paginate the results
AhmedAli202020
@AhmedAli202020
Dec 12 2018 14:03
@juanfranblanco Hello Juan, Is there a way to add listener to an event using Nethereum?
Juan Blanco
@juanfranblanco
Dec 12 2018 14:15
@mosinms7711 I will have to have a look tomorrow
Kevin Small
@KevinSmall
Dec 12 2018 14:16
oops you got there before me
Juan Blanco
@juanfranblanco
Dec 12 2018 14:16
@KevinSmall ha ha same time :D
@Shammah yeah it does not make sense to have all the other requests implemented as streaming with events / observables (But keep it open the idea and implementation just in case), nevertheless feel free make a pull request for the extensions.
That project will be great for generic polling mechanisms too, the subscription for logs / can follow the same pattern to subscribe, unsubscribe, etc but implemented through polling
@provetoken well you will need to use the Nethereum.HdWallet to get the addresses, from there if you look at the blockchain processing project in GitHub you should be able to get addresses that way. Also parity trace_filter provides something similar, check Nethereum.Parity or etherscans api
Online Certification Token
@provetoken
Dec 12 2018 14:23
thank you for your answer,
the problem is that I have more than 1000 addresses
Juan Blanco
@juanfranblanco
Dec 12 2018 14:23
yeah i understand, then the first solution is more suitable
but that needs you to store and process all blocks
but only using the addresses you want
@turtlewen so are you able to connect locally?
Roy
@Shammah
Dec 12 2018 14:25
I'll PR when you're all settled ;) It's a bit difficult if we're both working on the same things.
Juan Blanco
@juanfranblanco
Dec 12 2018 14:25
yes true, I don't think is going to change dramatically the upper api
well at all
just the websockets side
Online Certification Token
@provetoken
Dec 12 2018 14:26
is there any way to create an address only for receive ETH,based on another address, so that I can get transactions for only one address(lets say the parent)?
Juan Blanco
@juanfranblanco
Dec 12 2018 14:26
to handle errors, disconnections and be able to stop @Shammah
no every account is unique
although if using hd you can manage your children
but that is external to the blockchain
Online Certification Token
@provetoken
Dec 12 2018 14:28
so..the only way to do it is only to configure a full node locally and iterate it manually
Juan Blanco
@juanfranblanco
Dec 12 2018 14:28
yeah that is about it
you can use the blockchain processing projects
that will help you
Online Certification Token
@provetoken
Dec 12 2018 14:29
oke,thank you very much for your help
Juan Blanco
@juanfranblanco
Dec 12 2018 14:29
or yeah.. parity_trace_filter
if using parity
turtlewen
@turtlewen
Dec 12 2018 15:38
@juanfranblanco Locally can
but when come to LAN got problem
var web3 = new Nethereum.Web3.Web3("HTTP://192.168.0.121:8545");
me using this method to connect
Juan Blanco
@juanfranblanco
Dec 12 2018 15:59
ok so it is an issue with your network, if you have opened with your node with 0.0.0.0
AhmedAli202020
@AhmedAli202020
Dec 12 2018 16:03
image.png
I have tried to get logs from event like this
but i get No parameterless constructor defined for this object
any help ?
Matt Sharp
@msharp19
Dec 12 2018 17:43
bad request trying to
bad request trying to call web3.personal.newaccount.sendrequestasync() using infura as the endpoint, any idea? The url seems correct