D2.2 update

No, it means what you said about the service. Actually some CLI where you can pipe in some random message would be perfect. Then we can just send “Hello, world.” and it goes through. That’s perfect.

@Nemael could you look into this code and extract the encoding part so we can have just that? I can imagine something like this: cat file.txt | upsycle-send mr-a.dream.public.cat that writes out the response from the router.

All right. The thing is, is that we already have services; although they do not work
exactly as you describe (you cannot give a string or a file.txt as argument for a message),
but they send random messages (some of the arguments are randomly generated) to MR’s after key-strokes.
Tweaking this service to do what you want (i.e. be able to give a file.txt as argument) would be way easier than to write a new service, since the whole ‘establishing a connection’, and 'make a valid message from a string" part is already done there.

1 Like

Having a simple way to demonstrate a “live message” among random ones would offer a great confirmation for the sceptical mind. Another step would be for the destination service to be able to print it out in the log once it received it, or somehow display the content of this specific message, I guess that would require a specific destination service that not only count messages but decodes them.

Sure, I agree with that. The printing step we already have. It is printed on the screen right now; you should be able to find it once you have an MR and a service running (e.g. MR a and Svc a1), and send a message from the service to the MR (use h for a help message to see how to do this).
I guess it would be good to do a git pull and opam install --deps-only --with-test . in the upsycle-router directory, to be sure that h works.
The body of the message can be seen in the screen of the MR.

Great that you’re doing this.

Fixed by 537bf05

2 Likes

@how if I understand correctly you want to simulate what the keyboard does, without needing a keyboard, so you can demonstrate different scenarios. Yes we can do this. I think a TCP socket would work better than signals, also because it needs to work between machines and not just on the same machine.

So your ‘file.txt’ consists of, say:

# --- contents of file.txt:
n
n
n

and then you want to do

cat file.txt | upsycle-send mr-a.dream.public.cat

and it will have the same effect as if you had pressed ‘n n n’ on the keyboard. Is this correct?

Great that you made a fix quickly! Thank you.

Yes, that’s a first step, and the description you make is correct. Let’s go for it.

BTW, once we have this in place, what’s the catch of having the services talk to each other on their own?

Could you clarify? 󠀠󠀠฀󠀠

See the new configuration field ‘control-interface’ in the message router yaml files. If it’s lets’s say 7001, then you can do:

echo 'n' | nc localhost 7001

which will have the same effect as pressing n.

1 Like

In bash this might be:

upsycle-send () {
  local host=$1
  local port=$2
  local line
  while read line; do
    nc "$host" "$port" <<< "$line"
  done
}
cat > file.txt # e.g. n<enter>S<enter><ctrl-d>
cat file.txt | upsycle-send 127.0.0.1 7001

But to make a nice demo you probably want to send a few commands to the message router A, then to service A1, then to the message router or another service, etc. It might an idea to make a little DSL for this.

s-a1 j # join multicast groups
sleep 5
s-a1 m # send multicast update
mr-a S

with mappings mr-a=mr-a.dream.public.cat:7001, s-a1=dmc-1.dream.public.cat:nnnn in another file.

and then eventually

s-a1 join-multicast-groups <key1> <key2>
sleep 5
s-a1 send-multicast <key1> "hello this is a DMC update"
mr-a show-state

and so on.

1 Like

Although I have gmp installed, I get:

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of conf-gmp failed at "/home/dream/.opam/opam-init/hooks/sandbox.sh build sh -exc cc -c $CFLAGS -I/usr/local/include test.c".

#=== ERROR while compiling conf-gmp.3 =========================================#
# context     2.0.8 | linux/x86_64 | ocaml-system.4.12.0 | https://opam.ocaml.org#b7eb40e7
# path        ~/.opam/default/.opam-switch/build/conf-gmp.3
# command     ~/.opam/opam-init/hooks/sandbox.sh build sh -exc cc -c $CFLAGS -I/usr/local/include test.c
# exit-code   1
# env-file    ~/.opam/log/conf-gmp-75590-e1320e.env
# output-file ~/.opam/log/conf-gmp-75590-e1320e.out
### output ###
# + cc -c -I/usr/local/include test.c
# test.c:1:10: fatal error: gmp.h: No such file or directory
#     1 | #include <gmp.h>
#       |          ^~~~~~~
# compilation terminated.



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build conf-gmp 3
└─
╶─ No changes have been performed

Looks like it’s missing a dev library. On Debian it would be called libgmp-dev, dunno about Alpine.

It's NixOS. I installed the gmp` package derivation.

So, anyway, just in passing. NixOS 21.05 on the Hetzner Cloud was broken. Now it’s fixed.

5 posts were split to a new topic: Upsycle-router on Alpine Linux

Please note that the commands to generate the keys and to run the components have changed slightly:

The new commands are

example/gen-keys-and-certs
example/run-message-router { a | b | c }
example/run-service { a1 | a2 | a3 | b1 }

(example can also be abbreviated ‘eg’)

Sorry for the late change but it was necessary to properly separate the examples from the non-examples.

1 Like

I guess you mean a1 | a2 | a2 | b1 :slight_smile:

Thank you for this and the Dockerfile.

Today we’re meeting with DataPlayers to discuss RDF. Will look at it tomorrow then. Have a nice day!

thanks, fixed.󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠󠀠

1 Like

I’m wondering where the TLS certificates go, so I can copy them from mr-a to mr-b and mr-c. Or are they consistent between hosts (unlikely)?