Skip to content

Commit

Permalink
chore: migrate desktop to it’s own repo
Browse files Browse the repository at this point in the history
  • Loading branch information
blakebyrnes committed Sep 19, 2024
1 parent 64d87a9 commit ae0935d
Show file tree
Hide file tree
Showing 273 changed files with 220 additions and 23,613 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.json linguist-language=JSON-with-Comments
72 changes: 0 additions & 72 deletions .github/workflows/desktop.yml

This file was deleted.

21 changes: 19 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ jobs:
with:
go-version: '1.23'

- uses: actions/setup-python@v5
if: ${{ matrix.os != 'windows-latest' }}
with:
python-version: '3.10'

- name: Chocolatey Install Action
if: ${{ matrix.os == 'windows-latest' }}
uses: crazy-max/ghaction-chocolatey@v3
Expand All @@ -162,6 +167,16 @@ jobs:
if: ${{ matrix.os == 'windows-latest' }}
uses: microsoft/setup-msbuild@v2

- name: Clear space
if: ${{ matrix.os == 'macos-latest' }}
run: |
sudo rm -rf /Users/runner/Library/Android/sdk
sudo rm -rf /Users/runner/hostedtoolcache/CodeQL
sudo rm -rf /Users/runner/Library/Developer/CoreSimulator
sudo rm -rf /Users/runner/Library/Developer/Xcode/DerivedData
sudo rm -rf /Users/runner/Library/Developer/Xcode/iOS DeviceSupport
sudo rm -rf /Users/runner/Library/Developer/Xcode/watchOS DeviceSupport
- name: Clone Mainchain
shell: bash
run: |
Expand Down Expand Up @@ -189,13 +204,15 @@ jobs:
run: yarn build
working-directory: ../hero

- name: Set yarn config
run: yarn config set ignore-engines true && yarn config set frozen-lockfile true
- name: Install Deps
run: yarn config set ignore-engines true

- name: Yarn build
run: yarn build
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
ULX_MITM_REBUILD_SOCKET: 0
NODE_OPTIONS: --max_old_space_size=4096

- name: Redo mainchain deps
run: yarn
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This repository is the development home to several of the tools that make it eas

## Tooling

Try out Ulixee Desktop! The Alpha release is available for download under [Assets](https://github.com/ulixee/platform/releases/latest).
Try out [Ulixee Desktop!](https://github.com/ulixee/desktop). It's a helpful tool for developing and managing your Ulixee scripts.

### Docker

Expand All @@ -26,10 +26,9 @@ To use the image, we have a [run.sh](./cloud/tools/docker/run.sh) script that wi

## Developer Environment

This project serves as a Monorepo for developing the Ulixee Datastore, Desktop, Hero and Cloud. To install this project, you'll need to:
This project serves as a Monorepo for developing the Ulixee Datastore and Cloud. If you are developing, you might wish to have [hero][hero] as a project adjacent to this one.

1. Clone with `--recursive` so that submodules are initialized.
2. Run `yarn build:all` from the main repository.
1Run `yarn build:all` from the this repository to build all the projects.

Learn more about Ulixee at [ulixee.org](https://ulixee.org).

Expand Down
5 changes: 5 additions & 0 deletions client/docs/interface/payment-services.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Payment Services
> Ulixee Datastores come built-in supporting a simple payment mechanism using the Argon currency. Payment services allow you to delegate that function to someone else.
## Interface

2 changes: 1 addition & 1 deletion client/docs/overview/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ client.query(`SELECT * FROM developers WHERE status='founder'`).then(records =>

By default all query are read-only (i.e., they must be SELECTs) unless you have special admin privileges.

More details are available in the [Ulixee SQL specification docs](../../sql).
More details are available in the [Ulixee SQL specification docs](../../sql).
2 changes: 1 addition & 1 deletion client/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dependencies": {
"@ulixee/commons": "2.0.0-alpha.29",
"@ulixee/datastore": "2.0.0-alpha.29",
"@argonprotocol/localchain": "0.0.2",
"@argonprotocol/localchain": "0.0.4",
"@ulixee/net": "2.0.0-alpha.29",
"@ulixee/schema": "2.0.0-alpha.29"
},
Expand Down
4 changes: 1 addition & 3 deletions cloud/main/.env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ ULX_QUERY_HERO_SESSIONS_DIR=<DATA>/ulixee/query-hero-sessions

# A whitelist of comma separated identities (bech32 strings) who can administer this server [@ulixee/platform-utils/lib/Identity.bech32]
ULX_CLOUD_ADMIN_IDENTITIES=
# Payment Address of this Miner owner to pay out datastore revenue (bech32 string)
ULX_PAYMENT_ADDRESS=

## Hosted Services
ULX_DATASTORE_STATS_HOST=# Stats Tracker Service Host
Expand All @@ -49,7 +47,7 @@ ULX_ENABLE_GLOBAL_CONFIG=true

# Path to the localchain
ULX_LOCALCHAIN_PATH=
# Default mainchain host TODO: fill in once mainchain is up#
# Default Argon mainchain host TODO: fill in once mainchain is up#
ULX_MAINCHAIN_URL=
# A vote output address for the localchain (activates vote creation)
ULX_VOTES_ADDRESS=
Expand Down
2 changes: 1 addition & 1 deletion datastore/broker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@ulixee/cloud": "2.0.0-alpha.29",
"@ulixee/commons": "2.0.0-alpha.29",
"@ulixee/datastore": "2.0.0-alpha.29",
"@argonprotocol/localchain": "0.0.2",
"@argonprotocol/localchain": "0.0.4",
"@ulixee/net": "2.0.0-alpha.29",
"@ulixee/platform-specification": "2.0.0-alpha.29",
"@ulixee/platform-utils": "2.0.0-alpha.29",
Expand Down
4 changes: 1 addition & 3 deletions datastore/core/.env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ ULX_QUERY_HERO_SESSIONS_DIR=<DATA>/ulixee/query-hero-sessions

# A whitelist of comma separated identities (bech32 strings) who can administer this server [@ulixee/platform-utils/lib/Identity.bech32]
ULX_CLOUD_ADMIN_IDENTITIES=
# Payment Address of this Miner owner to pay out datastore revenue (bech32 string)
ULX_PAYMENT_ADDRESS=

## Hosted Services
ULX_DATASTORE_STATS_HOST=# Stats Tracker Service Host
Expand All @@ -32,7 +30,7 @@ ULX_ENABLE_GLOBAL_CONFIG=true

# Path to the localchain
ULX_LOCALCHAIN_PATH=
# Default mainchain host TODO: fill in once mainchain is up#
# Default Argon mainchain host TODO: fill in once mainchain is up#
ULX_MAINCHAIN_URL=
# A vote output address for the localchain (activates vote creation)
ULX_VOTES_ADDRESS=
Expand Down
2 changes: 1 addition & 1 deletion datastore/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@ulixee/commons": "2.0.0-alpha.29",
"@ulixee/datastore": "2.0.0-alpha.29",
"@ulixee/datastore-docpage": "2.0.0-alpha.29",
"@argonprotocol/localchain": "0.0.2",
"@argonprotocol/localchain": "0.0.4",
"@ulixee/net": "2.0.0-alpha.29",
"@ulixee/platform-specification": "2.0.0-alpha.29",
"@ulixee/platform-utils": "2.0.0-alpha.29",
Expand Down
74 changes: 74 additions & 0 deletions datastore/docs/advanced/databrokers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Databrokers

> Databrokers allow you to hide the details of Argon Localchain payment from your team or customers. Instead of each team member needing to manage their own Argon wallet, they can use a shared Databroker to access the data they need.
## How it works

Databrokers whitelist users and Datastore domains and allocate funds to the users (how you allocate funds is up to you). This can be done through an admin interface or by directly interacting with the Databroker API.

When a user requests data from a Datastore, the Databroker will automatically create an [Escrow](#escrows) for the user and Datastore with "delegated signing" activated. Delegated signing means the [Client](#client-usage) library will generate a signing key (a Schnorrkel x25519 private key), and will send the [Address](https://docs.substrate.io/reference/glossary/#ss58-address-format) as part of the request to the Databroker. It's now up to the Delegated Signing key to sign settlements for the Escrow.

## Client Usage

The client usage is through the normal Ulixee [Client](https://ulixee.org/docs/client) library. Assuming you have a Databroker account and identity registered, your code will look like this:

```typescript
import { Client } from '@ulixee/client';

const mainchainUrl = 'wss://rpc.testnet.argonprotocol.org';
const brokerAddress = 'wss://broker.testnet.ulixee.org';
const dataDomain = 'UsCPI.Stats/v1.0.0';
const paymentService = await DefaultPaymentService.fromBroker(brokerAddress, {
pemPath: 'path to your Identity pem file',
});
const client = new Client(`ulx://${dataDomain}`, {
paymentService,
mainchainUrl,
});
client.query(`SELECT * FROM publishingSchedule`).then(records => {
console.log(records);
});
```

## Server Installation

Databrokers are built to run as a CLI. A Datastore doesn't need to do anything special to support Databrokers. The Databroker CLI will automatically handle the Argon Localchain payment and data access at a client level.

```bash
npm install @ulixee/databroker
```

## Server Usage

You can start a Databroker using the CLI. There's an optional admin interface that allows you to easily manage users, organizations, and escrows. You can see an example of hiding this behind a reverse proxy <a href="https://github.com/ulixee/ulixee/blob/main/datastore/broker/nginx.conf" target=_blank>here</a>.

```bash
$ @ulixee/databroker start --port 8080 --hostname localhost --admin-port 8081 \
--storage-dir /path/to/storage --localchain-path /path/to/localchain
```

### Options

- **-p, --port <number>** The port to use. Defaults to any 1814, or any available port. (env: ULX_DATABROKER_PORT)
- **-h, --hostname <hostname>** The hostname the public facing apis should listen on. (default: localhost) (env: ULX_HOSTNAME)
- **--admin-port <number>** The port to start an admin server (datastore registry, node registry). Defaults to 18171, or any available port (0). (env:
ULX_DATABROKER_ADMIN_PORT)
- **--storage-dir \<dir\>** Override the default storage directory where the Databroker databases are located. (env: ULX_DATABROKER_DIR)
- **--env <path>** Load environment settings from a .env file.
- **--localchain-path <path>** The path to the localchain data directory. You can also configure this using the .env file (env: ULX_LOCALCHAIN_PATH)

## Internal Structure

Databrokers track information in a SQLite database. The database contains the following tables:

### Organizations

Databrokers can create one or more Organizations. Each organization has a unique ID and a name. Organizations can have one or more users.

### Users

Users are members of an organization with a name and an Identity (a bech32 encoded Ed25519 key). Users will use this identity to sign requests to the Databroker.

### Escrows

Argon micropayments are made through an Escrow, which is a pre-allocation of funds with updating settlements each time you pass a new threshold (1 milligon).
2 changes: 1 addition & 1 deletion datastore/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@polkadot/keyring": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@ulixee/commons": "2.0.0-alpha.29",
"@argonprotocol/localchain": "0.0.2",
"@argonprotocol/localchain": "0.0.4",
"@ulixee/net": "2.0.0-alpha.29",
"@ulixee/platform-specification": "2.0.0-alpha.29",
"@ulixee/platform-utils": "2.0.0-alpha.29",
Expand Down
15 changes: 0 additions & 15 deletions desktop/chrome-extension/.eslintrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions desktop/chrome-extension/.prettierrc

This file was deleted.

Loading

0 comments on commit ae0935d

Please sign in to comment.