Bugfix Websocket hostname. (#21)
* Add yarn-error.log to gitignore. * Add ts-node to devDependencies. Add script to only build tsc. Add websocket to keywords. * Update yarn.lock libs. * FIX websocket endpoint hostname. FIX corrent import for all examples. FIX websocket instrucions on readme.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const { bitcoin: { websocket } } = mempoolJS();
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
bitcoin: { websocket },
|
||||
} = mempoolJS();
|
||||
|
||||
|
||||
const ws = websocket.initServer({
|
||||
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
|
||||
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
|
||||
});
|
||||
|
||||
ws.on('message', function incoming(data) {
|
||||
|
||||
ws.on("message", function incoming(data) {
|
||||
const res = JSON.parse(data.toString());
|
||||
if (res.blocks) {
|
||||
console.log(res.blocks);
|
||||
@@ -24,5 +23,5 @@ const init = async () => {
|
||||
console.log(res.mempoolBlocks);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
init();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import mempoolJS from '../../../src/index';
|
||||
import mempoolJS from "@mempool/mempool.js";
|
||||
|
||||
const { liquid: { websocket } } = mempoolJS();
|
||||
|
||||
const init = async () => {
|
||||
const {
|
||||
liquid: { websocket },
|
||||
} = mempoolJS();
|
||||
|
||||
|
||||
const ws = websocket.initServer({
|
||||
options: ['blocks', 'stats', 'mempool-blocks', 'live-2h-chart'],
|
||||
options: ["blocks", "stats", "mempool-blocks", "live-2h-chart"],
|
||||
});
|
||||
|
||||
ws.on('message', function incoming(data) {
|
||||
|
||||
ws.on("message", function incoming(data) {
|
||||
const res = JSON.parse(data.toString());
|
||||
if (res.blocks) {
|
||||
console.log(res.blocks);
|
||||
@@ -24,5 +23,5 @@ const init = async () => {
|
||||
console.log(res.mempoolBlocks);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
init();
|
||||
|
||||
Reference in New Issue
Block a user