simpleledger / bitcoinfilesjs Goto Github PK
View Code? Open in Web Editor NEWJS Library for the Bitcoin Files Protocol
License: MIT License
JS Library for the Bitcoin Files Protocol
License: MIT License
Axios is not included as a dependency in the package.json, but is used in ./lib/bitdb.js
This is failing in a Webpack build downstream because Webpack will always try to require something like that
When uploading a file size greater than the OP_RETURN size, what happens? Do you have to input the chunk_count variable as 2?
It would be great to see an example of how the library is designed to handle this, including upload & download
The size of the bitcoinfilesjs pkg can be reduced significantly by allowing the consumer to inject their own version of BITBOX. Whether it be BITBOX-SDK, SLP-SDK, or a customized version. See bitbox-dep
branch.
Here are comments on the existing implementation of this on the bitbox-dep
branch:
Adrian Barwicki, [13.01.19 05:07]
Yeah, I implemented it.
Adrian Barwicki, [13.01.19 05:07]
This is exactly what I meant. In this way, I could inject my lightweight version of bitbox
Adrian Barwicki, [13.01.19 05:09]
One thing though - I import the source code, not the built version. What would help me a lot is static type checking to ensure that the methods and the methods’ interfaces are still the same. Otherwise, I’d have to have full test coverage which I don’t 🙂
Adrian Barwicki, [13.01.19 05:10]
The lib-files are classes anyway so if you converted the file names to TS without any other changes, I think it would work out of the box.
Adrian Barwicki, [13.01.19 05:10]
For the built, you could generate index.d.ts and then the built imports would have the types as well.
Adrian Barwicki, [13.01.19 05:11]
[ Photo ]
Adrian Barwicki, [13.01.19 05:11]
Also, is there a reason you want to have a Bitbox class and not the instance?
Adrian Barwicki, [13.01.19 05:12]
In this way, you take away the option to specify if they want to use the cloud api hosted by bitcoin.com or self-hosted one.
Adrian Barwicki, [13.01.19 05:13]
And I think you use one instance of Bitbox across the whole library, so it should be ok 🙂
Adrian Barwicki, [13.01.19 05:15]
Another feedback:
Adrian Barwicki, [13.01.19 05:15]
console.logs could be replaced with optional loggers maybe
James Cramer, [13.01.19 08:35]
[In reply to Adrian Barwicki]
Yes because switching networks (like to testnet) is handled in the constructor. Not sure if there is some network switching method.
James Cramer, [13.01.19 08:36]
[In reply to Adrian Barwicki]
Ok
Adrian Barwicki, [13.01.19 08:39]
[In reply to James Cramer]
Rest.bitcoin.com is open source and can be run locally. It’s not only about choosing mainnet vs testnet but also about specifying the restURL
James Cramer, [13.01.19 08:39]
Ah yes, that’s what I meant
Adrian Barwicki, [04.01.19 13:27]
@jscramer I created a simple repo depicting how to decompress the content fetched from the bitcoinfiles here: https://github.com/honest-cash/uncensorable-explorer/blob/master/index.html
James Cramer, [04.01.19 13:31]
[In reply to Adrian Barwicki]
Awesome, thanks for this! I’ll get it updated next week most likely, now trying to finish a Cashy thing
As defined in the BFP spec, type 2 file uploads represent data storage using p2sh scriptSig. Current network rules allow each input to contain up to 1650KB of data in scriptSig. With the 25 transaction chain network policy, we should be able to use this to get files uploaded that are larger than 30KB in size. This is also a more efficient way to store data, rather than using OP_RETURN space which is currently limited to 220 bytes.
I am facing the following issue on the download script.
/home/testbed/Downloads/btcash/download.js:14
if(result.passesHashCheck){
^
TypeError: Cannot read property 'passesHashCheck' of undefined
at Object. (/home/testbed/Downloads/btcash/download.js:14:11)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.