Questions tagged [websocket]

The tag has no usage guidance.

46 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
2 answers
828 views

What is the safest way to use WS-RPC server in geth?

In this answer, it is suggested that it is not safe to use --wsorigins="*" for security reasons. What are the security reasons? => How could I make WS-RPC server connection secure in geth?...
user avatar
  • 7,699
3 votes
0 answers
126 views

How to use Truffle HDWallet Provider with WebSocketProvider

Truffle HDWallet Provider works well with HttpProvider, but doesn't work with WebSocketProvider.
user avatar
3 votes
1 answer
2k views

Subscribe to events usign geth websocket

I'm trying to subscribe to geth using the websocket api. First step was to start geth: geth --ws --wsport=8456 --wsorigins="*" --fast --cache=512 --rpcport=8455 --rpc --rpcapi="personal,eth,network" ...
user avatar
2 votes
0 answers
290 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 ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
2 votes
0 answers
316 views

Cannot Connect to Geth Web Socket from Other PC on LAN

I have a geth node running on one PC, IP 192.168.0.105 and on my main dev machine IP 192.168.0.102, I'm trying to connect to it via web sockets but keep getting connection not open. Both are on the ...
user avatar
  • 121
2 votes
1 answer
531 views

Healtcheck on Websocket

I've looked through the documentation and haven't found that to be helpful. I would like to know the best way to do a healthcheck on my websocket connection to geth (Yesterday, I found out that I did ...
user avatar
  • 457
2 votes
0 answers
574 views

Geth connection rpc vs ws

where I can find same articles or materials to understand differences between rpc and ws connection over geth. From my point of view rpc is part of a websocket connection, so why I have to use ws ...
user avatar
  • 1,160
2 votes
0 answers
375 views

Sockets/4 - Connection failed, retrying after 1000ms

After running for a bit I always get this with the latest ethereumwallet --fast and latest ubuntu: [2017-07-01 17:00:30.037] [ERROR] ipcProviderBackend - Send request failed Error: Unable to connect ...
user avatar
1 vote
0 answers
168 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 ...
user avatar
  • 11
1 vote
0 answers
240 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 ...
user avatar
1 vote
0 answers
287 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 ', ...
user avatar
1 vote
0 answers
143 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: {\&...
user avatar
1 vote
0 answers
87 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 ...
user avatar
1 vote
1 answer
3k 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 ...
user avatar
  • 497
1 vote
0 answers
19 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 ...
user avatar
1 vote
0 answers
259 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,...
user avatar
  • 57
1 vote
0 answers
884 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 ...
user avatar
1 vote
0 answers
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.
user avatar
  • 235
1 vote
0 answers
337 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 ...
user avatar
  • 203
1 vote
1 answer
815 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: ...
user avatar
  • 45
0 votes
0 answers
11 views

how to use infura websocket to get notify receive eth?

i have tried using infura to create transaction, smartcontract, and nft. but i still lack and get issue to use websocket, to notify in received transaction. i want to use some address maybe 10-20 ...
user avatar
0 votes
0 answers
8 views

how to access ws connection in nodejs when truffle-config enables websockets

here is my truffle-config.js module.exports = { networks: { development: { host: "127.0.0.1", port: 9545, network_id: "*", websockets: true ...
user avatar
0 votes
1 answer
47 views

TimeOut excpetion on websocket using Nethereum

I'm working on a frontrunning bot using Nethereum. the problem I'm facing is the following, once I get all the pending transaction hashes through the websocket, I pass the hash trhough ...
user avatar
0 votes
1 answer
103 views

How to listen for events without a websocket RPC?

Based on the docs of ethersjs, I could use the provider.on() function to listen for events and perform some actions. However, would it still work if I don't have a websocket RPC URL? If it still does ...
user avatar
  • 255
0 votes
0 answers
45 views

How can you listen for certain events to have real-time updating on your front-end?

For example, if using ERC721A there is a _totalMinted() function that returns the current amount of minted tokens. Can you listen for a successful mint and then have your front-end display that value ...
user avatar
0 votes
1 answer
94 views

Ganache and webscockets

I'm searching the docs, but, I cannot find anything. Does ganache support WebSocket connections? People seem to use for web socket connections in different posts.
user avatar
0 votes
0 answers
25 views

0x V4 Websocket connection

Is the 0x V4 Websocket server down? It was working for me a few days ago, but now I am getting the error "server rejected WebSocket connection: HTTP 400". Has anything changed?
user avatar
  • 1
0 votes
0 answers
100 views

How do I listen to changes for an ethereum address using websockets + RPC eth_subscribe method + postman

I am trying to listen for changes in a wallet balance on the Kovan testnet , so I have connected to a Kovan node using a node provider's websocket endpoint, I have no errors connecting, and no errors ...
user avatar
0 votes
0 answers
110 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 ...
user avatar
0 votes
0 answers
147 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 ...
user avatar
0 votes
0 answers
173 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 ...
user avatar
  • 189
0 votes
0 answers
243 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 ...
user avatar
  • 5
0 votes
0 answers
416 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 ...
user avatar
  • 177
0 votes
0 answers
28 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 ...
user avatar
0 votes
0 answers
66 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 = ...
user avatar
  • 1
0 votes
0 answers
101 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 ...
user avatar
0 votes
0 answers
132 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 " ....
user avatar
0 votes
0 answers
61 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 ...
user avatar
0 votes
0 answers
387 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 ...
user avatar
0 votes
2 answers
76 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....
user avatar
0 votes
1 answer
228 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/...
user avatar
  • 1
0 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
357 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 ...
user avatar
0 votes
0 answers
199 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 ...
user avatar
0 votes
0 answers
178 views

Unable to catch contract event using parity websockets

I have a contract deployed on ropsten which emits event when ether amount is deposited in it. I can see the event appearing in etherscan. this.web3Socket = new Web3(new Web3.providers....
user avatar