Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "javalon", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "javascript api for the avalon blockchain", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -103,4 +103,5 @@ # Javalon | ||
To send a transaction to the network, you will need multiple steps. First you need to define your transaction and sign it. | ||
``` | ||
// first you need to define your transaction | ||
var newTx = { | ||
@@ -115,14 +116,16 @@ type: javalon.TransactionType.FOLLOW, | ||
newTx = javalon.sign(alice_key, 'alice', newTx) | ||
// after this step, the transaction is forged with a timestamp, hash, and signature | ||
// and the transaction needs to be sent in the next 60 secs or will be forever invalid | ||
// finally you send it with | ||
``` | ||
After this step, the transaction is forged with a timestamp, hash, and signature. This transaction needs to be sent in the next 60 secs or will be forever invalid. | ||
You can send it like so | ||
``` | ||
javalon.sendTransaction(newTx, function(err, res) { | ||
// and it should answer once the transaction is fully validated and included in a block ! | ||
cb(err, res) | ||
}) | ||
``` | ||
The callback will return once your transaction has been included in a new block. | ||
// alternatively, if you just want to send the transaction without waiting for validation | ||
Alternatively, you can just want the callback as soon as the receiving node has it, you can do: | ||
``` | ||
javalon.sendRawTransaction(newTx, function(err, res) { | ||
// and it will answer quickly with the current head block | ||
cb(err, res) | ||
@@ -129,0 +132,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147
18123