Created
December 4, 2019 01:22
-
-
Save synfonaut/cb4ec816901a6198def186d13a285600 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [email protected] | |
const bitwork = require('bitwork'); | |
const config = { | |
rpc: { host: "...", user: "...", pass: "..." }, | |
peer: { host: "..." }, | |
chain: null, | |
}; | |
function getbitworknum() { | |
return new Promise(async (resolve, reject) => { | |
const bit = new bitwork(config); | |
bit.on("ready", async () => { | |
const mempool = await bit.get("mempool"); | |
resolve(mempool.tx.length); | |
}) | |
}); | |
} | |
function getmempoolnum() { | |
return new Promise(async (resolve, reject) => { | |
const bit = new bitwork(config); | |
bit.on("ready", async () => { | |
const info = await bit.get("rpc", "getmempoolinfo"); | |
resolve(info.size); | |
}) | |
}); | |
} | |
async function compare() { | |
const reported = await getmempoolnum(); | |
const received = await getbitworknum(); | |
console.log(Date.now(), "REPORTED", reported, "RECEIVED", received); | |
} | |
setInterval(compare, 3000); | |
compare(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MBP:bitwork_debug brad$ node index.js | |
More than one instance of bsv found. | |
Please make sure to require bsv and check that submodules do | |
not also include their own bsv dependency. | |
1575422467426 'REPORTED' 2942 'RECEIVED' 2942 | |
1575422470927 'REPORTED' 2942 'RECEIVED' 2944 | |
1575422472913 'REPORTED' 2948 'RECEIVED' 2949 | |
1575422475787 'REPORTED' 2955 'RECEIVED' 2960 | |
1575422478805 'REPORTED' 2962 'RECEIVED' 2964 | |
1575422481825 'REPORTED' 2969 'RECEIVED' 2972 | |
1575422482876 'REPORTED' 2978 'RECEIVED' 1 | |
1575422488152 'REPORTED' 2981 'RECEIVED' 2981 | |
1575422488869 'REPORTED' 2981 'RECEIVED' 1 | |
1575422495692 'REPORTED' 2987 'RECEIVED' 2989 | |
1575422496587 'REPORTED' 2996 'RECEIVED' 2999 | |
1575422499744 'REPORTED' 3003 'RECEIVED' 3006 | |
1575422503778 'REPORTED' 3012 'RECEIVED' 3014 | |
1575422506530 'REPORTED' 3019 'RECEIVED' 3023 | |
1575422510906 'REPORTED' 3027 'RECEIVED' 3031 | |
1575422512610 'REPORTED' 3036 'RECEIVED' 3039 | |
1575422514958 'REPORTED' 3045 'RECEIVED' 3048 | |
1575422518001 'REPORTED' 3048 'RECEIVED' 3048 | |
1575422523651 'REPORTED' 3048 'RECEIVED' 3048 | |
1575422523688 'REPORTED' 3048 'RECEIVED' 3048 | |
1575422529646 'REPORTED' 3049 'RECEIVED' 3049 | |
1575422529925 'REPORTED' 3049 'RECEIVED' 3049 | |
1575422532906 'REPORTED' 3051 'RECEIVED' 3054 | |
1575422533962 'REPORTED' 3060 'RECEIVED' 2 | |
1575422536834 'REPORTED' 3066 'RECEIVED' 1 | |
1575422542216 'REPORTED' 3072 'RECEIVED' 3074 | |
1575422543044 'REPORTED' 3079 'RECEIVED' 1 | |
1575422548640 'REPORTED' 3083 'RECEIVED' 3083 | |
1575422551570 'REPORTED' 3084 'RECEIVED' 3084 | |
1575422552194 'REPORTED' 3084 'RECEIVED' 1 | |
1575422557296 'REPORTED' 3087 'RECEIVED' 3091 | |
1575422560766 'REPORTED' 3096 'RECEIVED' 3099 | |
1575422564783 'REPORTED' 3101 'RECEIVED' 3101 | |
1575422566114 'REPORTED' 3104 'RECEIVED' 3107 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment