This system allows you to write large arbitrary data files into the bitcoin.sv production or testnet ledgers. You will need to be running your own version of Satoshi Vision. To build this, I used:
https://github.com/bitcoin-sv/bitcoin-sv
I built on a Digital Oceans Droplet using the latest version of Ubuntu.
In order to keep older block files (and thus the entire ledger), I added s3fs buckets and accessed those blk??????.dat files via a symbolic link.
The API must be running and accessible on port 8332 (1882 for testnet). The auth.php and bitcoind.conf files must be seeded with a secure key generated by running the rpcauth.py script.
I will try to get this into a docker image so that it is easier to test out.
How to use:
From the index.php page, you should be able to upload a file from your computer. It will load it into staging and send it on its way with no further questions. There is also a test file ready to go in the staging directory which you can call directly with the create.php command. You will likely need to make some tweaks. For example, I hard-coded my addresses into the code. If you get far enough to deal with that, then it shouldn't be an issue for you. You can also tweak the php and call create.php from the command line for larger files.
You probably know this, but you will need to add your own bsv production and testnet money.
I accept pull requests.
Why is this necessary?
This bit of code falls outside of the normal javascript stuff that is usually used for crypto transactions. The last time I checked the BSV forums, there wasn't an easy way to load data into the bitcom-b format. What this code does is walk through the steps:
createrawtransaction fundrawtransaction signrawtransation sendrawtransaction
I have a general ledger_query function with somewhat odd parameters (it requires may commands to be surrounded with an escaped double-quote).
his is the general format of a bitcom-b message. Part two is always the bitcoin address: 19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut Part three can be massively large and parts 4-6 describe the file's type and name. ( [0] => 0 [1] => OP_RETURN [2] => 31394878696756345179427633744870515663554551797131707a5a56646f417574 [3] => --- potentially long data field removed --- [4] => 696d6167652f706e67 [5] => 62696e617279 [6] => 736d696c65792e706e67 )
Here is a result of pushing out the test file.
https://test.whatsonchain.com/tx/8b3fcd90a484d48a05417c4e2d56bbaa6bc76075122bc49f18a643a332979756