git clone [email protected]:teonet-co/teonpcli.git
cd teonpcli
git submodule update --init --recursive
Last version of the project used some different versions of submodules. If you need switch to latest versions of submodules use next git command:
git submodule update --remote --merge
The main Projects Goal is Creating native Web | Phonegap | Node Teonet Client which used basic C/C++ teonet client to connect to Teonet L0 server.
Todo this we create complecs client with several components (see picture abow):
- JS from C/C++ Teonet client "Teonet C++JS L0 Client";
- JS from C/C++ Teonet connector "C++JS L0 Server";
- JS from C/C++ Teonet proxy "Teonet C++JS L0 Proxy";
- C/C++ Teonet native client Node module "Teonet C ++ Native Node L0 Client".
To create JS from C/C++ we uses Emscripten to Compile our existing projects written in C or C++ and run them on all modern browsers. Emscripten is an LLVM-based project that compiles C and C++ into highly-optimizable JavaScript in asm.js format. This lets us run C and C++ on the web at near-native speed, without plugins.
To execute Emscripten on different platforms without setup we use docker image from trzeci:
To execute emcc comiller from container use next command:
docker run --rm -v $(pwd):/src trzeci/emscripten:sdk-tag-1.37.3-64bit emcc
To compile single C/C++ file to JS it could be called like:
docker run --rm -v $(pwd):/src trzeci/emscripten:sdk-tag-1.37.3-64bit emcc helloworld.cpp -o helloworld.js
This component source code are placed in teocli submodule. Native C++JS clients example connected to the C++JS L0 Server so start it first to see correct examples output.
# goto folder
cd teocli/emscripten
# build JS for c/c++ sources
./emscripten.sh
# run example
node main_select.js teocli++js gt1.kekalan.net 9010 ps-server
\TODO
\TODO
\TODO