Bitcoin Forum
May 04, 2024, 03:03:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BitcoinLib .Net Bitcoin, Litecoin and Bitcoin-Clones Library & RPC Wrapper in C#  (Read 3793 times)
mcaizgk2 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
February 09, 2014, 07:13:07 AM
Last edit: December 26, 2014, 11:09:09 PM by mcaizgk2
 #1

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.

1714834986
Hero Member
*
Offline Offline

Posts: 1714834986

View Profile Personal Message (Offline)

Ignore
1714834986
Reply with quote  #2

1714834986
Report to moderator
1714834986
Hero Member
*
Offline Offline

Posts: 1714834986

View Profile Personal Message (Offline)

Ignore
1714834986
Reply with quote  #2

1714834986
Report to moderator
1714834986
Hero Member
*
Offline Offline

Posts: 1714834986

View Profile Personal Message (Offline)

Ignore
1714834986
Reply with quote  #2

1714834986
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714834986
Hero Member
*
Offline Offline

Posts: 1714834986

View Profile Personal Message (Offline)

Ignore
1714834986
Reply with quote  #2

1714834986
Report to moderator
ThePok
Full Member
***
Offline Offline

Activity: 131
Merit: 100


View Profile
February 09, 2014, 10:01:21 AM
 #2

looks good Smiley exactly what iam looking for

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

mcaizgk2 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
February 09, 2014, 10:12:07 AM
 #3

I appreciate it. Yes, that's the plan.
goodlivn
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 09, 2014, 01:22:18 PM
 #4

Exactly what I need. Thanks for this Smiley Smiley
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 503


View Profile WWW
February 11, 2014, 02:33:00 AM
 #5

Good work.  Any project that uses Int16 gets my vote.
mcaizgk2 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
March 22, 2014, 03:24:48 AM
 #6

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.


knightcoin
Full Member
***
Offline Offline

Activity: 238
Merit: 100


Stand on the shoulders of giants


View Profile
March 22, 2014, 04:47:03 AM
 #7

Thanks for that OP.

http://www.introversion.co.uk/
mit/x11 licence 18.x/16|o|3ffe ::71
mcaizgk2 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
June 21, 2014, 07:30:41 PM
 #8

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.
Costner
Newbie
*
Offline Offline

Activity: 49
Merit: 0


View Profile
June 23, 2014, 04:10:59 PM
 #9

Thanks, I can play bitcoin api with c# now.
itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1076


^ Will code for Bitcoins


View Profile
December 26, 2014, 10:33:07 PM
 #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?
mcaizgk2 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
December 26, 2014, 10:56:36 PM
Last edit: December 27, 2014, 12:15:49 AM by mcaizgk2
 #11

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.

itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1076


^ Will code for Bitcoins


View Profile
December 27, 2014, 09:34:02 AM
 #12

Thanks, working like a charm.

BTW, great library IMHO, best in C#, and I've tried many of them. Thanks for the code.
TechnoBibble
Member
**
Offline Offline

Activity: 179
Merit: 10


View Profile
December 27, 2014, 10:37:14 PM
 #13

This is great Thank You
DavinciJ15
Hero Member
*****
Offline Offline

Activity: 780
Merit: 510


Bitcoin - helping to end bankster enslavement.


View Profile WWW
March 24, 2015, 07:18:09 PM
 #14

Nice work I think you should get a donation send me a bitcoin address.
mcaizgk2 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
March 24, 2015, 08:25:40 PM
 #15

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
DavinciJ15
Hero Member
*****
Offline Offline

Activity: 780
Merit: 510


Bitcoin - helping to end bankster enslavement.


View Profile WWW
March 24, 2015, 11:00:55 PM
 #16

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!
mcaizgk2 (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
March 24, 2015, 11:57:53 PM
 #17

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!