Skip to content

wizadr/kernel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web3OS

"The computer can be used as a tool to liberate and protect people, rather than to control them." -Hal Finney

Launch web3os.sh


Netlify Status Version Site Status Last Commit Open issues Closed issues

Sponsors Contributors GitHub license PRs Welcome Discord Observatory Grade

Twitter Reddit Medium Facebook Youtube

Followers Watchers Stars

A developer-friendly ecosystem of apps designed to build a crypto-focused web-based operating system. The goal is for the entire system to run within any modern browser, while having the capability to connect to backend systems for more features.

The project is still very young, and proper documentation and organization is Coming Soon™.



Features

  • Web-based terminal with xterm.js
  • Web3 wallet integration with web3 and ethers.js
  • Fully in-browser filesystem with BrowserFS
  • Sexy dialogs with sweetalert2
  • Slick windowing system with WinBox
  • Developer-friendly: apps are just HTML/CSS/JS
  • Optional desktop environment

Alpha Footage

Here's a quick video showcasing a few of the features: web3os alpha demo Watchers

Disclaimer

This project is still considered to be in an alpha state. All apps run in the same context and can access every other app, as well as the entire browserfs.

Do not rely on it to keep anything safe, and never paste commands you don't understand. Anywhere, ever.

User Quickstart

  • Visit https://web3os.sh
  • Type help
  • Type ls /bin
  • Edit a file: edit /tmp/test.txt
  • Launch the desktop: desktop
  • Launch the file explorer: files
  • Launch a browser: www https://instacalc.com
  • Show your ETH address: account
  • Check native coin balance: account balance
  • Check token balance: account balance USDC
  • Learn more about commands: help command
  • Run the screensaver: screensaver
  • 🎉 Fire the Confetti Gun: confetti

Developer Quickstart

git clone git@github.com:web3os-org/kernel.git
cd kernel
yarn # or npm install
yarn start # or npm start

From here, simply connect to https://localhost:8080 and accept the self-signed certificate warning.

Scripting

Web3os scripts (.sh) are a simple line-by-line execution, while Javascript (.js) offers far more power.

To run a web3os script: sh /path/to/script.sh

  • Or from an app: window.kernel.executeScript('/path/to/script.sh')

To run a Javascript script: eval /path/to/script.js

  • Or from an app: window.kernel.execute('eval /path/to/script.js')

Kernel Interface

This (and everything else) is subject to change before version 1.0.

Also, expect undocumented methods.

window.kernel.bin { name: app }

  • Contains all apps registered in the kernel
  • e.g., window.kernel.bin.desktop.run()

window.kernel.wallet.web3 :Web3Provider

  • The web3 provider setup with the account command

window.kernel.wallet.account { address: '0x..', chainId: 1 }

  • You may also interact directly with the account app.
    • e.g., window.kernel.bin.account.connect()

window.kernel.dialog ({ ...sweetalert2options })

  • Convenience method to create a sweetalert2 dialog with appropriate defaults
  • e.g., window.kernel.dialog({ title: 'Are you sure?', text: 'Scary stuff!', icon: 'warning' })

window.kernel.set ('namespace', 'key', :any)

  • Sets a value in the kernel "memory" - persists in localStorage
  • e.g., window.kernel.set('user', 'name', 'hosk')
  • e.g., window.kernel.set('myapp', 'theme', { color: 'rebeccapurple' })

window.kernel.get ('namespace', 'key')

  • Gets a value from the kernel "memory" - loaded from localStorage
  • e.g., window.kernel.get('user', 'name')
  • e.g., const { color } = window.kernel.get('myapp', 'theme')

App Structure

Developers should be able to create apps in any way they like, with as few requirements as possible. Remember, your app is simply running in a browser - you have access to everything that any other script does.

Here is the structure of a very minimal app:

export const name = 'myapp'
export const version = '0.1.0'
export const description = 'My application'
export const help = `
  Myapp enables developers to Do An App!

  Usage: myapp <options>        Run myapp with some options!
`

export async function run (terminal, context) {
  console.log(terminal) // the xterm.js terminal in which your app is running
  console.log(context) // the plain string of arguments passed to your app
  terminal.log('Thanks for checking out myapp!')
  terminal.log(context)
}

A good example of a more full-featured app can be found in src/bin/confetti/index.js.

TODO

  • There's a lot to do 😅
  • Decoupling of built-in apps into their own packages
  • Finish the packaging system to be able to install apps
  • Some apps are really just placeholders and don't yet have full functionality
  • Adding more things to this list

Further Documentation

Further documentation will soon be available at https://docs.web3os.sh

About

The OS for Web3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 91.4%
  • CSS 8.2%
  • HTML 0.4%