andrehorta (OP)
Legendary
Offline
Activity: 1261
Merit: 1000
|
|
May 31, 2012, 12:50:04 AM |
|
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é
|
|
|
|
DeathAndTaxes
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
|
May 31, 2012, 12:52:38 AM |
|
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.
|
|
|
|
andrehorta (OP)
Legendary
Offline
Activity: 1261
Merit: 1000
|
|
May 31, 2012, 01:03:37 AM |
|
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...
|
|
|
|
Sergio_Demian_Lerner
|
|
May 31, 2012, 05:36:52 PM |
|
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.
|
|
|
|
andrehorta (OP)
Legendary
Offline
Activity: 1261
Merit: 1000
|
|
May 31, 2012, 11:13:29 PM |
|
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.
|
|
|
|
Kris
Donator
Hero Member
Offline
Activity: 640
Merit: 500
|
|
June 01, 2012, 11:46:02 AM |
|
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
|
|
|
|
DeathAndTaxes
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
|
June 01, 2012, 12:25:22 PM |
|
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.
|
|
|
|
Sergio_Demian_Lerner
|
|
June 01, 2012, 01:20:10 PM |
|
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.
|
|
|
|
Kris
Donator
Hero Member
Offline
Activity: 640
Merit: 500
|
|
June 01, 2012, 08:27:35 PM |
|
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.
|
|
|
|
andrehorta (OP)
Legendary
Offline
Activity: 1261
Merit: 1000
|
|
June 02, 2012, 12:49:18 AM |
|
Anyone can send me the visual studio solution?
|
|
|
|
Kris
Donator
Hero Member
Offline
Activity: 640
Merit: 500
|
|
June 02, 2012, 01:03:29 AM |
|
If you can wait until Sunday, I can make it for you.
|
|
|
|
andrehorta (OP)
Legendary
Offline
Activity: 1261
Merit: 1000
|
|
June 02, 2012, 01:39:46 AM |
|
If you can wait until Sunday, I can make it for you.
Cool! thank you. I´ll wait.
|
|
|
|
Vandroiy
Legendary
Offline
Activity: 1036
Merit: 1002
|
|
June 02, 2012, 01:28:58 PM |
|
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.
|
|
|
|
Kitemike
|
|
June 04, 2012, 12:07:25 PM |
|
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
|
|
|
|
andrehorta (OP)
Legendary
Offline
Activity: 1261
Merit: 1000
|
|
June 04, 2012, 12:11:24 PM |
|
I´m still whaiting for the projet in c#.net!
Tnks
|
|
|
|
DeathAndTaxes
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
|
June 04, 2012, 12:40:48 PM |
|
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 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.
|
|
|
|
|