konsultaner / connectanum-dart

This is a WAMP client (Web Application Messaging Protocol) implementation for the dart language and flutter projects.
MIT License
22 stars 14 forks source link

v1.1.5 doesn't work .. #28

Closed oberstet closed 3 years ago

oberstet commented 3 years ago

with our test endpoint: it immediately reconnects (server side succeeds, client reconnects)

Bildschirmfoto von 2021-03-23 18-23-29

my branch does work:

Bildschirmfoto von 2021-03-23 18-25-01

oberstet commented 3 years ago

sorry, I don't have time to track this down - we'll continue using my branch for now, but obviously, would be great to have a working release on https://pub.dev/packages/connectanum/

konsultaner commented 3 years ago

Is it possible for me to connect to your testendpoint? Would make it easier to find the issue. You can also email credentials if needed.

oberstet commented 3 years ago

sorry, had a call. anyways, easiest would be to just "onboard" yourself. here is how:

install autobahn:

pip install autobahn[all]

on linux, you also could use https://download.crossbario.com/xbrnetwork/linux-amd64/xbrnetwork-latest (which is a single-file executable with everything, incl. python)

check:

xbrnetwork version

start onboard:

xbrnetwork register-member \
    --url ws://thingcloud-box-aws.sthngs.crossbario.com:8090/ws \
    --username=oberstet2 \
    --email=tobias.ober.stein@gmail.com

hit enter (select default) for everything asked

you should get an email. with codes - complete onboard:

xbrnetwork register-member-verify \
    --vaction=02bd637f-cc7a-4ed4-bab5-5dfd3f9ca091 \
    --vcode=4JEJ-EHH3-6ETW

IMPORTANT: the email sends you the complete command to be run, but you have to remove --url <URL> (not needed)

then:

xbrnetwork get-member

you now can test against the URL, and using the key stored in ~/.xbrnetwork/config.ini

I just retried, here is a complete log: https://gist.github.com/oberstet/db0cc73974ba21f20127fc59073769a2

oberstet commented 3 years ago

for windows, this reduced set should work:

pip install autobahn[twisted,serialization,xbr]

I can't test, as I don't have windows anymore. I've tested above on Linux (and it works): https://gist.github.com/oberstet/e0e5d993ef42f0dafa101463127172d8

rgd the single-file EXE for windows: in principle, that is possible, and I guess I could make it work. but I would expect this to cost at least half a day .. hard to justify for me now. why are you using a broken OS? ;)

konsultaner commented 3 years ago

why are you using a broken OS? ;)

I know... don't ask me. I just never switched. 🙈

konsultaner commented 3 years ago

rgd the single-file EXE for windows: in principle, that is possible, and I guess I could make it work.

dont worry I'll get it to run somehow.

konsultaner commented 3 years ago

INFO: pip is looking at multiple versions of requests to determine which version is compatible with other requirements. This could take a while.

This takes for ever. Any idea on how to speed this up. I had it run for 8h and it would not finish.

oberstet commented 3 years ago

yes, use pip<20

https://github.com/crossbario/crossbar/blob/b4172870d077a147d5854d3aa8f5a8168e319c22/requirements-dev.txt#L17

the reason is: pip >= 20 hjas introduced a braindead new dependency resolver that doesn't really work (for dependency graphs with multiple confluent paths to the same dependent)

konsultaner commented 3 years ago

yes, use pip<20

this worked!

I can't call the xbrnetwork version command. xbrnetwork is unknown executable. Do I have to call it through python? I've never used python in production. I'm a dead beginner here..

oberstet commented 3 years ago

try: python -m autobahn.xbr._cli version

(cpy392_1) oberstet@intel-nuci7:~$ which xbrnetwork
/home/oberstet/cpy392_1/bin/xbrnetwork
(cpy392_1) oberstet@intel-nuci7:~$ xbrnetwork version

 XBR CLI v21.3.2.dev3

   Contract addresses:

      XBRToken   : 0x87D89D00B0051E760b23a1eb7F87D38082773b55 [source: envvar $XBR_DEBUG_TOKEN_ADDR]
      XBRNetwork : 0x3970CB7F43A5A6a1ABc4f1B80D33093396b1dB4a [source: envvar $XBR_DEBUG_NETWORK_ADDR]
      XBRDomain  : 0x048137A22c3a2Df514657C9B7a32A6BEefb10ad4 [source: envvar $XBR_DEBUG_DOMAIN_ADDR]
      XBRCatalog : 0xb996F03C79574aA7a88abe8F4080b1F3F9dB8E17 [source: envvar $XBR_DEBUG_CATALOG_ADDR]
      XBRMarket  : 0xF7acf1C4CB4a9550B8969576573C2688B48988C2 [source: envvar $XBR_DEBUG_MARKET_ADDR]
      XBRChannel : 0x54037382294a7AEe37F799776C2308D087946c13 [source: envvar $XBR_DEBUG_CHANNEL_ADDR]

(cpy392_1) oberstet@intel-nuci7:~$ python -m autobahn.xbr._cli version

 XBR CLI v21.3.2.dev3

   Contract addresses:

      XBRToken   : 0x87D89D00B0051E760b23a1eb7F87D38082773b55 [source: envvar $XBR_DEBUG_TOKEN_ADDR]
      XBRNetwork : 0x3970CB7F43A5A6a1ABc4f1B80D33093396b1dB4a [source: envvar $XBR_DEBUG_NETWORK_ADDR]
      XBRDomain  : 0x048137A22c3a2Df514657C9B7a32A6BEefb10ad4 [source: envvar $XBR_DEBUG_DOMAIN_ADDR]
      XBRCatalog : 0xb996F03C79574aA7a88abe8F4080b1F3F9dB8E17 [source: envvar $XBR_DEBUG_CATALOG_ADDR]
      XBRMarket  : 0xF7acf1C4CB4a9550B8969576573C2688B48988C2 [source: envvar $XBR_DEBUG_MARKET_ADDR]
      XBRChannel : 0x54037382294a7AEe37F799776C2308D087946c13 [source: envvar $XBR_DEBUG_CHANNEL_ADDR]

(cpy392_1) oberstet@intel-nuci7:~$ 
konsultaner commented 3 years ago

Where do I get:

oberstet commented 3 years ago

^ for the purposes of testing WAMP-cryptosign, you can just connect not to any "data market" (but see below), instead to global realm xbrnetwork - in which case market URL isn't needed and any Eth key (such as one random generate when running xbrnetwork CLI) can be used

once you have onboarded via above command, additionally, a member realm member-<member_uuid> is created and dynamiclly started. the port number of this data plane is 8080, other than the 8090 where the xbrnetwork realm is running

you can just use the URL with 8080, provide no realm at all, and let the router autodetect and join your client session to your personal realm

konsultaner commented 3 years ago

What can I do with that? no such profile: "default"

oberstet commented 3 years ago

could you fix the library or should we continue to use my fork?

konsultaner commented 3 years ago

I'm trying to get xbrnetwork to run. But I'm stuck with this:

What can I do with that? no such profile: "default"

image

konsultaner commented 3 years ago

This is actually not a bug. You used connectanum-dart in a test (what I recommended). The problem here is that if the testcase has has been executed, the test suite of dart interrupts all connections. This way we get a "connection loss". the client reconnects with the initial attempt count. Since the first retry works the reconnect count is reset again to the inital count -> infinte reconnect. Since this is no real live scenario, its not a bug.

oberstet commented 3 years ago

ich habe https://github.com/oberstet/scratchbox/blob/master/flutter/ex1/test_client_wampcs.dart verwendet, und das geht mit meinem branch, aber nicht mit master ...

https://github.com/oberstet/scratchbox/blob/1e1311096c23941a2b88c0853fe83352ca5a3b79/flutter/ex1/pubspec.yaml#L10

does test_client_wampcs.dart work for you?

konsultaner commented 3 years ago

I found the issue. It was the already discussed authextra. You send it as <String,dynamic> but I need it as <String,String>. What do you think? I kind of want to go to <String,dynamic>. Apart from that I have a really bad logging issue here. There is basically no logging at all. I should add a lot of logging to trace issues like that quicker...

image

oberstet commented 3 years ago

the top-level keys in authextra MUST be strings. everything else, that is top-level values or keys (!) of nested dicts, MAY be anything. I don't care what type the library uses internally to make Dart accept that. if it doesn't accept it, it is non-compliant / broken for our use though ...

konsultaner commented 3 years ago

I changed it. The current master will work with your code.

oberstet commented 3 years ago

let me test the master branch from this repo ..

oberstet commented 3 years ago

yes, can confirm: works with master! fantastic=)

Bildschirmfoto von 2021-03-25 23-28-25