Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: mb300sd on June 25, 2012, 07:48:44 AM



Title: New C# Bitcoin RPC Library
Post by: mb300sd on June 25, 2012, 07:48:44 AM
I wrote this for a couple projects I'm working on, but thought I'd share it since the only other C# library hasn't been updated in over a year. I've implemented every rpc call in 0.6.2, as well as the coin control branch.

https://github.com/mb300sd/Bitcoin.NET

Tested with Mono framework as well as Microsoft .Net.


Title: Re: New C# Bitcoin RPC Library
Post by: jim618 on June 25, 2012, 08:41:37 AM
Good work there mb300sd!

Hopefully it will inspire C# coders to write <Insert Great New Bitcoin Program Here> with it.

:-)


Title: Re: New C# Bitcoin RPC Library
Post by: _mr_e on June 27, 2012, 12:58:17 AM
Is there any documentation on how to use this? What is the Uri that needs to be passed into BitcoinRPC?


Title: Re: New C# Bitcoin RPC Library
Post by: mb300sd on June 27, 2012, 04:57:39 AM
Is there any documentation on how to use this? What is the Uri that needs to be passed into BitcoinRPC?

Look in Test.cs for a basic example. No documentation but its pretty intuitive. All commands have the same parameters as the ones passed to bitcoind, and return a basic type, xxxxxxResponse class or IEnumerable<> of one. The xxxxxResponse classes have the same property names as the JSON objects returned by bitcoind.


Title: Re: New C# Bitcoin RPC Library
Post by: flower1024 on June 27, 2012, 06:03:07 AM
does it work with blockchain.infos wallet? it does implement all bitcoin rpc calls

i just want to write a small stats app


Title: Re: New C# Bitcoin RPC Library
Post by: mb300sd on June 27, 2012, 06:17:26 AM
does it work with blockchain.infos wallet? it does implement all bitcoin rpc calls

i just want to write a small stats app

I see no reason it wouldn't as long as the rpc calls are the same.


Title: Re: New C# Bitcoin RPC Library
Post by: Kitemike on June 27, 2012, 09:28:30 PM
I知 glad to see I知 not the only one that writes 10,000 lines of code without a single comment LOL.  I知 still reading thru the code making sure there isn稚 a line hidden in someplace that just steals my wallet, but so far it look pretty complete.  Thanks for making this available. I知 really looking forward to digging into it and automating my SatoshiDice plays. ;)


Title: Re: New C# Bitcoin RPC Library
Post by: mb300sd on June 27, 2012, 11:20:19 PM
I知 glad to see I知 not the only one that writes 10,000 lines of code without a single comment LOL.  I知 still reading thru the code making sure there isn稚 a line hidden in someplace that just steals my wallet, but so far it look pretty complete.  Thanks for making this available. I知 really looking forward to digging into it and automating my SatoshiDice plays. ;)

Exactly what I'm using it for :D

----------------------

I just pushed a new branch that supports batch rpc calls from this pull request, https://github.com/bitcoin/bitcoin/pull/1512

Mostly untested.


Title: Re: New C# Bitcoin RPC Library
Post by: _mr_e on September 26, 2013, 02:18:44 AM
Is this library still working? I am trying to understand the code and run the test but am having a problem deserializing the result. I am getting the error:

Error setting value to 'result' on 'BitcoinNET.RPCClient.RPCResponse`1[Newtonsoft.Json.Linq.JObject]'.


Title: Re: New C# Bitcoin RPC Library
Post by: BitKoot on September 26, 2013, 02:05:00 PM
Is this library still working? I am trying to understand the code and run the test but am having a problem deserializing the result. I am getting the error:

Error setting value to 'result' on 'BitcoinNET.RPCClient.RPCResponse`1[Newtonsoft.Json.Linq.JObject]'.

I case you can't get it to work, I have made a similar RPC wrapper for bitcoin-qt: BitcoinRpcSharp - A C# wrapper for the Bitcoin JSON RPC interface (https://bitcointalk.org/index.php?topic=294807.0)

One quick example (calling getinfo):
Code:
BitcoinWallet wallet = new BitcoinWallet("http://192.168.56.1:19001", "test", "123", false);
Info info = wallet.GetInfo();
Console.WriteLine("Current difficulty: {0}", info.Difficulty);


Title: Re: New C# Bitcoin RPC Library
Post by: vual on September 29, 2013, 09:35:10 AM
Thanks a bunch, very sexy!


Title: Re: New C# Bitcoin RPC Library
Post by: edmlbox on August 26, 2020, 02:22:39 PM
The newest up to date c# library for .net  is .Net-Bitcoin-RPC (https://github.com/edmlbox/.Net-Bitcoin-RPC) with full documentation about each call. Very easy to use.


Title: Re: New C# Bitcoin RPC Library
Post by: NotATether on August 27, 2020, 02:58:25 PM
The newest up to date c# library for .net  is .Net-Bitcoin-RPC (https://github.com/edmlbox/.Net-Bitcoin-RPC) with full documentation about each call. Very easy to use.

What newer features does yours have over the original one? I looked through your project's commit history and these are the only additions I could find: https://github.com/edmlbox/.Net-Bitcoin-RPC/commit/c06532fbf1435b114b33e7235bb1fdc7c753c397#diff-793e161d67bc194802346c5b61423b04

It looks to me like the only things you added are a wrapper class for multiple wallets, a wallet name class, a wallet directory class and a class that serializes JSON.