Author

Topic: C# worked code + support (Read 1841 times)

donator
Activity: 1218
Merit: 1079
Gerald Davis
June 04, 2012, 07:40:48 AM
#16
I have a couple of projects I'd love to add bitcoin functionallity to.  How can I get a hold of this .dll (or the .proj)?  There are probably more .net programmers out there than are willing to admit  Wink


Well the source code is here (including solution & project files)
http://code.google.com/p/bitcoinsharp/

However it hasn't been updated in 6 months.  Up thread someone posted changes they needed to make to get the portion they were using working.

Likely there are other issues but that should get you started.

The optimal solution would be for someone (maybe I am nominating myself) to fork the project and get it current.
legendary
Activity: 1261
Merit: 1000
June 04, 2012, 07:11:24 AM
#15
I´m still whaiting for the projet in c#.net!

Tnks
member
Activity: 108
Merit: 10
June 04, 2012, 07:07:25 AM
#14
I have a couple of projects I'd love to add bitcoin functionallity to.  How can I get a hold of this .dll (or the .proj)?  There are probably more .net programmers out there than are willing to admit  Wink
legendary
Activity: 1036
Merit: 1002
June 02, 2012, 08:28:58 AM
#13
Thanks to everyone who helps making this work!

I know I will need it, and I'd be happy to have a real CLI project instead of BitcoinJ on IKVM.
legendary
Activity: 1261
Merit: 1000
June 01, 2012, 08:39:46 PM
#12
If you can wait until Sunday, I can make it for you.

Cool! thank you. I´ll wait.
donator
Activity: 640
Merit: 500
June 01, 2012, 08:03:29 PM
#11
If you can wait until Sunday, I can make it for you.
legendary
Activity: 1261
Merit: 1000
June 01, 2012, 07:49:18 PM
#10
Anyone can send me the visual studio solution?
donator
Activity: 640
Merit: 500
June 01, 2012, 03:27:35 PM
#9
Class
So what you really need is in fact just JSON-RPC functions in C# to (send, receive, create wallet, address...) to a bitcoind instance ?

If so I might be able to squeeze it in, as I am a C# developer as well.

Should it be a Windows Form or Console application?

Regards
Kris

Class library would be the best project type to ensure resuability right?
Encapsulate all the JSON logic into a C# library and developers can drop it into any .Net solution (web, console, winform, etc).

If you want to get crazy write up a solution which consists of a class library project, an "example" project, and a unit testing project.

Glad to find at least three other .Net developers.  We are a rare breed in the Bitcoin world.

Yes a Class library, which is just a .dll file to include in your csharp projects, in Visual Studio or SharpDevelop.
hero member
Activity: 555
Merit: 654
June 01, 2012, 08:20:10 AM
#8
When I needed to find a tool to generate some non-standard transactions I tested BitcoinJ and BitcoinSharp.

BitcoinJ requires to install a lot o packages and compiles using maven. I took me more than two hours to make it work.

BitcoinSharp took me less than two minutes.

It's the most simple Bitcoin library.


donator
Activity: 1218
Merit: 1079
Gerald Davis
June 01, 2012, 07:25:22 AM
#7
Class
So what you really need is in fact just JSON-RPC functions in C# to (send, receive, create wallet, address...) to a bitcoind instance ?

If so I might be able to squeeze it in, as I am a C# developer as well.

Should it be a Windows Form or Console application?

Regards
Kris

Class library would be the best project type to ensure resuability right?
Encapsulate all the JSON logic into a C# library and developers can drop it into any .Net solution (web, console, winform, etc).

If you want to get crazy write up a solution which consists of a class library project, an "example" project, and a unit testing project.

Glad to find at least three other .Net developers.  We are a rare breed in the Bitcoin world.
donator
Activity: 640
Merit: 500
June 01, 2012, 06:46:02 AM
#6
So what you really need is in fact just JSON-RPC functions in C# to (send, receive, create wallet, address...) to a bitcoind instance ?

If so I might be able to squeeze it in, as I am a C# developer as well.

Should it be a Windows Form or Console application?

Regards
Kris
legendary
Activity: 1261
Merit: 1000
May 31, 2012, 06:13:29 PM
#5
Can you share the visual studio project?

I  made it work. Some minor changes are needed. I don't warranty that it's correct, but It worked for me.
Best regards,
 Sergio.


This is the diff:

Index: DownloadListener.cs
===================================================================
--- DownloadListener.cs   (revision 60)
+++ DownloadListener.cs   (working copy)
@@ -36,7 +36,7 @@
     {
         private int _originalBlocksLeft = -1;
         private int _lastPercent;
-        private readonly Semaphore _done = new Semaphore(0, 0);
+        private readonly Semaphore _done = new Semaphore(1, 1);
 
         public override void OnChainDownloadStarted(Peer peer, int blocksLeft)
         {
Index: NetworkConnection.cs
===================================================================
--- NetworkConnection.cs   (revision 60)
+++ NetworkConnection.cs   (working copy)
@@ -76,17 +76,22 @@
             _in = new NetworkStream(_socket, FileAccess.Read);
 
             // the version message never uses check-summing. Update check-summing property after version is read.
-            _serializer = new BitcoinSerializer(@params, false);
+            _serializer = new BitcoinSerializer(@params, true);  // SDL: Checksuming now ALWAYS necessary
 
             // Announce ourselves. This has to come first to connect to clients beyond v0.30.20.2 which wait to hear
             // from us until they send their version message back.
             WriteMessage(new VersionMessage(@params, bestHeight));
+            // SDL: Now read a versionack
+
             // When connecting, the remote peer sends us a version message with various bits of
             // useful data in it. We need to know the peer protocol version before we can talk to it.
+
             _versionMessage = (VersionMessage) ReadMessage();
+
             // Now it's our turn ...
             // Send an ACK message stating we accept the peers protocol version.
             WriteMessage(new VersionAck());
+
             // And get one back ...
             ReadMessage();
             // Switch to the new protocol version.
Index: Store/BoundedOverheadBlockStore.cs
===================================================================
--- Store/BoundedOverheadBlockStore.cs   (revision 60)
+++ Store/BoundedOverheadBlockStore.cs   (working copy)
@@ -214,7 +214,8 @@
             {
                 _channel.Dispose();
             }
-            _channel = file.OpenRead();
+            // SDL _channel = file.OpenRead();
+            _channel = file.Open(FileMode.Open, FileAccess.ReadWrite);
             try
             {
                 // Read a version byte.

hero member
Activity: 555
Merit: 654
May 31, 2012, 12:36:52 PM
#4
I  made it work. Some minor changes are needed. I don't warranty that it's correct, but It worked for me.
Best regards,
 Sergio.


This is the diff:

Index: DownloadListener.cs
===================================================================
--- DownloadListener.cs   (revision 60)
+++ DownloadListener.cs   (working copy)
@@ -36,7 +36,7 @@
     {
         private int _originalBlocksLeft = -1;
         private int _lastPercent;
-        private readonly Semaphore _done = new Semaphore(0, 0);
+        private readonly Semaphore _done = new Semaphore(1, 1);
 
         public override void OnChainDownloadStarted(Peer peer, int blocksLeft)
         {
Index: NetworkConnection.cs
===================================================================
--- NetworkConnection.cs   (revision 60)
+++ NetworkConnection.cs   (working copy)
@@ -76,17 +76,22 @@
             _in = new NetworkStream(_socket, FileAccess.Read);
 
             // the version message never uses check-summing. Update check-summing property after version is read.
-            _serializer = new BitcoinSerializer(@params, false);
+            _serializer = new BitcoinSerializer(@params, true);  // SDL: Checksuming now ALWAYS necessary
 
             // Announce ourselves. This has to come first to connect to clients beyond v0.30.20.2 which wait to hear
             // from us until they send their version message back.
             WriteMessage(new VersionMessage(@params, bestHeight));
+            // SDL: Now read a versionack
+
             // When connecting, the remote peer sends us a version message with various bits of
             // useful data in it. We need to know the peer protocol version before we can talk to it.
+
             _versionMessage = (VersionMessage) ReadMessage();
+
             // Now it's our turn ...
             // Send an ACK message stating we accept the peers protocol version.
             WriteMessage(new VersionAck());
+
             // And get one back ...
             ReadMessage();
             // Switch to the new protocol version.
Index: Store/BoundedOverheadBlockStore.cs
===================================================================
--- Store/BoundedOverheadBlockStore.cs   (revision 60)
+++ Store/BoundedOverheadBlockStore.cs   (working copy)
@@ -214,7 +214,8 @@
             {
                 _channel.Dispose();
             }
-            _channel = file.OpenRead();
+            // SDL _channel = file.OpenRead();
+            _channel = file.Open(FileMode.Open, FileAccess.ReadWrite);
             try
             {
                 // Read a version byte.
legendary
Activity: 1261
Merit: 1000
May 30, 2012, 08:03:37 PM
#3
The only library I know is:
http://code.google.com/p/bitcoinsharp/

It hasn't been updated in 6 months but at least the parts I have used (key/address generation) have worked.

It is base off of the java library:
http://code.google.com/p/bitcoinj/

so structure, libraries, design should be similar.

.net developers are a rare breed in Bitcoin.  Hopefully that gets you started.




i know the bitcoinsharp, but it´s not working...

i will try in java...
donator
Activity: 1218
Merit: 1079
Gerald Davis
May 30, 2012, 07:52:38 PM
#2
The only library I know is:
http://code.google.com/p/bitcoinsharp/

It hasn't been updated in 6 months but at least the parts I have used (key/address generation) have worked.

It is base off of the java library:
http://code.google.com/p/bitcoinj/

so structure, libraries, design should be similar.

.net developers are a rare breed in Bitcoin.  Hopefully that gets you started.


legendary
Activity: 1261
Merit: 1000
May 30, 2012, 07:50:04 PM
#1
Dears

I need a c# code to work with bitcoin (send, receive, create wallet, address...) and a support do prepare the computer. Can you help me?

André
Jump to: