Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make params JSON-friendly? #13

Open
paulkernfeld opened this issue Apr 5, 2016 · 5 comments
Open

Make params JSON-friendly? #13

paulkernfeld opened this issue Apr 5, 2016 · 5 comments

Comments

@paulkernfeld
Copy link

The params object is almost JSON-friendly, except that it takes in buffers for prevHash and merkleRoot. What if it accepted hex strings instead of, or in addition to buffers? That would be cool for me especially, because it would make it easy to load configuration from files. For example, see the "Setup" section here.

@mappum
Copy link
Owner

mappum commented Apr 5, 2016

That's a good point, I can do this if it makes things easier. But how would it work if you need to override functions? For example, see the webcoin-bitcoin-testnet params, which provide their own difficulty calculation code.

I've been writing the param code with the assumption that the params would be in their own module, including blockchain, network, and wallet params.

@paulkernfeld
Copy link
Author

The assumption that I'm making is that people may want to frequently add checkpoints for existing blockchains without changing the logic of the blockchain. I certainly find myself wanting to do that, although I don't know whether that will become a common use case. For me, this would be possibly convenient but not important. Also, I'm happy to implement it if you think it's a good idea.

@mappum
Copy link
Owner

mappum commented Apr 5, 2016

You're probably right about that, and I think the best way to do that would be to remove the checkpoints from the params and have them passed in as options to the Blockchain constructor. What do you think?

@paulkernfeld
Copy link
Author

For my use case, I think that would be nice. However, there is definitely a complexity cost to breaking the configuration into more pieces, so you would understand that tradeoff better.

@mappum
Copy link
Owner

mappum commented May 12, 2016

The question for this is: who should manage the checkpoints? I.e. should they be provided by the webcoin project in parameters, and overridden by developers when necessary, or should the default be to not use any checkpoints and have developers opt-in to them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants