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

replace peercoin lib with bitcore-lib #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

replace peercoin lib with bitcore-lib #14

wants to merge 5 commits into from

Conversation

jointhepartypooper
Copy link

usage of bitcore-lib as seen in peerscript-labs.
I think it is better to use bitcore-lib as is seen in peerscript-labs project, so I replaced it.
please review and merge

jointhepartypooper added 2 commits January 26, 2019 17:55
usage of bitcore-lib as seen in peerscript-labs
@peerchemist
Copy link
Member

This is much better solution, much more maintainable. Not sure why it was not done like this from day one.

@kazzkiq
Copy link
Member

kazzkiq commented Jan 27, 2019

I'm getting this error when running locally:

TypeError: Buffer.alloc is not a function

Buffer is not available in browsers. Only in Node. Did you added any polyfill?

Also, the reason why I manually added peercoin lib instead of using other solutions is to make sure the project would stay small. Most libs are made with back-end as target, which means there is no effort to make them light. Most have way too much "bloatware" and helper functions we wouldn't need in order to generate a wallet.

But I'm open to testing the size difference from your implementation, if it's not too much, we can adopt it.

@jointhepartypooper
Copy link
Author

your node version is ancient:
https://stackoverflow.com/questions/36499840/typeerror-buffer-alloc-is-not-a-function
probably your node should be upgraded to 10
I actually made https://jointhepartypooper.github.io/Pay-to-TagHash--P2TH--calculator/ before adjusting this project and it works just fine

also cherrypicked what is needed from library. Not sure is treeshaking works with this (if supported at all)
@kazzkiq
Copy link
Member

kazzkiq commented Jan 27, 2019

Nah, my node is ok.

The error happened in the browser, not while building. Buffer as API exists only in Node, not in browsers. Can you please run npm start and check if everything is working as expected locally?

screen shot 2019-01-27 at 20 27 44

@jointhepartypooper
Copy link
Author

thx I can see it now in chrome browser. I was using Brave...

@jointhepartypooper
Copy link
Author

I ll rewrite this with http://cryptocoinjs.com/modules/currency/coininfo/ then this weekend as it supports ppc I see...

@jointhepartypooper
Copy link
Author

You know what: this project needs webpack. Without it, options are very limited as the usage of Buffer is everywhere. I can try to reduce the code in Peercoin lib as much as possible.

@kazzkiq
Copy link
Member

kazzkiq commented Jan 31, 2019

Updating the bundler is a must, indeed. You should give your 2 cents on #15 later.

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

Successfully merging this pull request may close these issues.

3 participants