Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Speculos mobile bot test on iOS only #1931

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

henri-ly
Copy link
Contributor

@henri-ly henri-ly commented May 4, 2022

This introduce the ability to run the "Bot" in the React Native mobile tech stack.

There's 3 parts on this PR to take care : bot-speculos-proxy, bot-proxy-log and bot-react-native

bot-speculos-proxy

This part give the ability to speculos to be used as a service and can be host on an external server. It was created because speculos as we used it today, was only possible with node and docker.

You have to ran it with the CLI :
so to install it you will need to

yarn install
yalc publish
cd cli
yalc add @ledgerhq/live-common
yarn install

Usage:

SEED="<YOURSEEDHERE>" COINAPPS="<COINAPPSFOLDERHERE>" node ./bin/index.js botSpeculosProxy -p 4377 -t tokentorestrictusage

as -t is a token that you will need to provide on the env BOT_SPECULOS_PROXY_TOKEN when you run the mobile app.

bot-proxy-log

Is will store all the log of the bot into a proxy logger.
Same install as above.

Usage:

BOT_LOG_PROXY_FILE: ../botreport/logs.txt node ./bin/index botLogProxy -p 8331

bot-react-native

This part is an react-native project with just ledger-live-common installed and all the minimal dependency he needs to make it run.

When you launch the app, it will try to run on theses settings from the .env:

SPECULOS_SERVICE_WS="ws://localhost8435"
SPECULOS_SERVICE_HTTP="http://localhost:4377"
BOT_LOG_SERVICE="ws://localhost:8331"
BOT_SPECULOS_PROXY_TOKEN=tokentorestrictusage

So you will need to set an .env before running the project.

install:

yarn install
yalc publish
cd bot-react-native
yalc add @ledgerhq/live-common
yarn install

for iOS:

cd ios
pod install
cd ..
yarn run ios

for android:

yarn run android

for the CI we are using Detox to make it ran, it's seems to work fine on iOS, we still have some issues with Android.

What left to do :
[] Try to export the Speculos As A Service on a Vercel, and used it as an API (have to see if it's doable first)
[] Make Android test work on CI
[] Make iOS work again on CI

@henri-ly henri-ly requested a review from a team May 4, 2022 12:33
@henri-ly henri-ly requested a review from a team as a code owner May 4, 2022 12:33
@vercel
Copy link

vercel bot commented May 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ledger-live-common ❌ Failed (Inspect) May 5, 2022 at 0:12AM (UTC)

@henri-ly henri-ly changed the title Poc speculos mobile bot (#1824) Speculos mobile bot test on iOS only May 4, 2022
change workflow

change algorand-ios branch to trigger on ci

remove android on the onpush

lint

update ios workflow with cache

change bot prefer-offline

retry ios with yalc

try rerun ios
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant