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

For test purposes there is no need to have a fully synced node, on the contrary: you can spin a test node instead so you test with some faster mining and preset accounts…

1 Like

that’s great to know @dimitar.chain thanks a lot, so @gyan0890 this should be real quick to get

Hey folks, I installed the local node on my system but running it gives some errors. Some kind of crash report is generated like this:
2021-02-19 16:51:21.692088 crash_report #{label=>{proc_lib,crash},report=>[[{initial_call,{supervisor,kernel,[‘Argument__1’]}},{pid,<0.1210.0>},{registered_name,},{error_info,{exit,{on_load_function_failed,emcl_nif},[{init,run_on_load_handlers,0,},{kernel,init,1,[{file,“kernel.erl”},{line,212}]},{supervisor,init,1,[{file,“supervisor.erl”},{line,295}]},{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}]}]}},{ancestors,[kernel_sup,<0.1183.0>]},{message_queue_len,0},{messages,},{links,[<0.1185.0>]},{dictionary,},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,265}],]}^M

I am unable to access the node using the curl command. I did not setup any configuration. Just installed the mac binary I downloaded from github.

I installed 5.8.0 for mac.

Please install libsodium and openssl 1.0
We will soon improve the situation :slight_smile:

2 Likes

@gorbak25 : I had already installed them to run the ae channel service.Womdering if I should re-install? :thinking:

it does indeed complain about the libsodium…

Re-installed libsodium. Same crash dump error - now trying docker testnet.
2021-02-19 20:28:10.043274 crash_report #{label=>{proc_lib,crash},report=>[[{initial_call,{application_master,init,[‘Argument1’,‘Argument2’,‘Argument3’,‘Argument4’]}},{pid,<0.1182.0>},{registered_name,},{error_info,{exit,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,emcl_nif}}},{kernel,start,[normal,]}},[{application_master,init,4,[{file,“application_master.erl”},{line,138}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,249}]}]}},{ancestors,[<0.1181.0>]},{message_queue_len,1},{messages,[{‘EXIT’,<0.1183.0>,normal}]},{links,[<0.1181.0>,<0.1180.0>]},{dictionary,},{trap_exit,true},{status,running},{heap_size,610},{stack_size,27},{reductions,193}],]}^M
2021-02-19 20:28:10.045124 std_info #{label=>{application_controller,exit},report=>[{application,kernel},{exited,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,emcl_nif}}},{kernel,start,[normal,]}}},{type,permanent}]}^M
{“Kernel pid terminated”,application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,emcl_nif}}},{kernel,start,[normal,]}}}"}^M
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,kernel_safe_sup,{on_load_function_failed,emcl_nif}}},{kernel,start,[normal,]}}})^M
^M
Crash dump is being written to: erl_crash.dump…done^M

Hi all,
While trying to run the coin toss game, there is another error that I faced on the ae-channel service:

[info] Starting backend session {{:responder, #Function<12.122127441/2 in SessionHolderHelper.custom_config/2>, {"", 0}, #Function<5.112218790/0 in AeChannelInterfaceWeb.ConnectController.new/2>}, -576460752303423488} pid is #PID<0.2705.0>

[info] got channel id: {"", 0}

[info] Starting session holder, #PID<0.2706.0>

[info] File_name is “data/responder_ak_cFBreUSVWPEc3qSCYHfcy5yW2CWkbdrPkr9itgQfBw1Zdd6HV”

[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”

Attaching a screenshot of the error found on the browser console as well.

1 Like

I am running the aenode using docker on my system and here is the docker command that I used:
*docker run -p 3013:3013 -p 3015:3015 *

*-v ~/.aeternity/maindb:/home/aeternity/node/data/mnesia *

aeternity/aeternity

I am wondering how port 3014 is coming into picture. I checked the environment.prod.ts file in the coin toss game app and it is wired to find the channel at 3014 port - but it’s unable to find as aenode is running on 3013 and 3015 I suppose? But I don’t know which one to change it to - 3013 or 3015?

@dimitar.chain @ae-omar

One more question, what should the SC_NODE_URL point to?
Currently, it’s pointing to localhost:3014

Well, again, unless you’ve changed the default values, the endpoints would live under the following defaults:

  { aehttp, [
      {external, [
          {acceptors, 10},
          {port, 3013}
          ]},
      {internal, [
          {acceptors, 10},
          {port, 3113},
          {debug_endpoints, true}
          ]},
      {channel, [
          {websocket, [ {port, 3014},
                        {handlers, 100}, 
                        {listen_address, <<"0.0.0.0">>}
                      ]}
          ]}
  ]},

So by default, State Channels WebSockets live behind port 3014. As you can see, port 3013 is being used for external HTTP APIs. What relates to port 3015 - this is the default sync port. If you want your node to be able to sync with others (not required for demo), you must make this port publicly available. In the case of the demo - you need only ports 3013 (external APIs) and 3014 (ws) to be exposed from the docker. Again, those are defaults you can change in the config.

1 Like

How do I expose port 3014 from docker? Please help.

docker ps, gives the following output:
29ea3f13bccd aeternity/aeternity “bin/aeternity conso…” 22 hours ago Up 22 hours (healthy) 0.0.0.0:3013->3013/tcp, 3014/tcp, 0.0.0.0:3015->3015/tcp, 3113/tcp serene_dijkstra

docker run -p 3013:3013 -p 3014:3014 \
    -v ~/.aeternity/maindb:/home/aeternity/node/data/mnesia \
    aeternity/aeternity

and if you have a running container, you should probably stop that first :slight_smile:

Yep, tried this now - started the new docker instance with port 3014 exposed. Now, working on the ae-channel-service - restarted that(just in case). Will keep you updated :slight_smile:

3 Likes

It was not that hard but yes, having it documented better would be great. @gyan0890 care for doing that maybe?

Sure, I would be happy to document it, once I get it up and running. My ae-channel-service is still building - it’s been a couple of hours. But it generally takes time on my machine - about 6+ hours or so.
It’s like here right now:
[ 4%] Building CXX object CMakeFiles/rocksdb.dir/db/c.cc.o
[ 4%] Building CXX object CMakeFiles/rocksdb.dir/db/column_family.cc.o

Once the ae-channel-service is up, I would have to run the coin toss game again and see if it works(since I opened the 3014 port from docker now).