Author

Topic: BitcoinLib .Net Bitcoin, Litecoin and Bitcoin-Clones Library & RPC Wrapper in C# (Read 3809 times)

member
Activity: 66
Merit: 10
Nice work I think you should get a donation send me a bitcoin address.

Thanks for your compliments. The bitcoin address for donations can be found at: https://github.com/GeorgeKimionis/BitcoinLib#donations

Cool I send you small donation. 

I just started looking at your code today and I have one suggestion as I am going to make the changes my self to reuse your source code to access another RPC that's not exactly a Coin Service. In the RpcConnector object should not know of a Coin Service but instead know of a Json Web Service because that's what it's a wrapper for in my humble opinion.

Cheers!

Thanks for your input. You can query the JSON RPC API directly via the disconnected (AKA "raw") RPC connector which can be found at:

https://github.com/GeorgeKimionis/BitcoinLib/blob/master/CoinWrapper/RPC/Connector/RawRpcConnector.cs

As you go on exploring the code you will find out the reasons that led me into ditching the raw JSON approach, which naturally came first in the very early versions of BitcoinLib, and move towards a much more robust, concrete and scalable, service-oriented approach. In the meantime I will be more than happy to see your take on that throughout your fork.
hero member
Activity: 780
Merit: 510
Bitcoin - helping to end bankster enslavement.
Nice work I think you should get a donation send me a bitcoin address.

Thanks for your compliments. The bitcoin address for donations can be found at: https://github.com/GeorgeKimionis/BitcoinLib#donations

Cool I send you small donation. 

I just started looking at your code today and I have one suggestion as I am going to make the changes my self to reuse your source code to access another RPC that's not exactly a Coin Service. In the RpcConnector object should not know of a Coin Service but instead know of a Json Web Service because that's what it's a wrapper for in my humble opinion.

Cheers!
member
Activity: 66
Merit: 10
Nice work I think you should get a donation send me a bitcoin address.

Thanks for your compliments. The bitcoin address for donations can be found at: https://github.com/GeorgeKimionis/BitcoinLib#donations
hero member
Activity: 780
Merit: 510
Bitcoin - helping to end bankster enslavement.
Nice work I think you should get a donation send me a bitcoin address.
member
Activity: 179
Merit: 10
This is great Thank You
legendary
Activity: 1974
Merit: 1077
^ Will code for Bitcoins
Thanks, working like a charm.

BTW, great library IMHO, best in C#, and I've tried many of them. Thanks for the code.
member
Activity: 66
Merit: 10
Hi,

I've done
Code:
bitcoind -reindex -txindex
(as you instructed in Readme) on the blockchain, interrupted it once but let it eventually finish.

Still can't get transactions witch don't belong to the wallet. Thought it was BitcoinLib problem, but turns out it is not, it works fine, getting same dreaded "Invalid or non-wallet transaction id (code -5)" from the bitcoind or Bitcoin-QT console for all transactions not belonging to the wallet.

Tried it on Windows only, should I try it on Linux? Do you have any suggestions what can be the problem?

You need to call GetRawTransaction() for non-wallet txs, as GetTransaction() only works for wallet txs.

For example, to read the first tx from block: 336052 you need to call:

Code:
GetRawTransactionResponse randomNonWalletTx = CoinService.GetRawTransaction("84f4fd2ded36e0b8c368a2ae9ac488b570dc03d265d8310a71c9049a7854e3e7", 1);

Be aware that GetRawTransaction() will work for all txs except for the genesis block's coinbase tx, which is considered a special case.

On a side note, the ITransactionResponse interface (found under: BitcoinLib.Responses.Bridges) serves as a bridge for GetTransaction() and GetRawTransaction(), allowing you to perform a check at run-time with IsInWalletTransaction() (found under: BitcoinLib.Services.RpcServices.RpcExtenderService) so you can then cast the response as the appropriate type, when necessary.

legendary
Activity: 1974
Merit: 1077
^ Will code for Bitcoins
Hi,

I've done
Code:
bitcoind -reindex -txindex
(as you instructed in Readme) on the blockchain, interrupted it once but let it eventually finish.

Still can't get transactions witch don't belong to the wallet. Thought it was BitcoinLib problem, but turns out it is not, it works fine, getting same dreaded "Invalid or non-wallet transaction id (code -5)" from the bitcoind or Bitcoin-QT console for all transactions not belonging to the wallet.

Tried it on Windows only, should I try it on Linux? Do you have any suggestions what can be the problem?
newbie
Activity: 49
Merit: 0
Thanks, I can play bitcoin api with c# now.
member
Activity: 66
Merit: 10
Just a heads up, BitcoinLib is now fully compatible and up-to-date with Bitcoin 0.9.2.

https://github.com/GeorgeKimionis/BitcoinLib

Features:

- Fully compatible and up-to-date with Bitcoin 0.9.2 RPC API.
- Design-by-contract, service-oriented architecture.
- Strongly-typed structures for complex RPC requests and responses.
- Implicit JSON casting for all RPC messages.
- Extended methods for every-day scenarios where the built-in methods fall short.
- Exposure of all RPC API's functionality as well as the extended methods through a single interface.
- Fallback mechanism for timed-out RPC requests.
- Custom RPC exceptions.
- Supports all Bitcoin clones.
- Can operate on unlimited daemons with a single library reference.
- Litecoin integration included.
- Each coin instance can be fully parametrized at run-time and implement its own constants.
- Console test client with demo methods implemented in it.
- Disconnected raw RPC connector included for quick'n'dirty debugging.
- Testnet ready.
- Fully configurable.
full member
Activity: 238
Merit: 100
Stand on the shoulders of giants
member
Activity: 66
Merit: 10
Just a heads up, BitcoinLib is now fully up-to-date with bitcoin-cli 0.9.0.

https://github.com/GeorgeKimionis/BitcoinLib

Features:

  • Fully compatible and up-to-date with Bitcoin-Cli 0.9 RPC API.
  • Design-by-contract, service-oriented architecture.
  • Strongly-typed structures for complex RPC requests and responses.
  • Implicit JSON casting for all RPC messages.
  • Extended methods for every-day scenarios where the built-in methods fall short.
  • Exposure of all RPC API's functionality as well as the extended methods through a single interface.
  • Fallback mechanism for timed-out RPC requests.
  • Custom RPC exceptions.
  • Console and web test clients out of the box with demo methods implemented in them.
  • Testnet ready.
  • Fully configurable.


hero member
Activity: 765
Merit: 503
Good work.  Any project that uses Int16 gets my vote.
newbie
Activity: 4
Merit: 0
Exactly what I need. Thanks for this Smiley Smiley
member
Activity: 66
Merit: 10
I appreciate it. Yes, that's the plan.
full member
Activity: 131
Merit: 100
looks good Smiley exactly what iam looking for

you plan to support it in the future, for example bitcoin-qt 0.9?

member
Activity: 66
Merit: 10
BitcoinLib is a C# Bitcoin Library / RPC Wrapper for .Net projects, up-to-date, Testnet ready, console/web demo clients and setup instructions included.

https://github.com/GeorgeKimionis/BitcoinLib

BitcoinLib follows a design-by-contract service-oriented architecture, uses strongly-typed structures for complex RPC daeamon's requests and responses, performs all the JSON casting behind the scenes so you don't have to do it manually in every single RPC call, encapsulates all Qt API's logic into a single interface, it comes along with some extended methods for every-day scenarios where the default methods fall short, it is Testnet-ready, fully configurable and on top of that you get two test clients (console + web) out of the box with some nice demo methods implemented in them.

Jump to: