Bitcoin Forum

Bitcoin => Armory => Topic started by: barwizi on November 18, 2013, 05:23:02 AM



Title: Armory Forks
Post by: barwizi on November 18, 2013, 05:23:02 AM
Hi all

I've enjoyed my experience with armory and want to know how to fork it for the alts i am interested in, if you have an idea of how to do it or a small guide, your assistance would be appreciated.


Title: Re: Armory Forks
Post by: goatpig on November 18, 2013, 07:32:02 PM
fork the git repo and code away o.o


Title: Re: Armory Forks
Post by: etotheipi on November 20, 2013, 06:05:44 PM
Hi barwizi,

I'm not sure exactly what will need to be done, because it's very dependent on the alt-chain you're developing for.  If it was something like Litecoin, you would change the header hash calculation.  Regardless of the alt-chain, you'll have to modify a bunch of the constants in the C++ and python code (magic bytes, address prefix bytes, port, genesis block).

Just some background on how the code is laid out:

Armory's primary goal was to implement as much as possible in python, because of the ease of implementation, error handling, corner cases, flexibility, etc.  However, python is dirt slow, so all the blockchain processing and crypto was implemented in C++, and pulled into the project through SWIG.  As such, the code is split into

C++ (in cppForSwig directory):  This where TheBDM is stored (The BlockDataManager).  It does all handling/scanning/tracking of 15 GB of blockchain, tracking of address balances, unspent output lists, transactions histories, ledger entries, zero-confirmation transactions, etc.  And it is where the crypto operations are executed (EncryptionUtils.h/.cpp).  All these things are accessed from python as if they're native python objects (thanks SWIG!).

Python (mostly just armoryengine.py):  Most everything else is in the python, with all the core in armoryengine.py.  ArmoryQt and qtdialogs is all GUI-related stuff, and may require only minimal updating.  Updating armoryengine.py is where most things would probably have to happen.  This is where the wallet format and operations are defined, interfaces to TheBDM, networking with Bitcoin-Qt (minimal), transaction processing, creation and verification, file formats, etc. 

Per my original statement, what will have to update the constants in the python code (https://github.com/etotheipi/BitcoinArmory/blob/testing/armoryengine.py#L337), and also pass those constants along to TheBDM (https://github.com/etotheipi/BitcoinArmory/blob/testing/armoryengine.py#L13009) so the C++ code is operating on the correct blockchain.

Armory is big and complex.  It will take some time to get into it and understand all the parts of it.  Sometimes I wonder how I'm able to keep track of all of it!