Questions tagged [websocket]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
12
votes
2answers
12k views

Geth can't connected to via Websocket

I am trying to connect to Geth via Websockets but unfortunately i am given 403 error. I am using the --ws --wsport XXXX args. Everything is done in a local instance, so that would be surprising if ...
9
votes
1answer
1k views

web3 websocket connection prevents node process from exiting

I have a node js process that creates a web3 websocket connection, like so: web3 = new Web3('ws://localhost:7545') When the process completes, it does not exit, but rather hangs forever with no ...
5
votes
1answer
3k views

Subscription using websocket through Geth

I am trying to build a dapp which will monitor a particular address balance, and update in case someone send fund (ether) to it. Instead of polling using call getBalance, I want to take advantage of ...
4
votes
1answer
1k 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 ...
4
votes
7answers
4k views

Is there any websocket ethereum provider?

Is there any websocket ethereum provider? Except etherscan one. Maybe there are paid wss subscriptions?
4
votes
0answers
551 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?...
3
votes
2answers
5k views

connecting geth to web3.js 1.0 via websockets or HTTP

I am building a minimal nodeJS application that should connect via web3.js to my geth node. I am following the official web3.js1.0 documentation and I am using web3 1.0.0-beta.29. I do manage to ...
3
votes
0answers
471 views

ping / pong pattern for infura websocket [closed]

Infura websockets disconnect after an hour of in-activity so they suggest you ping / pong the connection at an interval less then an hour. My problem is I'm new to server-side programming and don't ...
2
votes
3answers
7k views

web3 Websocket connection to infura

I receive this error when I'm trying to connect to the websocket WebSocket connection to 'wss://ropsten.infura.io/ws' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol'...
2
votes
1answer
25 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 ...
2
votes
2answers
429 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 ...
2
votes
1answer
231 views

Is there a max number of websocket connections that geth can support?

I realize that it depends on my machine, RAM, etc, but is there a general guide of how many WS connections geth can support?
2
votes
1answer
254 views

Connecting to blockchain on azure using web3.js and websocket

right now, I am trying to write a service using web3 which will 'subscribe' to all 'perndingtransactions' on blockchain to perform further actions. web3 documentation says that 'Httpprovider' cant be ...
2
votes
0answers
31 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 ...
2
votes
0answers
29 views

How to use Truffle HDWallet Provider with WebSocketProvider

Truffle HDWallet Provider works well with HttpProvider, but doesn't work with WebSocketProvider.
2
votes
0answers
221 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 ...
2
votes
1answer
423 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 ...
2
votes
1answer
1k 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" ...
2
votes
0answers
544 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 ...
2
votes
0answers
335 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 ...
1
vote
2answers
829 views

How to expose the underlying web socket connection from the WebSocketProvider?

Using web3.js version 1(beta) and using the WebsocketProvider to make a connection via const Web3 = require('web3') const web3 = new Web3('ws://localhost:8546') const provider = web3.providers....
1
vote
2answers
3k views

TypeError: Web3.providers.WebsocketProvider is not a constructor?

Trying to connect to a geth machine over websocket? JS code. var Web3=require('web3'); var web3 = new Web3(new Web3.providers.WebsocketProvider('ws://10.244.5.43:8546')); console.log(web3....
1
vote
2answers
17 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 ...
1
vote
2answers
2k views

TypeError: Cannot set property 'method' of undefined when using WebsocketProvider

I'm using: web3 v0.20.6 web3-providers-ws v1.0.0-beta.34 First question - can web3-providers-ws be used with web3 v0.20.*? Second question (problem) - I get an error when probably trying to send ...
1
vote
1answer
78 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 ...
1
vote
1answer
388 views

Having issue with Infura mainnet web3 connection and getting info

I have been looking at a tutorial from DappUniversity about Web3... on the introductory video, I have completed all stages fine, but when getting to retriving account balance information from the ...
1
vote
1answer
100 views

API or websocket

I am trying to develop an crypto traking site like coinmarketcap, for market data I am using exchanges API. but I am little bit confuse whether i should use api or websocket? as i don't have much ...
1
vote
1answer
747 views

How to connect to Infura Testnet by using WebsocketProvider?

I want to connect to rinkeby.infura testnet by using WebsocketProvider but the page remains blocked to load. const Web3 = require('web3'); console.log(Web3.givenProvider); var web3 = new Web3( new ...
1
vote
1answer
219 views

Dapp fundamental q about listening solidity events

Sol: I created contract with events that are raised when is called some function. Html fo: Those functions are called via web3.js with abi and address - easy. Backend (no js) asp or php: I am not ...
1
vote
0answers
22 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 ...
1
vote
1answer
200 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
11 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 ...
1
vote
0answers
68 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,...
1
vote
1answer
66 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
524 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
46 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
200 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 ...
1
vote
1answer
547 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: ...
0
votes
1answer
536 views

How to apply EthFilter to specific address?

In web3.js, we can apply event filter something like below: this.event = this.Contract.events.MyEvent({ filter: { address: "0xAccountAddress" }, }) In Web3J, it is translated to EthFilter ...
0
votes
1answer
591 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.
0
votes
1answer
11 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 ...
0
votes
1answer
319 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
1answer
368 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 ...
0
votes
1answer
957 views

“Connection not open” error when subscribing to address with websocket

I'm trying to subscribe to transactions sent to or from a particular ethereum address. I also want to test this in a local private network, which is why I'm not using etherscan or something like that. ...
0
votes
1answer
175 views

Get a large amount of blocks with web3 (nodejs)

I'm writing a nodejs program that gets a large amount of blocks (>100,000) and looks at each transaction inside to filter / analyse the data. I'm currently using web3 (v1) getBlock function: eth....
0
votes
1answer
274 views

Unable to connect to geth

I'm totally new to Ethereum, and want to create some deposit address monitoring system using web socket. Which gets newly generated blocks and scan it for transactions made into it. You can find code ...
0
votes
1answer
19 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....
0
votes
1answer
15 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/...
0
votes
0answers
78 views

Unable to connect to Geth/web3 from outside AWS using public IP with Websocket

I tried RPC api to connect to Geth/web3 hosted in AWS EC2 using the public IP. But developers have disabled web3 in RPC(HTTP) Web3 api for non local connection. It means that you can only make a web3 ...
0
votes
0answers
14 views

All requests routed to submodule when changing its provider in web3js

Using web3.js 1.2.11, I expect the last part of the following code to route requests from the web3.eth.personal module to the IPC socket, and requests on web3.eth to TCP port 7545. let Web3 = require('...