hirosystems / stacks-blockchain-api

API for the Stacks blockchain
https://stacks-blockchain-api.vercel.app
GNU General Public License v3.0
178 stars 115 forks source link

subscribeBlocks and subscribeMempool don't work after 9 hours #2173

Closed dhwndud408 closed 1 week ago

dhwndud408 commented 1 week ago

Hi! dev teams.

I am making code with your api. Here is my computer info. Mac OS Sonoma14.4 Node 18.19.1 NPM 10.2.4 API version: 8.2.0

Here is the typescript code

import * as stacks from '@stacks/blockchain-api-client';
const socketUrl = "https://api.mainnet.hiro.so";
const socket = new stacks.StacksApiSocketClient({ url: socketUrl });

let client = await stacks.connectWebSocketClient('wss://api.mainnet.hiro.so/');

sub = await socket.subscribeBlocks((event) => {
   console.log(event)
}
sub = await socket.subscribeBlocks((event) => {
console.log(event)
}

After about 6~9 hours, the websocket stops.

I also see the this report. https://github.com/hirosystems/stacks-blockchain-api/issues/1885

The admin said it was resolved on above link, but it seems the issue has resurfaced with the Nakamoto update.

zone117x commented 1 week ago

Closing as a duplicate of https://github.com/hirosystems/stacks-blockchain-api/issues/2146