Questions tagged [websocket]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

Websocket returning "unexpected server response: 200"

Using ethers.js with node, I was able to connect and communicate with websockets until recently. My code did work but now I only get Unexpected server response: 200 as response when trying to ...
1
vote
1answer
22 views

Websocket listener returns no response

I am trying to listen to a UniSwap v3 Swap event but I get no response from the network. I am connected to polygon network via websocket and after firing up the listener I get no callbacks even though ...
0
votes
0answers
13 views

Filter out mint and burn Transfers from Transfer events (web3.js)

In web.js Library Is there a way to filter out the Transfers events generated by the mint and burn function so as to ignore all the Transfer events generated by the mint or burn function. I know we ...
0
votes
0answers
21 views

Trying to use an Alchemy Websockets address to subscribe to an event but it errors out when it tries to update

Here is the script: const Big = require('big.js'); const blk = require('./blockchain'); const UniswapV2Pair = require('./abi/IUniswapV2Pair.json'); const cc = require('./common_code'); const ...
0
votes
0answers
25 views

Cannot connect geth via JSON RPC or WebSocket, only via IPC

I run the geth-cli with $ geth console --mainnet --syncmode "snap" --cache=8192 --datadir "~/.ethereum" --datadir.minfreedisk 30000 --http.corsdomain "*" --ws --http.api ...
0
votes
0answers
31 views

TypeError: Cannot read property 'callback' of undefined

my code const providerWs = new ethers.providers.WebSocketProvider('quicknode wss provider'); providerWs.on('pending', async (txHash) => { try { const transaction = await ...
0
votes
0answers
12 views

Track wallet address for new transactions in real time [duplicate]

I'm trying to find the best way of tracking an Ethereum wallet address for any new transactions in real time (or as close to it as possible) and then do some filtering on it. I've tried using the web3....
0
votes
0answers
87 views

How to properly subscribe to Uniswap v3 pool price events with NodeJS and JavaScript?

In reviewing the Uniswap v3 Quoter documentation: These functions are not marked view because they rely on calling non-view functions and reverting to compute the result. They are also not gas ...
0
votes
0answers
14 views

Cannot connect to _provider.on('open') event for checking latency web3js

Im trying to check latency to my node, here's the code : const checkLatency = async () => { return new Promise(async function(resolve, reject) { let connectionStartDate = Date.now(); let ...
0
votes
1answer
125 views

Can't create Web3 websocket connection successfully

I use latest Web3 version (1.6.1) code in Node.js as provided in docs. But when I run: var Web3 = require('web3'); var web3 = new Web3( new Web3.providers.WebsocketProvider('wss://dex.binance.org/api/...
0
votes
0answers
25 views

Web3 socket with options doesn't work

I'm trying to set some options in my wss connection but that seems don't have any effect using the moralis endpoint to connect in BSC I tried to keep the connection but that's dropped yet const Web3 = ...
0
votes
0answers
42 views

Stop the suscription.on() web3 subscription

I am trying to check the first next incoming transactions for a given wallet. I am using a function watchTransaction() only when expecting a transaction. I want to stop once the transaction is ...
0
votes
0answers
57 views

Web3 Contract events not working on Ropsten testnet

Despite assuring that all event subscriptions are done through a websocket web3 provider instead of https, I still cannot get an event to return an info with " .on('data' ", however " ....
0
votes
0answers
20 views

How instant and up to date are the wesocket event logs when using a light client?

I am trying to listen for event logs from a geth light node hooked up to the BSC mainnet. my observation is that i keep getting events with old block numbers that range from 100 to a 1000 old. My ...
0
votes
0answers
137 views

What is the primary cause of error ECONREFUSED?

I have written a few small scripts using Node and Ethers to do simple buy and sell transactions through the PCS router and have had success when I write the code however, I am just learning and i have ...
2
votes
0answers
153 views

Losing connection on Geth websocket subscription

I am trying to keep multiple WebSocket connections to my Geth node open at the same time (around 200 connections). My issue is that they keep closing with a timeout error. I can't seem to know if it's ...
0
votes
0answers
166 views

How can I listen emitted events from BSC network

How can I noticed and get the results of events whenever events are emitted on BSC network. I have tried web3.on() method, but the on() method can work with WebSocketProvider and BSC network does not ...
0
votes
2answers
64 views

Geth is not emitting pending transactons

I am connected to two nodes, mine and external. The external one emits pending transactions mine does not. I started geth full node (after downloading a snapshot of the network). After 24h using eth....
0
votes
0answers
207 views

Get addLiquidityTransaction on a specific contract on ethers.js

I'am trying to get an addLiquidityETH event in ethers.js with a WebSocket on a specific contract but got nothing, can someone tell me what am i missing ? const filter = { address: ' TOKEN ADDRESS ', ...
0
votes
1answer
968 views

Is there a way to listen to log events via websocket with web3py

i am trying to listen to log events via my node's websocket server but i can't seem to find a way to do that using the web3Py lib. the asynchronous implementation of the docs is basically a threaded ...
0
votes
0answers
26 views

Can I use a subnet mask with ws.origins?

I am trying to run my own geth node, as I am interested in monitoring the txpool's pending and queued transactions. I plan to mostly use a websocket connection from the same server, but it's possible ...
0
votes
0answers
56 views

does geth have timeout options for json and websocket servers?

Does anyone know a way to set a timeout value for hung websocket connections? sometimes i will get a hung connection that never closes and i have no way to kill it. i dont see any timeout values in ...
1
vote
0answers
115 views

Dex Data on BinanceSmartChain

I'm trying to get access to some data on the BSC using a websocket and the same methods as web3. I've sucessfully sent the following to get the latest swap pairs created at the PancakeSwap Factory: {\&...
1
vote
1answer
2k views

Subscribing to events using ethers / hardhat network

I have a basic node express application. It connects to my locally running hardhat network via ethers & websocket. The connection seems to work, since I can query the blockchain succesfully (for ...
0
votes
1answer
125 views

Why can't I establish a socket connection with Infura? Project ID is correct, I triple checked

I want to subscribe and listen to events that involve funds moving to my wallet, however I for some reason am not able to establish a socket connection to an Infura node. First I npm init and npm web3....
2
votes
1answer
237 views

405 Method Not Allowed with websocket geth RPC

curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: XXXXXXX" -H "Origin: https://XXXXXXX/" -H "Content-Type: application/json" -X ...
0
votes
1answer
116 views

newPendingTransactions returning old transactions

I'm building an application where i need to keep track on new pending transactions. I'm somehow receiving old pending transactions, an example is this one https://etherscan.io/tx/...
1
vote
2answers
56 views

Is there a websocket URL in Ethereum classic like in Ethereum?

Can anyone tell me whether or not there is a WebSocket URL to deal with smart contract events in Ethereum Classic especially? I know ethereum supports WebSockets and we can easily listen to events ...
0
votes
1answer
45 views

ROPSTEN: Duplicate Blocks adding transactions using Geth Real-Time Event API

I'm using the Geth Real-Time Event to get the new blocks via web-socket and there's a subscription called "newHeads" for that propose. The thing is sometimes the socket returns a duplicate ...
1
vote
0answers
73 views

What to do to enable Websocket Steam on Ethereum Node Server for NodeJS endpoint API

I have Ethereum node by providing ws and http port access through windows server, I filter the data and get the data I want.I created the node.js api endpoint to provide this data, so I can apply my ...
2
votes
2answers
911 views

Ethereum Wallet - Hangs at startup + 403 ws error

I have installed the Ethereum Wallet, Ethereum-Wallet-win64-0-11-1 (zip file), as described in the book. When I start up Ethereum Wallet (testnet Ropsten, syncmode “light”) the wallet seems to load ...
15
votes
2answers
22k views

How to listen to contract events using ethers.js?

I need to listen to the specific contract events and do some task once the event is emitted. I didn't find proper docs on ethers.js documentation. Can anybody tell me how can I keep listening to my ...
1
vote
1answer
2k views

Websocket provider reconnects every 1 minute

I'm developing an application on a private Ethereum chain and trying to listen to some events. I wrote a basic indexer script for listening to events and writing them in a database. To listen to the ...
1
vote
0answers
17 views

Cannot connect to Azure PoA Websocket

Just like question Connecting to blockchain on azure using web3.js and websocket, I need to use websockets to capture events. I have gotten my http and websocket endpoints from the deployment outputs ...
0
votes
2answers
1k views

What is the websocket URL in Ethereum on Geth?

I've lunched an Ethereum server based on Geth. Now, I need to be notified about all incoming transactions on my generated accounts. In my previous Bitcoin Core server, I had an option in its config ...
2
votes
0answers
35 views

Azure Blockchain Service node properties [closed]

What exactly are Access key 1, Access key 2, Member account, Web socket, DNS, creater account, etc. of a node in Azure Blockchain Service? I am getting confused as to what are these. Also what are the ...
3
votes
0answers
85 views

How to use Truffle HDWallet Provider with WebSocketProvider

Truffle HDWallet Provider works well with HttpProvider, but doesn't work with WebSocketProvider.
1
vote
0answers
227 views

Connection not open on send when subscribing to new block headers

I am running a local ethereum node with the below configuration geth --syncmode "full" --datadir "." --ethash.dagdir "." --cache=4096 --rpc --rpcaddr test.example.com --rpcapi="web3,miner,admin,...
0
votes
1answer
318 views

Erc-20 Token Send Transaction

I want some Information about Erc-20 Transactions. I want to transfer Erc-20Token from first wallet to a second wallet, I have Privet Key, But I want to transfer with Api, So How can I transfer the ...
1
vote
1answer
132 views

Generate new address, Send and Get transaction then Check transaction

I'm just starting in the ethereum and trying to build an app using Web3 and Nodejs. I'll need your lights so I can get any idea to know how to resolve those points: I have my own public address and ...
0
votes
1answer
730 views

geth subscribe newHeads not working

I run geth with this command geth --syncmode "fast" --cache 2048 --datadir /data/ethereum --ws --wsaddr 0.0.0.0 --wsorigins '*' --wsapi 'web3,eth,net,db,personal' --rpc --rpcaddr 0.0.0.0 then i ...
0
votes
0answers
166 views

Events using Infura websockets on rinkeby Web3 1.2.1. Returned values aren't valid, did it run Out of Gas?

I am trying to do a simple event listener with NodeJS and Web3 using an Infura endpoint. I have the correct project-id const Web3 = require('web3'); let web3 = new Web3( // Replace YOUR-PROJECT-ID ...
2
votes
4answers
1k views

TimeoutError when using Infura websocket with web3.py

When I run the following code sometimes it executes successfully, but most of the time it raises a concurrent.futures._base.TimeoutError. What can I do to fix this? Here is the code: infura_url_ws = ...
0
votes
1answer
2k views

How to connect with WebSocket with Web3?

Already referred web3 documentations and other Q-A for web socket connection. Currently using infura as provider.
2
votes
1answer
192 views

Subscribe to events using local geth in light mode?

I've followed this guide to subscribe to events. I succesfully subscribed to the new block headers using Infura provider. But when I try to use local geth node syncing in light mode, it connects, but ...
1
vote
0answers
780 views

Problem connecting web3 via websocket to node with nginx

we are trying to connect to a geth node via WebSockets to be able to subscribe to contract events. This node is created with docker and this docker uses nginx as a proxy. We can connect easily with ...
1
vote
0answers
48 views

Infura websocket API timing out on connect

Has anyone ever had issues with the Infura Websocket API suddenly ceasing to respond. I have been using it to subscribe to event logs, but now the connection to the API is timing out.
1
vote
0answers
296 views

Ocasional connection refused initializing web3

I have an ethereum web application using web3js 1.0.0-beta.34 on a private network. Most of the times everything works fine. Sometimes the connection to the node through a websocket provider fails ...
0
votes
1answer
452 views

Infura Web Sockets doesn't work on Infura

I have a problem with connecting via Websockets to Infura. I am listening on some events from my smart contract, so when some event is dispatched by calling some method from smart contract, I should ...
1
vote
1answer
735 views

Error on WebSocket connection to Infura Ropsten (broken close frame)

I am trying to connect to Ropsten with Web3js (1.0) via Infura using their WebSocket provider but I am getting the following error: WebSocket connection to 'wss://ropsten.infura.io/ws' failed: ...