unwriter / datapay Goto Github PK
View Code? Open in Web Editor NEWBuild and broadcast data transactions to the Bitcoin SV blockchain
Build and broadcast data transactions to the Bitcoin SV blockchain
i'm not able to start datapay app and also there is no instruction given to run the script.
please specify which setting needed ?
Hi I am new to using this library. Managed to figure things out from youtube tutorials, but wanted to add what I thought was missing from the current documentation:
https://github.com/unwriter/datapay/blob/master/README.md#a-sending-from-data-and-pay
The code example under A. Sending from data and pay, currently is this:
const tx = {
safe: true,
data: ["0x6d02", "hello world"])
pay: { key: "5JZ4RXH4MoXpaUQMcJHo8DxhZtkf5U5VnYd9zZH8BRKZuAbxZEw" }
}
datapay.send(tx, function(err, res) {
console.log(res)
})
It's missing some commas and unnecessary parenthesis.
It should be this:
const tx = {
safe: true,
data: ["0x6d02", "hello world"],
pay: { key: "5JZ4RXH4MoXpaUQMcJHo8DxhZtkf5U5VnYd9zZH8BRKZuAbxZEw" }
}
datapay.send(tx, function(err, res) {
console.log(res)
})
By default datapay uses all UTXOs when building a TX. When using datapay to send multiple large data transactions, users will very quickly hit either the 25 chained mempool tx limit or the 100k mempool bytes limit.
I have recently solved this problem in libitx/preserve-cli@e6598ec4 and the approach I used there comes in two parts:
Datapay already has a filter
option but unfortunately the bsv.Transaction.UnspentOutput
objects from getUnspentUtxos
don't provide very useful properties with which to filter by. For example, it's not possible to filter by confirmations.
I think bitcore-explorers
will need to be replaced with a built-in bitindex client so the raw response from bitindex (which does include a confirmations
property) can be sorted/filtered. This isn't a terribly hard thing to do, but it's going to break existing APIs (datapay.connect()
) so I didn't just went to fire over a PR.
Opening this issue to discuss options.
I start a Full Node Bitcoin, in the testnet, but when i use my node in testnet, i recive, only errors!!!
in this moment api.bitindex.network don't respond, have another option for replace api.bitindex.network
If I use default pay.rpc for datapay.send, the rpc fails with error
PayloadTooLargeError: request entity too large at readStream (/home/bchsv/prod-2/node_modules/raw-body/index.js:155:17) at getRawBody (/home/bchsv/prod-2/node_modules/raw-body/index.js:108:12) at read (/home/bchsv/prod-2/node_modules/body-parser/lib/read.js:77:3) at jsonParser (/home/bchsv/prod-2/node_modules/body-parser/lib/types/json.js:135:5) at Layer.handle [as handle_request] (/home/bchsv/prod-2/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/bchsv/prod-2/node_modules/express/lib/router/index.js:317:13) at /home/bchsv/prod-2/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/bchsv/prod-2/node_modules/express/lib/router/index.js:335:12) at next (/home/bchsv/prod-2/node_modules/express/lib/router/index.js:275:10) at expressInit (/home/bchsv/prod-2/node_modules/express/lib/middleware/init.js:40:5)
if I use my own pay.rpc for datapay.send
datapay fails with error returning only NodeError
If I use default pay.rpc for datapay.build there is no error from rpc
but then I need to http send builded tx via my node rpc, and tx gets through successfully
a80a0a2afc0ba2f76914b26ed98fd9db3e0aedbe3c399c6e3e157f126315332e
my node is available under bitcoinsv.si
if one would like to try directly with node rpc, I can give user & pass.
The datapay docs detail an example of broadcasting a transaction to the network, however, they explicitly define bitindex and implicitly suggest memo.cash.
Can users of this library get more control over how they broadcast?
As a merchant we may want to broadcast to as many networks/miners as we possibly can, as quick as we can.
What are our options here?
Thanks.
Hi,
I am trying to send image in hash format with dataPay.send example but receive an error:
code: 1,
message: 'the transaction was rejected by network rules.\n' +
'\n' +
'66: insufficient priority\n' +
I create transaction with:
const tx = this.createTx(message);
dataPay.send(tx, (err: object, res: string) => {
if (err) {
return reject(err);
}
return resolve(res);
});
private createTx(message: Buffer): TxTransaction {
const bufferInHex = message.toString('hex');
return {
safe: true,
data: [bufferInHex],
pay: {
key: this.privateKey,
rpc: this.rpcApi, // 600
fee: this.rpcFee, // https://api.mattercloud.net
},
};
}
Any hint?
Thank you.
Is there any way to host a website on bitcoin SV blockchain? I saw somewhere, that there is a method to host a simple html page in bitcoin SV transaction.
How i can do that withoud 3rd party service. I mean i want to create transaction with html file in it.
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.