Remote Control App
Requirements
Node.js 8 (not higher) and npm
make
cmake
g++
You should create a new terminal session before following steps. The previous session you used has been customised for the DIGI toolchain and cannot be used to build a Node.js application.
Installation
install requirements
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - && sudo apt-get install -y nodejs sudo apt-get install -y make cmake g++from the root of the project
dev-demoscd app/serverinstall package
npm installdownload and install latest Litecoin TestNet headers database (more information)
npx ltc-backup install testnet -t nodeHome
Run the application
set and export an environment variable with the information needed from the application. This information was prepared by the UniquID CLI when you run the
uniquid deploy awscommand. The information was stored on the file~/aws_device_cfg.jsonRun the command:export AWS_AGENT_CONFIG=$(cat ~/aws_device_cfg.json)check the correct setup with:
echo $AWS_AGENT_CONFIGstart the application
npm startdeploy a contract between the board (provider) and the application (user) with the following functions enabled:
34 set led status (on/off)
35 read led status (on/off)
[ { "provider": "tpubXXXXX", "user": "tpubYYYYY", "functions": [34, 35] } ]interact with the device
if you are working on the EC2 instance
create a security group to open port
3000open browser to
http://<ec2-ip-address>:3000
if you are working on your local machine
open your browser on
http://localhost:3000
Last updated