GolosChain / golos

Socio-economic mediablockchain
https://developers.golos.io
Other
59 stars 36 forks source link

[0.16.5] Old-style API call just hangs #419

Closed bitphage closed 6 years ago

bitphage commented 6 years ago

With connecting to webserver-ws-endpoint = 0.0.0.0:8091 the following API call just hangs forever:

{'method': 'call', 'params': [1, 'login', ['', '']], 'jsonrpc': '2.0', 'id': 1}

Expected result: an error message returned.

kotbegemot commented 6 years ago

The format of the requests has changed slightly. Please. @bitfag read the article. https://golos.io/ru--golos/@goloscore/novosti-golos-core-status-razrabotki-na-05-02-2018-tekhnicheskie-izmeneniya-informaciya-o-bounty-programme

bitphage commented 6 years ago

API change is not an excuse for hanging. Web server must return an error in case of wrong request format and not just hang forever.

kotbegemot commented 6 years ago

The task is set in https://github.com/GolosChain/golos/projects/6?

afalaleev commented 6 years ago

To check that golosd returns an error message, you may execute the following script in a browser:

<script>
var socket = new WebSocket('ws://127.0.0.1:8091')

socket.onopen = function(event) {

        socket.send(JSON.stringify({"method": 'call', "params": [1, 'login', ['', '']], "jsonrpc": '2.0', "id": 1}));

        socket.onmessage = function(raw) {
                var data = JSON.parse(raw.data);
                console.log(data.error);
        }

}
</script>
kotbegemot commented 6 years ago

https://github.com/GolosChain/golos/pull/438