Introduction
Search…
Setup JS Virtual Device
Please refer to the README in the repo for further informations

Install Prerequisites

Install these packages on your machine
1
sudo apt-get install -y cmake make g++
Copied!

AWS JS Device

  1. 1.
    Clone the aws-virtual-device-js repo:
    1
    git clone https://github.com/uniquid/aws-virtual-device-js
    Copied!
  2. 2.
    cd to the project directory
    1
    cd aws-virtual-device-js/
    Copied!
  3. 3.
    Install the package
    1
    npm install
    Copied!
  4. 4.
    Download and install latest Litecoin testnet headers Database (more information)
    1
    npx ltc-backup install testnet -t data
    Copied!

Run the JS Device

Please assure this step has been done before starting the device
  1. 1.
    Set and export an environment variable with the information needed from the virtual device. This information was prepared by the UniquID CLI when you run the uniquid deploy aws command. The information was stored on the file ~/aws_device_cfg.json Run the command:
    1
    export AWS_AGENT_CONFIG=$(cat ~/aws_device_cfg.json)
    Copied!
  2. 2.
    Check the correct setup with:
    1
    echo $AWS_AGENT_CONFIG
    Copied!
  3. 3.
    In the aws-virtual-device-js directory, run the command
    1
    npm start
    Copied!
The virtual device will start to check for a contract with the UniquID Authorizer until you create an UniquID Contract. When found, the device will start to try the connection to the AWS IoT. When the connection successful, device will start to publish on AWS IoT MQTT.
Last modified 2yr ago