Skip to content

bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin, add nixos module#1375

Merged
offlinehacker merged 1 commit intoNixOS:masterfrom
xtruder:pkgs/bitcoin/altcoin_support
Aug 27, 2014
Merged

bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin, add nixos module#1375
offlinehacker merged 1 commit intoNixOS:masterfrom
xtruder:pkgs/bitcoin/altcoin_support

Conversation

@offlinehacker
Copy link
Copy Markdown
Contributor

No description provided.

@domenkozar
Copy link
Copy Markdown
Member

Maybe we should split those into separate packages, or is there a reason to keep them in the same file?

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Well, there's almost no difference betwene these packages(they are just
mutations of satoshi bitcoin implementation), they use the same builder
function and there can optionally be added other altcoins. So i think it's
quite right to keep them in bitcoin.
On Dec 13, 2013 11:48 AM, "Domen Kožar" notifications@github.com wrote:

Maybe we should split those into separate packages, or is there a reason
to keep them in the same file?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-30500878
.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Btw namecoin does not build yet, but that's not that important.
On Dec 13, 2013 11:54 AM, "Jaka Hudoklin" jakahudoklin@gmail.com wrote:

Well, there's almost no difference betwene these packages(they are just
mutations of satoshi bitcoin implementation), they use the same builder
function and there can optionally be added other altcoins. So i think it's
quite right to keep them in bitcoin.
On Dec 13, 2013 11:48 AM, "Domen Kožar" notifications@github.com wrote:

Maybe we should split those into separate packages, or is there a reason
to keep them in the same file?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-30500878
.

@the-kenny
Copy link
Copy Markdown
Contributor

Maybe it's a good idea to leave bitcoin in default.nix and create litecoin.nix etc.

Also, there's still some unnecessary duplication in the code for headless & non-headless builds

@offlinehacker
Copy link
Copy Markdown
Contributor Author

I will think about that.
On Dec 14, 2013 2:07 AM, "Moritz Ulrich" notifications@github.com wrote:

Maybe it's a good idea to leave bitcoin in default.nix and create
litecoin.nix etc.

Also, there's still some unnecessary duplication in the code for headless
& non-headless builds


Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-30555957
.

@ghost ghost assigned nbp Jan 12, 2014
@falsifian
Copy link
Copy Markdown
Contributor

Thanks for getting this started. namecoin wouldn't compile; I fixed it in falsifian/nixpkgs@90a6c3c , so please consider adding that to the pull request. (I only compiled it; I didn't try running it.)

I started to implement @the-kenny's suggestion about putting litecoin in litecoin.nix etc, but it quickly got ugly, because I wanted to pass a lot of arguments to many import commands. Maybe there is a nice way that I do not know about.

Why not follow @offlinehacker's method for now, and if a particular altcoin diverges too much from bitcoin, just give it a fresh file that doesn't reference the main one? The expressions are simple enough.

@falsifian
Copy link
Copy Markdown
Contributor

BTW, it would be nice if the headless and GUI versions had different package names, to make it easier to choose one with nix-env -i.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Well yes, if somebody wants to add a lot of altcoins it gets ugly. I
thought about chromium approach where you manly switch sources, but it
turns out that you quickly find coins where you need to override some
phase. I could do similar as ruby does(having overrides file), but still, i
don't see a big improvement. Btw, thanks for namecoin ;)
On Jan 23, 2014 8:35 AM, "James Cook" notifications@github.com wrote:

BTW, it would be nice if the headless and GUI versions had different
package names, to make it easier to choose one with nix-env -i.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-33102836
.

@falsifian
Copy link
Copy Markdown
Contributor

I'm not familiar with how Ruby does it, but the generic python builder in development/python-modules/generic could be a model (hopefully much much simpler in this case).

So I guess the two leading options are to do something like Ruby or Python, or to just let there be some duplicated code?

@falsifian
Copy link
Copy Markdown
Contributor

I added peercoin; see falsifian/nixpkgs@b939017 . It works as far as I can tell, though I haven't sent or received any.

@offlinehacker offlinehacker mentioned this pull request Jan 26, 2014
@offlinehacker
Copy link
Copy Markdown
Contributor Author

@the-kenny @falsifian Any idea how to remove unnecessary duplication in the code for headless & non-headless builds?

@falsifian
Copy link
Copy Markdown
Contributor

How about having a configuration variable "bitcoin.gui"? Then configurePhase could be (if gui then "qmake" else ""), and so on. I can take a look at it if you like, but maybe not today.

A side note: don't both versions build bitcoind? I think bitcoind should be installed even when you choose the gui version.

@falsifian
Copy link
Copy Markdown
Contributor

Er, I guess instead of configuration var I meant "option", in the same style as git.guiSupport.

@falsifian
Copy link
Copy Markdown
Contributor

Okay, I did some re-organization. See my pkgs/bitcoin/altcoin_support branch at https://github.com/falsifian/nixpkgs/tree/pkgs/bitcoin/altcoin_support

For example, nix-build -A bitcoin.headless or nix-build -A bitcoin.gui.

I haven't really tested anything except very briefly ppcoin.headless.

Here's what I did:

I made a file called build_bitcoin.nix that contains the generic code for building both a headless and a gui version. I tried to avoid duplicating code, but to be honest I'd rather go back to having two separate expressions (headless and gui) like offlinehacker's original commit, since the build instructions seem to be completely different.

I noticed that building the gui doesn't cause the headless version to be build, so I opted to make *coin.headless options -- instead, the bitcoin builder expression produces two separate derivations. See my example nix-build commands above.

@falsifian
Copy link
Copy Markdown
Contributor

Each coin is now in a separate .nix file.

@falsifian
Copy link
Copy Markdown
Contributor

And I just successfully ran ppcoin-qt (built with nix-build -A ppcoin.gui) so it's reasonably possible that everything just works at this point.

PkmX referenced this pull request in falsifian/nixpkgs Feb 8, 2014
Each cryptocurrency in a separate file, and less duplication of code
between the headless and gui expressions.
@falsifian
Copy link
Copy Markdown
Contributor

@offlinehacker , do you like my re-organization? If so, please merge my branch (same name as your branch; repo is git@github.com:falsifian/nixpkgs.git ) or I can just open a new pull request if it's simpler.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

I like the way how you merge headless and non-headles, but i don't like
that now all coins are in all-packages. If somebody would want to add a lot
bunch of coins that exist all-packages would become bloated with coins,
besides that it's ok and i don't really care if you use multiple files or
not, i would have just one single file, because this way it is more compact.
On Feb 10, 2014 12:45 AM, "James Cook" notifications@github.com wrote:

@offlinehacker https://github.com/offlinehacker , do you like my
re-organization? If so, please merge my branch (same name as your branch;
repo is git@github.com:falsifian/nixpkgs.git ) or I can just open a new
pull request if it's simpler.

Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-34591676
.

@PkmX
Copy link
Copy Markdown
Contributor

PkmX commented Feb 11, 2014

@offlinehacker I don't really think that would be a huge problem as long as they don't conflict with other packages, and there are really only a few crypto-currencies that actually has user bases of decent sizes (bitcoin, litecoin, namecoin, peercoin and well, dogecoin) now.

@falsifian
Copy link
Copy Markdown
Contributor

@offlinehacker, I'd personally prefer to keep build_bitcoin separate (give it its own file and list it in all-packages.nix) but besides that I'm indifferent on both issues.

My reason: if build_bitcoin is not separated, it might be hard to separate it in the future. So if people start adding lots of altcoins (not that unlikely) it will be hard to untangle the mess in the future.

By the way, I noticed freicoin is already merged to master. Let's get this moving :-)

@offlinehacker
Copy link
Copy Markdown
Contributor Author

I don't really see the problem, look in python-packages.nix, or in
all-pacages.nix, they are quite managable and they have a lot of stuff in
them.
On Feb 11, 2014 2:14 AM, "James Cook" notifications@github.com wrote:

@offlinehacker https://github.com/offlinehacker, I'd personally prefer
to keep build_bitcoin separate (give it its own file and list it in
all-packages.nix) but besides that I'm indifferent on both issues.

My reason: if build_bitcoin is not separated, it might be hard to separate
it in the future. So if people start adding lots of altcoins (not that
unlikely) it will be hard to untangle the mess in the future.

By the way, I noticed freicoin is already merged to master. Let's get this
moving :-)

Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-34717337
.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

You can of course keep builder function in separate file, but i think coins
need to be in one file and not in all-packages.nix
On Feb 11, 2014 4:11 AM, "Jaka Hudoklin" jakahudoklin@gmail.com wrote:

I don't really see the problem, look in python-packages.nix, or in
all-pacages.nix, they are quite managable and they have a lot of stuff in
them.
On Feb 11, 2014 2:14 AM, "James Cook" notifications@github.com wrote:

@offlinehacker https://github.com/offlinehacker, I'd personally prefer
to keep build_bitcoin separate (give it its own file and list it in
all-packages.nix) but besides that I'm indifferent on both issues.

My reason: if build_bitcoin is not separated, it might be hard to
separate it in the future. So if people start adding lots of altcoins (not
that unlikely) it will be hard to untangle the mess in the future.

By the way, I noticed freicoin is already merged to master. Let's get
this moving :-)

Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-34717337
.

@falsifian
Copy link
Copy Markdown
Contributor

Good point; it does seem to work well in existing cases. Now I am not so attached to separate files.

I put all the coins in one file and removed all the individual coins except bitcoin from all-packages.nix. I also renamed the directory to bitcoin_etc. Maybe a better name is possible.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Humm one idea would be to have cryptocurrencies folder and put there all
crypto currencies releated stuff. So we would have bitcoin.nix where only
bitcoin builder would be in default.nix you would have all currencies. Then
when you woud want to package ethereum, you would only add ethereum.nix
file and put it into default.nix that would be it.

On Tue, Feb 11, 2014 at 5:58 AM, James Cook notifications@github.comwrote:

Good point; it does seem to work well in existing cases. Now I am not so
attached to separate files.

I put all the coins in one file and removed all the individual coins
except bitcoin from all-packages.nix. I also renamed the directory to
bitcoin_etc. Maybe a better name is possible.

Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-34726587
.

@falsifian
Copy link
Copy Markdown
Contributor

I'm happy with pretty much anything. Not sure when I'll have time to work on it though, so feel free to fiddle with it, with or without merging my changes.

BTW I don't have any sort of power to merge pull requests.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Yeah i don't have merging-power too, will take your changes and try to make the sane version of all ideas we discussed.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

I also have nixos module(with support for multiple coins running at the same time) ready to push after this gets merged.

@falsifian
Copy link
Copy Markdown
Contributor

Thanks!

@domenkozar
Copy link
Copy Markdown
Member

@falsifian @offlinehacker this is ready to be reviewed?

@offlinehacker
Copy link
Copy Markdown
Contributor Author

@iElectric, not yet, still waiting somewhere in low priority queue, will
let you know, when it's ready
On Mar 7, 2014 12:44 PM, "Domen Kožar" notifications@github.com wrote:

@falsifian https://github.com/falsifian @offlinehackerhttps://github.com/offlinehackerthis is ready to be reviewed?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-37017144
.

@shlevy
Copy link
Copy Markdown
Member

shlevy commented Apr 5, 2014

@offlinehacker Still in your queue?

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Yep :) also working on cryptocoin2nix that would auto generate packages for
x most popular coins :P
On Apr 5, 2014 7:26 PM, "Shea Levy" notifications@github.com wrote:

@offlinehacker https://github.com/offlinehacker Still in your queue?

Reply to this email directly or view it on GitHubhttps://github.com//pull/1375#issuecomment-39644921
.

@shlevy shlevy unassigned nbp Apr 5, 2014
@garbas
Copy link
Copy Markdown
Member

garbas commented Apr 19, 2014

@offlinehacker i see multiple things you've changed here. if you can, can you split this pull request in multiple? if you dont have time i'll cherry pick into master. but i would need at least that your branch is rebased on current master.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Ah yes, i forgot to remove a few commits, it should be fine now :)

@offlinehacker
Copy link
Copy Markdown
Contributor Author

I think this could be merged now :)

@offlinehacker offlinehacker changed the title bitcoin: add support for altcoins, add litecoin and namecoin bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin May 5, 2014
@offlinehacker offlinehacker changed the title bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin, add nixos module May 5, 2014
@offlinehacker
Copy link
Copy Markdown
Contributor Author

Ahh dammn, after trying to update to latest version i just realized installation process of bitcoin changed, so now we have incossistency, i will just split into multiple files as was originally suggested and stop complicating.

@chaoflow
Copy link
Copy Markdown
Member

@offlinehacker - Can we close this pull request then? Thanks for your work on *coin!

@lucabrunox
Copy link
Copy Markdown
Contributor

+1 for having a cryptocurrency folder, both for packages and for services.

@offlinehacker
Copy link
Copy Markdown
Contributor Author

Okay i added support for building new version of bitcoin packages, this should be ready for merging.

@offlinehacker offlinehacker force-pushed the pkgs/bitcoin/altcoin_support branch from 3a18ac5 to 212d91a Compare August 27, 2014 10:08
@offlinehacker
Copy link
Copy Markdown
Contributor Author

I've fixed this. Now bitcoin is separate expression and altcoins are separate expression, i have removed nixos module, it builds fine, i'm merging.

offlinehacker added a commit that referenced this pull request Aug 27, 2014
bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin
@offlinehacker offlinehacker merged commit 39df234 into NixOS:master Aug 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: enhancement Add something new or improve an existing system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants