Pages:
Author

Topic: C# Node (Read 4688 times)

member
Activity: 72
Merit: 10
September 12, 2013, 07: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
full member
Activity: 131
Merit: 100
September 12, 2013, 05:37:57 PM
#46
Hi!

Do you still work on this?
member
Activity: 72
Merit: 10
July 26, 2013, 10:28:19 AM
#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?
member
Activity: 72
Merit: 10
July 24, 2013, 05: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
member
Activity: 72
Merit: 10
July 21, 2013, 11:53:28 AM
#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;
        }
member
Activity: 72
Merit: 10
July 21, 2013, 11:19:18 AM
#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.
member
Activity: 72
Merit: 10
July 21, 2013, 11:17:01 AM
#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.
full member
Activity: 163
Merit: 100
July 21, 2013, 10:19:23 AM
#40
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?
newbie
Activity: 5
Merit: 0
July 21, 2013, 09:32:10 AM
#39
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.
member
Activity: 72
Merit: 10
July 20, 2013, 02:00:02 PM
#38
Well currently our company (Tangible Cryptography) services are halted as we dance with the state but we ran the site fastcash4bitcoins.com The bitcoind interface was used to track customer deposits and update a SQL database.  All high level functions are between the application and the RDBMS.  A service polls bitcoind periodically and updated the database with low level transaction data.

Thanks for the info. Sorry to hear about your troubles with the government, that sucks. Any light at the end of the tunnel?

I took a look at dotCover and I'm able to generate a test coverage report with the trial version of that. They have an open source license but I don't meet the standards yet, it's for more established projects. I'll see about applying for that eventually and I can use the trial version in the meantime.
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 19, 2013, 11:44:27 AM
#37
If you find nothing else our company has additional visual studio enterprise licenses which are not being used.  I imagine we could work something out (i.e. if necessary hire you as a contractor for 1 bitcent per year for the sole purpose of developing c# open source code to the public domain or under copyleft license, renewable annually).  I need to speak to counsel about it but if interested send me a PM. 

No ulterior motive here.  The public codebase for Bitcoin + .NET has been pretty much been non-existent.  C# is my preferred language so everything I have written has needed to be custom built (use a modified headless version of bitcoind running as a windows service with all interaction through a c# to JSON/RPC wrapper.    It would be useful to get a solid managed code library going (stop reinventing the wheel) if I can support that with a license it works for me.

Thanks for the offer! I'll let you know what I find out with my own company, no ulterior motive suspected. Wink

I had started this project as a learning exercise to understand the Bitcoin tech better, but now I think that I've made enough progress to turn it into a real library. Wrapping it up in a proper Windows service and enabling RPC (presumably JSON) are definitely on my TODO list.

What kind of things are you currently using bitcoind for?  Understanding some use cases would really help me flesh things out. All of the current code represents prototyping, not a fully thought-out design.

Well currently our company (Tangible Cryptography) services are halted as we dance with the state but we ran the site fastcash4bitcoins.com The bitcoind interface was used to track customer deposits and update a SQL database.  All high level functions are between the application and the RDBMS.  A service polls bitcoind periodically and updated the database with low level transaction data.
member
Activity: 72
Merit: 10
July 19, 2013, 11:28:34 AM
#36
If you find nothing else our company has additional visual studio enterprise licenses which are not being used.  I imagine we could work something out (i.e. if necessary hire you as a contractor for 1 bitcent per year for the sole purpose of developing c# open source code to the public domain or under copyleft license, renewable annually).  I need to speak to counsel about it but if interested send me a PM. 

No ulterior motive here.  The public codebase for Bitcoin + .NET has been pretty much been non-existent.  C# is my preferred language so everything I have written has needed to be custom built (use a modified headless version of bitcoind running as a windows service with all interaction through a c# to JSON/RPC wrapper.    It would be useful to get a solid managed code library going (stop reinventing the wheel) if I can support that with a license it works for me.

Thanks for the offer! I'll let you know what I find out with my own company, no ulterior motive suspected. Wink

I had started this project as a learning exercise to understand the Bitcoin tech better, but now I think that I've made enough progress to turn it into a real library. Wrapping it up in a proper Windows service and enabling RPC (presumably JSON) are definitely on my TODO list.

What kind of things are you currently using bitcoind for?  Understanding some use cases would really help me flesh things out. All of the current code represents prototyping, not a fully thought-out design.
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 19, 2013, 11:16:21 AM
#35
Thought about the blockchain size issue again and thought if this is for sure on windows you may want to look at the built in ISAM database in windows known as the Extensible Storage System.  This is the engine behind Active Directory and Exchange Server and provides ACID data storage for up to terabytes and it comes with Windows.

More info here:
http://msdn.microsoft.com/en-us/library/gg269259(v=exchg.10).aspx

And since this is a system API using a non-managed .DLL here is a codeplex project wrapping the .dll in a managed code wrapper.
http://managedesent.codeplex.com/documentation


That looks very interesting, particularly the PersistentDictionary, thanks!

Yeah very nice set of capabilities.  The fact that it is "built into windows" and requires no installation makes it useful for rapid deployment at least in windows environment.   With a data store abstraction layer a variety of storage systems could be supported.  ESENT could just be the default (providing no install instant availability for windows users).

Performance even on random lookups seems to be exceptional.  The bad news is that it looks like only certain datatypes can be used for keys.  Would be nice to store blocks with blockhash in binary (256 bit BigInteger) as the key.  Not sure if this is a limit of ESENT or just the current implementation of the managed code wrapper).  Still if performance using a hexadecimal string representation of that block hash has good enough performance it many be a non-issue.

One thing that may be worth considering is use ESENT for storing the blockchain and then use something like SQL Server (w/ Express for users without installed RDBMS) to store: wallet data (keypairs, tx history, user metadata), the UXTO, and a smaller table of just block headers.  The UXTO is less than 250MB, block headers since genesis block are about 15MB and most wallets are under a couple MB.  We have one massive (8,000+ keys, 20,000 txs) wallet and it is only 40MB.  All that should fit fine within the constraints of Express.

I am making a project to dump the blockchain into ESENT and benchmark performance (sequential inserts, random reads).

member
Activity: 72
Merit: 10
July 19, 2013, 10:37:26 AM
#34
Thought about the blockchain size issue again and thought if this is for sure on windows you may want to look at the built in ISAM database in windows known as the Extensible Storage System.  This is the engine behind Active Directory and Exchange Server and provides ACID data storage for up to terabytes and it comes with Windows.

More info here:
http://msdn.microsoft.com/en-us/library/gg269259(v=exchg.10).aspx

And since this is a system API using a non-managed .DLL here is a codeplex project wrapping the .dll in a managed code wrapper.
http://managedesent.codeplex.com/documentation


That looks very interesting, particularly the PersistentDictionary, thanks!
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 19, 2013, 10:33:26 AM
#33
I'd like to integrate code coverage results into the unit tests, but Visual Studio Express doesn't support generating code coverage results. Any recommendations out there on a good, free tool that I could use?

You aren't by any chance a student are you?

Unfortunately no. I may see about using my work computer to run unit tests with the full version of Visual Studio, I just want to be careful about keeping this segregated from my work where I want everything released in the public domain.

If you find nothing else our company has additional visual studio enterprise licenses which are not being used.  I imagine we could work something out (i.e. if necessary hire you as a contractor for 1 bitcent per year for the sole purpose of developing c# open source code to the public domain or under copyleft license, renewable annually).  I need to speak to counsel about it but if interested send me a PM. 

No ulterior motive here.  The public codebase for Bitcoin + .NET has been pretty much been non-existent.  C# is my preferred language so everything I have written has needed to be custom built (use a modified headless version of bitcoind running as a windows service with all interaction through a c# to JSON/RPC wrapper.    It would be useful to get a solid managed code library going (stop reinventing the wheel) if I can support that with a license it works for me.
newbie
Activity: 5
Merit: 0
July 19, 2013, 10:27:31 AM
#32
Any recommendations out there on a good, free tool that I could use?

Haven't used it myself but this appears promising: https://github.com/sawilde/opencover
member
Activity: 72
Merit: 10
July 19, 2013, 10:07:35 AM
#31
I'd like to integrate code coverage results into the unit tests, but Visual Studio Express doesn't support generating code coverage results. Any recommendations out there on a good, free tool that I could use?

You aren't by any chance a student are you?

Unfortunately no. I may see about using my work computer to run unit tests with the full version of Visual Studio, I just want to be careful about keeping this segregated from my work where I want everything released in the public domain.
donator
Activity: 1218
Merit: 1079
Gerald Davis
July 19, 2013, 09:57:31 AM
#30
I'd like to integrate code coverage results into the unit tests, but Visual Studio Express doesn't support generating code coverage results. Any recommendations out there on a good, free tool that I could use?

You aren't by any chance a student are you?
member
Activity: 72
Merit: 10
July 19, 2013, 09:42:11 AM
#29
I'd like to integrate code coverage results into the unit tests, but Visual Studio Express doesn't support generating code coverage results. Any recommendations out there on a good, free tool that I could use?
member
Activity: 72
Merit: 10
July 18, 2013, 10:25:11 PM
#28
Blockchain size is not finished growing and it's pretty large to be storing in a relational data store.  I'd be tempted to just store it in the file system.  Most people are running a logging file system these days so making a backup when doing any work might be sufficient.

For a standard node you are right there likely is very little use to store the full blocks in a database.  For efficiency full nodes generally just validate the block, store the header, and use the block to update the UXTO. In essence using full blocks just to build the UXTO.  Full nodes normally never need the historical blockchain except to build the UXTO in a trustless manner.  For most nodes a flat file is more than sufficient and this why the reference client does just that.

However I think it IS useful as a development platform to parse and store the blockchain in a database.  This is useful to building higher level tools for analysis.  I imagine that is how sites like blockexplorer and blockchain.info work.  

That's definitely the direction I'm coming at things from, although in the future I'd like to support lower trust levels as well.

Tonight I wired up the build to generate documentation, which I've placed on the wiki: http://pmlyon.github.io/BitSharp/apidocs/Index.html. There's no actual documentation yet, but now that it's integrated into the build I can work away at it.
Pages:
Jump to: