maticnetwork / dagger.js Goto Github PK
View Code? Open in Web Editor NEWSimple library to connect with dagger server and manage subscriptions for Ethereum Blockchain.
Home Page: https://matic.network/dagger
License: MIT License
Simple library to connect with dagger server and manage subscriptions for Ethereum Blockchain.
Home Page: https://matic.network/dagger
License: MIT License
I have this code:
var Dagger = require("eth-dagger");
// connect to Dagger ETH ropsten network over web socket
var dagger = new Dagger('wss://ropsten.dagger.matic.network');
// confirmed (irreversible) incoming transaction
dagger.on("confirmed:addr/0x3693f7449BD461F74975D571E7e3Bc031eF73586/tx/in", function(result) {
console.log('Confirmed'+ result)
});
// latest incoming transaction
dagger.on("latest:addr/0x3693f7449BD461F74975D571E7e3Bc031eF73586/tx/in", function(result) {
console.log('Latest: ' + result)
});
When I run it, it return only:
reconnecting...
Confirmed[object Object]
Here is tx: https://ropsten.etherscan.io/tx/0x746ec51d25b5235217bf690e03da6ebbcfe8e9e22b0a0a7b21c2df5f285d2a65
Yo. Very strange behaviour continues to happen over and over:
When having a line like _dagger = new Dagger.default(daggerAddr);
Node crashes with this error:
Error: certificate has expired
at TLSSocket.onConnectSecure (_tls_wrap.js:1060:34)
at TLSSocket.emit (events.js:182:13)
at TLSSocket.EventEmitter.emit (domain.js:442:20)
at TLSSocket._finishInit (_tls_wrap.js:639:8)
If line _dagger = new Dagger.default(daggerAddr);
is commented out error is not showing up.
Any ideas how to solve that?
npm i eth-dagger
throws error> [email protected] preinstall /Users/projects/eth-dagger.js/node_modules/scrypt > node node-scrypt-preinstall.js > [email protected] install /Users/projects/eth-dagger.js/node_modules/kerberos > (node-gyp rebuild) || (exit 0)CXX(target) Release/obj.target/kerberos/lib/kerberos.o
In file included from ../lib/kerberos.cc:1:
In file included from ../lib/kerberos.h:9:
In file included from ../node_modules/nan/nan.h:190:
../node_modules/nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet' in 'v8::Object'
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
Hello,
Currently, I am using the following code to filter the transaction:
const Web3 = require('web3');
const Dagger = require('@maticnetwork/dagger');
const dagger = new Dagger('wss://kovan.dagger.matic.network');
const abi = require('./abi.json');
var web3 = new Web3('wss://kovan.infura.io/ws/v3/<Infura Key>');
var web3Contract = new web3.eth.Contract(abi,'0x9dd6a7dc18f20a3dcb4d422a7387747072524886');
var contrat = dagger.contract(web3Contract);
var filter = contrat.events.Transfer({filter: {to: '0x4601A10F14C480d22830070aCF6c2c5455DAC27D'}, room: 'latest'});
filter.watch(async function(data, removed){
console.log('QRXD Recived');
var a = await web3.eth.getTransaction(data.transactionHash);
console.log(a);
});
But how can I filter multiple addresses?
Thanks in advance.
Dependency is missing in package.json
(node:21) UnhandledPromiseRejectionWarning: Error: Connection closed
at /app/node_modules/mqtt/lib/client.js:124:29
at Array.forEach (<anonymous>)
at flushVolatile (/app/node_modules/mqtt/lib/client.js:122:24)
at Duplex.<anonymous> (/app/node_modules/mqtt/lib/client.js:358:5)
at Duplex.emit (events.js:315:20)
at emitClose (/app/node_modules/ws/lib/stream.js:12:10)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
(node:21) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise r
ejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:21) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
eth mainnet is working fine
npm install eth-dagger --save
added 1213 packages in 213.937s
Call me oldschool, I much prefer "include single file and it works" over minutes of installing, 24k files, and 142MB
Because I tried this: INFURA/infura#13 (comment)
And this, updating to 1.0.0
: INFURA/infura#73 (comment)
And found reference to this tool here: INFURA/infura#29 (comment)
Hi can we get event of multiple accounts transactions at once if so can i get an examples?
I'm getting reconnecting...
message every minute or so in the log. From code I can see this is caused by mqtt
reconnecting.
I am using https://testnetv3-dagger.matic.network
dagger server.
Is this behaviour expected?
Anyway I would prefer to replace console.log
with a listener, so I can choose how to react in that scenario.
var Dagger = require('eth-dagger')
new Dagger(...)
doesn't work for me, I have to use
var Dagger = require('eth-dagger').default
new Dagger(...)
Also, is the mainnet supposed to be down currently?
I'd love support for the POA chain (https://poa.network/), as well as any other chain that implements ethereum's standard RPC. It's probably a more expensive lift for you because you probably run a full node in order to get all the data needed, so each custom chain you would need to also run a full node of their network. Just thought I'd open an issue to start the conversation.
Thoughts?
In Dagger Play the event config string is automatically converted into lowercase, because of which there is a problem with using the address which is Case Sensitive. Therefore, currently the Dagger commands using address cannot be run with the Dagger Play.
We would like to see support for an event that is triggered based on an account balance lower than a certain threshold. The use case is for automated hot wallets.
Do you plan on supporting Rinkeby test network?
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.