Error trying to run the ae-channel-service locally(On Macbook)

Still facing the same error:
[error] start_link “ws://localhost:3014/channel?channel_reserve=2&initiator_amount=7000000000000&initiator_id=ak_SVQ9RvinB2E8pio2kxtZqhRDwHEsmDAdQCQUhQHki5QyPxtMh&lock_period=10&minimum_depth=0&port=1564&protocol=json-rpc&push_amount=1&responder_amount=4000000000000&responder_id=ak_cFBreUSVWPEc3qSCYHfcy5yW2CWkbdrPkr9itgQfBw1Zdd6HV&role=responder”

I opened up the port this time while running my node :frowning: @dimitar.chain: What could be the possible issue?

@dimitar.chain, if you think getting on a call and screen sharing might help better, I am happy to do that as well :slight_smile: . I am Gyan0890#9895 at Discord.

Copy pasting the error here, once again:
[error] start_link “ws://localhost:3014/channel?channel_reserve=2&initiator_amount=7000000000000&initiator_id=ak_SVQ9RvinB2E8pio2kxtZqhRDwHEsmDAdQCQUhQHki5QyPxtMh&lock_period=10&minimum_depth=0&port=1564&protocol=json-rpc&push_amount=1&responder_amount=4000000000000&responder_id=ak_cFBreUSVWPEc3qSCYHfcy5yW2CWkbdrPkr9itgQfBw1Zdd6HV&role=responder”
[error] GenServer #PID<0.743.0> terminating
** (MatchError) no match of right hand side value: {:error, {{:badmatch, {:error, %WebSockex.ConnError{original: :closed}}}, [{SocketConnector, :start_link, 6, [file: ‘lib/socket_connector.ex’, line: 102]}, {SessionHolder, :init, 1, [file: ‘lib/session_holder.ex’, line: 137]}, {:gen_server, :init_it, 2, [file: ‘gen_server.erl’, line: 374]}, {:gen_server, :init_it, 6, [file: ‘gen_server.erl’, line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: ‘proc_lib.erl’, line: 249]}]}}
(ae_backend_service 0.1.0) lib/backend_session.ex:57: BackendSession.handle_cast/2
(stdlib 3.9) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib 3.9) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib 3.9) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:"$gen_cast", {:resume_init, {:responder, #Function<12.122127441/2 in SessionHolderHelper.custom_config/2>, {"", 0}, #Function<5.112218790/0 in AeChannelInterfaceWeb.ConnectController.new/2>}}}
State: %BackendSession{channel_params: nil, expected_state: nil, fp_timer: nil, game: %{}, identifier: -576460752303423484, params: {:responder, #Function<12.122127441/2 in SessionHolderHelper.custom_config/2>, {"", 0}, #Function<5.112218790/0 in AeChannelInterfaceWeb.ConnectController.new/2>}, pid_backend_manager: #PID<0.314.0>, pid_session_holder: nil, port: nil, responder_contract: nil}

Discord link here for @dimitar.chain Discord

2 Likes

Hi @gyan0890 please share some update here or in the bounty post so the general audience can know how things are working. Thanks!

Hi all,

As per my discussion with @dimitar.chain on Discord, I have changed the aeternity config file in my local running node to expose the webscoket at port 3014 and listen_address as “0.0.0.0” . PFA the latest config file. I have restarted the docker by applying this config file and now in the process of re-starting my channel service. Once the channl service is up and running(it takes about 6 hours or so on my machine), I will provide an update on the coin-toss-game.aeternity_config_schema.json (58.3 KB)

2 Likes

If anyone has any other suggestions, that would help to speed up the bounty, would be most happy to listen/implement :slight_smile:

1 Like

Quick update, even after changing the config file for websocket, same error persists:
[error] start_link “ws://localhost:3014/channel?channel_reserve=2&initiator_amount=7000000000000&initiator_id=ak_SVQ9RvinB2E8pio2kxtZqhRDwHEsmDAdQCQUhQHki5QyPxtMh&lock_period=10&minimum_depth=0&port=1564&protocol=json-rpc&push_amount=1&responder_amount=4000000000000&responder_id=ak_cFBreUSVWPEc3qSCYHfcy5yW2CWkbdrPkr9itgQfBw1Zdd6HV&role=responder”

Can you please provide the yaml config you’ve used

I added the .yaml file shown here: https://raw.githubusercontent.com/aeternity/ae-channel-service/master/test/aeternity_node_fast_test_config.yml
at /home/aeternity/.aeternity/aeternity inside my docker container. Re-starting my ae-channel-service now. Hope everything works for now. Will keep you updated here @dimitar.chain

1 Like

Hi all, seems like the above error is finally solved (3014 one) after my steps as mentioned above. But here is a new error that I have come across:
[error] start_link “ws://localhost:3014/channel?channel_reserve=2&initiator_amount=7000000000000&initiator_id=ak_SVQ9RvinB2E8pio2kxtZqhRDwHEsmDAdQCQUhQHki5QyPxtMh&lock_period=10&minimum_depth=0&port=1564&protocol=json-rpc&push_amount=1&responder_amount=4000000000000&responder_id=ak_cFBreUSVWPEc3qSCYHfcy5yW2CWkbdrPkr9itgQfBw1Zdd6HV&role=responder”

[info] Connected! %WebSockex.Conn{cacerts: nil, conn_mod: :gen_tcp, extra_headers: , host: “localhost”, insecure: true, path: “/channel”, port: 3014, query: “channel_reserve=2&initiator_amount=7000000000000&initiator_id=ak_SVQ9RvinB2E8pio2kxtZqhRDwHEsmDAdQCQUhQHki5QyPxtMh&lock_period=10&minimum_depth=0&port=1564&protocol=json-rpc&push_amount=1&responder_amount=4000000000000&responder_id=ak_cFBreUSVWPEc3qSCYHfcy5yW2CWkbdrPkr9itgQfBw1Zdd6HV&role=responder”, resp_headers: [{:Upgrade, “websocket”}, {:Server, “Cowboy”}, {“Sec-Websocket-Accept”, “maJ4HhKUF/UhNtTIlwvJTgPuefw=”}, {:Date, “Tue, 02 Mar 2021 08:37:07 GMT”}, {:Connection, “Upgrade”}], socket: #Port<0.39>, socket_connect_timeout: 6000, socket_recv_timeout: 5000, ssl_options: nil, transport: :tcp} #PID<0.583.0>

[info] backend session: {:connection_update, %{color: :blue, reason: nil, status: :connected}} pid is: #PID<0.583.0>

[info] Received Message: %{“channel_id” => nil, “error” => %{“code” => 3, “data” => [%{“code” => 1011, “message” => “Participant not found”}], “message” => “Rejected”, “request” => %{}}, “id” => nil, “jsonrpc” => “2.0”, “version” => 1} #PID<0.583.0> role :responder

[error] error

[error] <= error unprocessed message: %{“channel_id” => nil, “error” => %{“code” => 3, “data” => [%{“code” => 1011, “message” => “Participant not found”}], “message” => “Rejected”, “request” => %{}}, “id” => nil, “jsonrpc” => “2.0”, “version” => 1}

The message on the browser console is this:
Uncaught (in promise) Error: State Channels FSM entered unknown state
at enterState (internal.js:52)
at handleMessage (internal.js:108)
at async dequeueMessage (internal.js:119)

Finally did it folksss! A big thanks to @dimitar.chain and @ae-omar for not giving up on me.

5 Likes

To anyone interested in running the demo - you must:

  1. Run a node and have an access to the WebSocket endpoint (by default it lives on 127.0.0.1:3014, if you run a docker image - you must provide a proper setup to expose it out of the docker. Note that by default it is bound to the localhost of the docker image.
  2. You can run the test on various environments: mainnet, testnet or locally as an independent node mining on its own. You must configure your ae-channel-service properly so it can sign your transactions for you. Sadly, the demo client does not do that so you must fill your key pair here. If you’re running a local standalone test, you must configure your accounts_test.json accordingly
  3. Depending on your setup, you must configure your network_id depending on the environment

An example config files can be found in the ae-channel-service repo. There are two different setups, the difference between them is simply if the node mines with a normal speed or much faster. You can find the fast config here and the normal one here. Please note that if you want iris enabled, you shall add a corresponding line in the hard_forks section.

3 Likes

yeaahhh congratulations @gyan0890! And big thanks to @dimitar.chain for your great support!!! now is time to focus on getting the tutorial fully updated and checked for this scenarios so we can share everybody about statechannel knowledge.

3 Likes

I wish we could build something to make things understandable to rookies. Something with a simple UI like GitKraken that makes complicated things easy to understand:

@nikitafuchs.chain it would be as simple as providing a handful of settings to a docker image, it does not sound impossible…

1 Like

@dimitar.chain @nikitafuchs.chain sounds like we could make some bounty of this. What do you think?

2 Likes

I need to wrap my head around that how this could look and feel like, anyone some rough suggestions ?

@nikitafuchs.chain: For the bigger picture, I have been thinking about something like this for Aeternity: Welcome to the course!
You can code while you learn. It is a very useful tool for developers to get easily on-boarded to anything while watching the videos - code while you learn kinda proceess.
You may have to Sign up to scrimba to view what I am talking about, but if anyone is game, I am happy to co-work to create something like this.

1 Like