Ryder Simulator Tutorial

Ryder V2 prototype

Intro

Pre-requisite

Download and setup

npm install -g @lightlabs/ryder-cli-proto
ryder-cli-proto –-help
Documents/Ryder
cd Documents/Ryder/ryder-sim-v2-linux-x86_64
./ryder-sim-v2-linux-x86_64
RyderProto_V2 Simulator starting. 
Opened virtual serialport on: /dev/pts/1

Setting up device

ryder-cli-proto setup -R '/dev/pts/1'
ryder-cli-proto export identity 0 https://ryder.id -R '/dev/pts/1'

RyderSerial JS library

npm install @lightlabs/ryderserial-proto
const RyderSerial = require('ryderserial-proto');
let ryder_port = '/dev/pts/1';
const options = {
reconnectTime: 1000, // how long to wait before reconnect (ms).
debug: true // enable debug output to stdout.
};
const ryder_serial = new RyderSerial(ryder_port, options);
ryder_serial.on('open', async ()=>
{
const response = await ryder_serial.send(RyderSerial.COMMAND_INFO);
console.log(response);
const appkeyresponse = await request_app_key(0, 'https://ryder.id');
console.log(`Response: ${appkeyresponse}`)
});
async function request_app_key(identity_number,app_domain){
const data = [RyderSerial.COMMAND_EXPORT_APP_KEY,identity_number];
const response = await ryder_serial.send(data);
if (response === RyderSerial.RESPONSE_SEND_INPUT)
{
// Send the app domain terminated by a null byte.
const app_key = await ryder_serial.send(`${app_domain}\0`);
// app key will be RyderSerial.RESPONSE_REJECTED if the user
// presses Cancel, otherwise the response will be in the following
// format:
// "https://ryder.id,app_key_here"
return app_key;
}else{
console.log('Signin rejected by user');
}
}

Get going

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store