Bitcoin Forum
June 25, 2024, 11:34:57 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: C# Node  (Read 4663 times)
pmlyon (OP)
Member
**
Offline Offline

Activity: 72
Merit: 10


View Profile
July 21, 2013, 03:17:01 PM
 #41

Whatever you use, keep it to standards so that it remains portable.  I would be even tempted to use whatever database you do as a simple key, value store.  Assuming this remains a client tool and not some massive server undertaking you don't need any data level optimizations.  Without the need for data level optimizations you can keep it very portable as far as the back end.

I'm trying to keep my database layer as unintelligent as possible, the main thing I rely on the database for outside of key/value is finding holes in the data. You could write a simplified storage layer that didn't hold onto all historical data and didn't account for holes in the data and then wire that up to the blockchain calculator, if you wanted.

Author of BitSharp, a C# Bitcoin node
https://github.com/pmlyon/BitSharp/wiki
pmlyon (OP)
Member
**
Offline Offline

Activity: 72
Merit: 10


View Profile
July 21, 2013, 03:19:18 PM
 #42

I'm using SQLite for the database and BouncyCastle for the ECDsa verification and for SHA-256 and RIPEMD-160 I'm using the built-in .Net libaries.

The ECDsa verification is awful right now. It takes me 1/10th of a second just to verify a single signature, I have the verification disabled for the moment because of the speed. I haven't had any luck with OpenSSL yet to try it out.

I don't have much in the way of overall code documentation yet, I'll be working on that. Everything is put together just in broad strokes right now so that I have something usable to work with. There is a ton of design and clean-up to do. Smiley

Anyway, thanks for checking it out!

Have you looked at stuff like WAL?

I have, thanks. I reworked my SQLite storage provider a bit so that I have an application wide reader-writer lock on a single connection and I've enabled WAL as well. It seems to be performing much better now.

Author of BitSharp, a C# Bitcoin node
https://github.com/pmlyon/BitSharp/wiki
pmlyon (OP)
Member
**
Offline Offline

Activity: 72
Merit: 10


View Profile
July 21, 2013, 03:53:28 PM
 #43

I just found this horrible bug in my == method for 32-byte hashes. I guess it goes to show how unique these hashes really are that I only discovered this now. Smiley Note the || operator instead of &&.

        public static bool operator ==(UInt256 left, UInt256 right)
        {
            return left.part1 == right.part1 || left.part2 == right.part2 || left.part3 == right.part3 || left.part4 == right.part4;
        }

Author of BitSharp, a C# Bitcoin node
https://github.com/pmlyon/BitSharp/wiki
pmlyon (OP)
Member
**
Offline Offline

Activity: 72
Merit: 10


View Profile
July 24, 2013, 09:11:00 PM
 #44

I've done some work to split my block storage into headers and transactions, I'm able to download and chain the block headers separately from full blocks now. I'm also able to pull individual transactions out of the database, whereas before I was retrieving full blocks just to get one transaction. The initial syncing is working much faster now, I think I should eventually be able to download and sync the full blockchain within an hour, given a proper storage back-end. (not SQLite on a spinning disk Smiley)

I'm starting to feel pretty confident in the approach I've taken to my storage system and feeding it into the blockchain calculator. I have a lot of testing and documentation to catch up on now that I've proven that out. I also want to get a very basic lite storage system up and running at some point so I can make sure that I'm designing the blockchain calculator in a flexible enough manner to support it. I'll need to return some additional data so that a lite storage provider can determine what data it can remove, and I need to make sure I don't have any accidental dependencies on full historical storage in the calculator.

The way that I'm currently calculating the UTXO isn't actually correct so I need to get that taken care of. I'll need to properly implement BIP 30, for example. General correctness with regards to bitcoind I've left mostly off the table at this point anyway. That is going to be a huge undertaking that will require significant testing, so I don't want to be approaching that piecemeal. Correctness should ideally be isolated to the blockchain calculator and the scripting projects. The scripting project is essentially unimplemented at this point, I've just done the bare minimum to get me up to about block 158,000.

That's where things stand today, for any of you following along. Smiley

Paul

Author of BitSharp, a C# Bitcoin node
https://github.com/pmlyon/BitSharp/wiki
pmlyon (OP)
Member
**
Offline Offline

Activity: 72
Merit: 10


View Profile
July 26, 2013, 02:28:19 PM
 #45

This weekend I'd like to start getting the blocktester (https://github.com/TheBlueMatt/test-scripts/) setup for when I start implementing things exactly. Does anyone have any experience integrating with this tool?

Author of BitSharp, a C# Bitcoin node
https://github.com/pmlyon/BitSharp/wiki
ThePok
Full Member
***
Offline Offline

Activity: 131
Merit: 100


View Profile
September 12, 2013, 09:37:57 PM
 #46

Hi!

Do you still work on this?
pmlyon (OP)
Member
**
Offline Offline

Activity: 72
Merit: 10


View Profile
September 12, 2013, 11:23:47 PM
 #47

Hey, work is definitely still ongoing. There haven't been any source code updates for a few weeks... I've had two other developers join the project, which I'm super excited about! Smiley

We're all currently busy getting caught up with each other before making any more updates. Going forward we'll have much more up front design work and documentation; the current source code is a prototype.

I'm planning on posting an update to the site over the weekend. Thanks for checking in!

Paul

Author of BitSharp, a C# Bitcoin node
https://github.com/pmlyon/BitSharp/wiki
Pages: « 1 2 [3]  All
  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!