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:
Miguel Medeiros
2021-05-20 12:03:40 -03:00
committed by GitHub
parent 0aa3757217
commit e3068c2d8d
28 changed files with 236 additions and 169 deletions

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -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();

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -1,4 +1,4 @@
import mempoolJS from '../../../src/index';
import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const {

View File

@@ -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();