Skip to content

Commit

Permalink
Merge pull request #209 from ulixee/desktop
Browse files Browse the repository at this point in the history
Platform gets isolated
  • Loading branch information
blakebyrnes authored Sep 19, 2024
2 parents 9fc427e + e56c5bf commit 42bc301
Show file tree
Hide file tree
Showing 309 changed files with 1,796 additions and 25,647 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.

33 changes: 10 additions & 23 deletions .github/workflows/js-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,8 @@ jobs:
node-version: 18
cache: yarn

- name: Setup SSH for Git Operations
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
SSH_PATH="$HOME/.ssh"
mkdir "$SSH_PATH"
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa"
chmod 600 "$SSH_PATH/id_rsa"
ssh-keyscan github.com >> "$SSH_PATH/known_hosts"
else
SSH_PATH=~/.ssh
mkdir -p "$SSH_PATH"
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa"
chmod 600 "$SSH_PATH/id_rsa"
ssh-keyscan github.com >> "$SSH_PATH/known_hosts"
fi
env:
SSH_PRIVATE_KEY: ${{ secrets.MAINCHAIN_SSH_KEY }}

- name: Clone Mainchain
run: |
export GIT_SSH_COMMAND="ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts"
git clone -b napi-bindings [email protected]:argonprotocol/mainchain.git
run: git clone -b napi-bindings https://github.com/argonprotocol/mainchain.git
working-directory: ..

- name: Install Mainchain
Expand All @@ -57,15 +37,22 @@ jobs:
run: yarn tsc
working-directory: ../mainchain/client/nodejs

- name: Clone Hero
run: |
git clone -n https://github.com/ulixee/hero.git
cd hero
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main)
working-directory: ..

- name: Install Hero
run: yarn build:simple
working-directory: ./hero
working-directory: ../hero

- name: Set timeout
run: yarn config set network-timeout 1000000 -g

- name: Build modules
run: yarn && yarn build:dist
run: yarn install --frozen-lockfile --ignore-engines && yarn build:dist

- name: Publish branch
run: |
Expand Down
87 changes: 47 additions & 40 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,14 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.23'

- name: Install pcap
run: sudo apt-get install -y libpcap-dev

- name: Setup SSH for Git Operations
shell: bash
run: |
mkdir -p "$SSH_PATH"
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa"
chmod 600 "$SSH_PATH/id_rsa"
ssh-keyscan github.com >> "$SSH_PATH/known_hosts"
env:
SSH_PRIVATE_KEY: ${{ secrets.MAINCHAIN_SSH_KEY }}

- name: Clone Mainchain
run: |
export GIT_SSH_COMMAND="ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts"
git clone --depth 1 -b napi-bindings [email protected]:argonprotocol/mainchain.git
git clone --depth 1 -b napi-bindings https://github.com/argonprotocol/mainchain.git
cp mainchain/localchain/npm/**/*.node mainchain/localchain
working-directory: ..

Expand All @@ -87,12 +76,23 @@ jobs:
run: yarn tsc
working-directory: ../mainchain/client/nodejs

- name: Clone Hero
run: |
git clone -n --recurse-submodules https://github.com/ulixee/hero.git
cd hero
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main)
git submodule update --init --recursive --depth 1
working-directory: ..

- name: Install Hero
run: yarn build:simple
working-directory: ./hero
run: yarn build
working-directory: ../hero

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

- name: Yarn build
run: yarn --ignore-engines && yarn build --ignore-engines
run: yarn build
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1

Expand Down Expand Up @@ -150,7 +150,12 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.20'
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' }}
Expand All @@ -162,31 +167,20 @@ jobs:
if: ${{ matrix.os == 'windows-latest' }}
uses: microsoft/setup-msbuild@v2

- name: Setup SSH for Git Operations
shell: bash
- name: Clear space
if: ${{ matrix.os == 'macos-latest' }}
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
SSH_PATH="$HOME/.ssh"
mkdir "$SSH_PATH"
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa"
chmod 600 "$SSH_PATH/id_rsa"
ssh-keyscan github.com >> "$SSH_PATH/known_hosts"
echo "GIT_SSH_COMMAND=ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts" >> $GITHUB_ENV
else
SSH_PATH=~/.ssh
mkdir -p "$SSH_PATH"
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa"
chmod 600 "$SSH_PATH/id_rsa"
ssh-keyscan github.com >> "$SSH_PATH/known_hosts"
echo "GIT_SSH_COMMAND=ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts" >> $GITHUB_ENV
fi
env:
SSH_PRIVATE_KEY: ${{ secrets.MAINCHAIN_SSH_KEY }}
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: |
git clone -b napi-bindings git@github.com:argonprotocol/mainchain.git
git clone -b napi-bindings https://github.com/argonprotocol/mainchain.git
cp mainchain/localchain/npm/**/*.node mainchain/localchain
working-directory: ..

Expand All @@ -198,14 +192,27 @@ jobs:
run: yarn tsc
working-directory: ../mainchain/client/nodejs

- name: Clone Hero
run: |
git clone -n --recurse-submodules https://github.com/ulixee/hero.git
cd hero
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main)
git submodule update --init --recursive --depth 1
working-directory: ..

- name: Install Hero
run: yarn build:simple
working-directory: ./hero
run: yarn build
working-directory: ../hero

- name: Install Deps
run: yarn config set ignore-engines true

- name: Yarn build
run: yarn --ignore-engines && yarn build --ignore-engines
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
4 changes: 0 additions & 4 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ jobs:
uses: microsoft/setup-msbuild@v2
if: ${{ matrix.os == 'windows-latest' }}

- name: Install Hero
run: yarn && yarn build
working-directory: ./hero

- name: Yarn build
run: yarn --ignore-engines && yarn build --ignore-engines
env:
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "hero"]
path = hero
url = [email protected]:ulixee/hero.git
branch = main
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).
6 changes: 3 additions & 3 deletions client/main/lib/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface IClientConfig
Pick<IQueryOptions, 'authentication' | 'affiliateId' | 'onQueryResult' | 'queryId'>
> {
paymentService?: IPaymentService;
mainchainUrl?: string;
argonMainchainUrl?: string;
}

export default class ClientForRemote {
Expand Down Expand Up @@ -63,7 +63,7 @@ export default class ClientForRemote {
// see if this is a domain
DataDomainStore.parse(this.host);

if (!config?.mainchainUrl)
if (!config?.argonMainchainUrl)
throw new Error('No mainchain url provided to lookup this datastore host');
this.domainLookupPromise = this.lookupDomain(uriOrObject);
} catch (err) {
Expand Down Expand Up @@ -156,7 +156,7 @@ export default class ClientForRemote {
private async lookupDomain(domainName: string): Promise<void> {
const lookup = await DatastoreApiClient.lookupDatastoreHost(
domainName,
this.config.mainchainUrl,
this.config.argonMainchainUrl,
);

this.datastoreId = lookup.datastoreId;
Expand Down
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
18 changes: 8 additions & 10 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 @@ -48,19 +46,19 @@ ULX_ENABLE_GLOBAL_CONFIG=true
## Localchain Configuration

# Path to the localchain
ULX_LOCALCHAIN_PATH=
# Default mainchain host TODO: fill in once mainchain is up#
ULX_MAINCHAIN_URL=
ARGON_LOCALCHAIN_PATH=
# Default Argon mainchain host TODO: fill in once mainchain is up#
ARGON_MAINCHAIN_URL=
# A vote output address for the localchain (activates vote creation)
ULX_VOTES_ADDRESS=
ARGON_VOTES_ADDRESS=
# The preferred notary to use
ULX_NOTARY_ID=1
ARGON_NOTARY_ID=1
# Prompt for an interactive password on the cli
ULX_LOCALCHAIN_PASSWORD_INTERACTIVE_CLI=
ARGON_LOCALCHAIN_PASSWORD_INTERACTIVE_CLI=
# Path to the localchain password file
ULX_LOCALCHAIN_PASSWORD_FILE=
ARGON_LOCALCHAIN_PASSWORD_FILE=
# The localchain password loaded into memory (unsafe)
ULX_LOCALCHAIN_PASSWORD=
ARGON_LOCALCHAIN_PASSWORD=

## Hero
ULX_DATA_DIR=<TMP>/.ulixee
Expand Down
Loading

0 comments on commit 42bc301

Please sign in to comment.