Skip to content

Commit

Permalink
Getting started (#16)
Browse files Browse the repository at this point in the history
* adding docs for building and running on an emulator

* updating summary

* adding to docs

* tweaks

* getting started docs

* mdl tweaks

* cleared m009s

* more tweaks

* auto format with mdformat

* disagree with rule

* conforming to style guide
  • Loading branch information
trbutler4 authored Aug 1, 2024
1 parent b17b9be commit 8ae93f2
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 7 deletions.
3 changes: 3 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
- [Introduction](./README.md)

- [Overview](./overview/README.md)

- [Getting Started](./getting-started/README.md)

- [Building the OS](./getting-started/building-the-os.md)
40 changes: 40 additions & 0 deletions docs/src/getting-started/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# Getting Started

## Install Android Studio

Most development, at least starting out, will be on the 3
android applications that form the core of the starknet
phone: light client, wallet, and browser.

Installing the build:

1. Install [Android Studio](https://developer.android.com/studio/install).
1. Create a new pixel device with the latest android SDK. Follow the

instructions [here](https://developer.android.com/studio/run/managing-avds)

1. Create a fork of this repository, and open the application in Android Studio.
1. Refer to the [contribution guide](<>) for any contributions.

## Installing on an emulator

NOTE: We are still working to provide an image for download. For now,
development on any of the applications can be done on a generic android OS.

Steps to install on an emulator:

1. Download a zip file of the image.
1. Make sure [Android Studio](https://developer.android.com/studio/install) is installed.
1. Navigate to the Android SDK install location. On mac this default to `Library/Android/sdk`

```bash
cd Library/Android/sdk
```

Create a new directory called "android-32", and inside that directory create
a new directory called "default"

```bash
mkdir android-32/default
```

Extract the zip file of the OS image to the newly created "default" directory
78 changes: 78 additions & 0 deletions docs/src/getting-started/building-the-os.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Building the OS

## Build Dependencies

Baseline build dependencies:

- x86_64 Linux build environment.
- 32GiB of memory or more. Link-Time Optimization (LTO) creates huge peaks
during linking and is mandatory for Control Flow Integrity (CFI). Linking
Vanadium (Chromium) and the Linux kernel with LTO + CFI are the most memory
demanding tasks.
- 100GiB+ of additional free storage space for a typical build of the entire
OS for a multiarch device.

More detailed dependiencies and build guide can be found
[here](https://grapheneos.org/build)

## Downloading the source code

### Development Branch

Starknet Phone forks the '14' branch of grapheneOS, which is the main
development branch of GrapheneOS.

```bash
mkdir starknet-phone-os
cd starknet-phone-os
repo init -u \
https://github.com/suffix-labs/snphone_platform_manifest/tree/14 -b 14
repo sync -j8
```

### Emulator builds

NOTE: must be done from bash or zsh

set up build environment

```bash
source build/envsetup.sh
```

set the build target

```bash
lunch sdk_phone64_x86_64-cur-eng
```

start the build. This can take multiple hours to run.

```bash
m
```

### Adding prebuilt binaries

#### Emulator

sync repo

```bash
mkdir -p android/kernel/6.1
cd android/kernel/6.1
repo init -u https://github.com/GrapheneOS/kernel_manifest-6.1.git -b 14
repo sync -j8
```

build the kernel image and modules for the emulator

```bash
ARCH=x86_64 common/build_virt.sh
```

replace the prebuilts in the OS source tree

```bash
ANDROID_BUILD_TOP=~/starknet-phone-os ARCH=x86_64 common/update_virt_prebuilts.sh
```
10 changes: 3 additions & 7 deletions docs/src/resources/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# Resources

## Resources

### Ethereum Phone
## Ethereum Phone

[Ethereum Phone platform manifest](https://github.com/EthereumPhone/platform_manifest)

[wallet sdk](https://github.com/EthereumPhone/WalletSDK)

[light node app](https://github.com/EthereumPhone/lightnodeapp)

### GrapheneOS
## GrapheneOS

[GrapheneOS Docs](https://grapheneos.org/build#build-dependencies)

[building graphene os](https://grapheneos.org/build)

0 comments on commit 8ae93f2

Please sign in to comment.