peercoin / peercoin-address-generator

A secure, minimal client-side Peercoin address generator.
https://paperwallet.peercoin.net/
BSD 3-Clause "New" or "Revised" License
8 stars 14 forks source link

replace peercoin lib with bitcore-lib #14

Open jointhepartypooper opened 5 years ago

jointhepartypooper commented 5 years ago

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

peerchemist commented 5 years ago

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

kazzkiq commented 5 years ago

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 commented 5 years ago

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

kazzkiq commented 5 years ago

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 commented 5 years ago

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

jointhepartypooper commented 5 years ago

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

jointhepartypooper commented 5 years ago

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 commented 5 years ago

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