Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feat/win support/contract migration ui! #284

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8967e9b
initial win support
solarw Aug 5, 2024
da1579a
Merge branch 'main' of github.com:valory-xyz/olas-operate-app into fe…
solarw Aug 8, 2024
18c234b
Merge branch 'staging' of github.com:valory-xyz/olas-operate-app into…
solarw Aug 8, 2024
d1015e7
win: process kill fixes
solarw Aug 13, 2024
0e5dfbf
Merge branch 'staging' of github.com:valory-xyz/olas-operate-app into…
solarw Aug 13, 2024
0930ac2
win: tendermint installation automated
solarw Aug 13, 2024
e42ba6e
helthchecker env vars to switch it off. small refactoring
solarw Aug 19, 2024
f793a03
Merge branch 'feat/contract-migration-ui' of github.com:valory-xyz/ol…
solarw Aug 20, 2024
1d32bb9
refactor: seperate the funding section component from the main page s…
truemiller Aug 21, 2024
c585d59
feat: add funding section to beta contract section
truemiller Aug 21, 2024
15816fe
fix: provider order
truemiller Aug 21, 2024
ac5c6ca
chore: bump 116 for testing staging with rewards fix
truemiller Aug 21, 2024
973b5d2
Bump
truemiller Aug 22, 2024
21a035e
Bump
truemiller Aug 22, 2024
219814e
Update pyproject.toml
truemiller Aug 22, 2024
c0e4f59
Merge pull request #289 from valory-xyz/fix/rewards-providers
truemiller Aug 22, 2024
88858e4
Merge remote-tracking branch 'origin/staging' into fix/onchain_update…
jmoreira-valory Aug 22, 2024
aa9235c
Merge pull request #290 from valory-xyz/staging
truemiller Aug 22, 2024
da76908
fix: Add subgraph check of agent ID
jmoreira-valory Aug 22, 2024
6ccf856
chore: linters (black)
jmoreira-valory Aug 22, 2024
bcd3a13
fix: linters
jmoreira-valory Aug 22, 2024
5147777
fix: linters
jmoreira-valory Aug 22, 2024
1efa08b
chore: linters
jmoreira-valory Aug 22, 2024
9a9906b
chore: linters
jmoreira-valory Aug 22, 2024
0610fce
chore: linters
jmoreira-valory Aug 22, 2024
092e655
chore: ignore missing import for `eth_utils`
0xArdi Aug 22, 2024
bccc559
service hash id updated
solarw Aug 23, 2024
5319963
Merge remote-tracking branch 'origin/HEAD' into fix/onchain_update_flow
jmoreira-valory Aug 27, 2024
6c3cb7c
chore: fix fund before swap transaction
jmoreira-valory Aug 28, 2024
75a9ccf
fix: required staking balance calculations
truemiller Aug 28, 2024
2011417
refactor: update copy as per figma
truemiller Aug 28, 2024
2894478
refactor: ensure not undefined earlier
truemiller Aug 28, 2024
2c58a21
chore: minor fixes
jmoreira-valory Aug 28, 2024
9317ea3
fix: linters
jmoreira-valory Aug 28, 2024
ce45d60
chore: minor fix
jmoreira-valory Aug 28, 2024
31ac520
Merge pull request #297 from valory-xyz/fix/olas-requirement-switch-c…
truemiller Aug 28, 2024
de10e16
Merge branch 'staging' into feat/add-funding-section-to-staking-manage
truemiller Aug 28, 2024
5d75760
Merge remote-tracking branch 'origin/staging' into feat/add-funding-s…
truemiller Aug 28, 2024
e6d7af9
refactor: remove reassignment
truemiller Aug 28, 2024
b3d4356
refactor: remove fragment
truemiller Aug 28, 2024
6286fd0
Merge pull request #287 from valory-xyz/feat/add-funding-section-to-s…
truemiller Aug 28, 2024
33c1551
fix: linters
jmoreira-valory Aug 28, 2024
64afe2e
Merge commit '6286fd024cc4e09e08e90a5a124349a98bde625b' into fix/onch…
jmoreira-valory Aug 28, 2024
64cdcaf
chore: gitleaksignore
jmoreira-valory Aug 28, 2024
c75686b
chore: gitleaks
jmoreira-valory Aug 28, 2024
8b7fa59
chore: gitleaks
jmoreira-valory Aug 28, 2024
8d28ba5
Merge pull request #234 from valory-xyz/fix/onchain_update_flow
truemiller Aug 28, 2024
f6439a5
bump: rc118
truemiller Aug 28, 2024
1aba5f9
fix: rename instead of delete invalid services
jmoreira-valory Aug 28, 2024
a153a4b
fix: linters
jmoreira-valory Aug 28, 2024
8207a61
Merge pull request #298 from valory-xyz/fix/rename_invalid_services
truemiller Aug 28, 2024
8f6cea6
use bundled in tendermint.exe, not download it
solarw Aug 29, 2024
d06eb95
Merge branch 'staging' of github.com:valory-xyz/olas-operate-app into…
solarw Aug 29, 2024
d5a2a0e
Merge branch 'staging' into fix/rename_invalid_services
jmoreira-valory Aug 29, 2024
ee45b0f
refactor: remove iteration as it's too volatile, error prone
truemiller Aug 29, 2024
65f98d9
refactor: only show migrate button on beta, or future contracts
truemiller Aug 29, 2024
267bb70
chore: add timestamp to renamed folder
jmoreira-valory Aug 29, 2024
27a552b
chore: remove redundant comments
truemiller Aug 29, 2024
2711e16
Merge pull request #300 from valory-xyz/fix/rename_invalid_services
jmoreira-valory Aug 29, 2024
46bb477
Merge pull request #299 from valory-xyz/fix/remove-alpha-migrate-button
truemiller Aug 29, 2024
835a618
refactor: remove old readme sections
truemiller Aug 29, 2024
6f16c71
bump: rc120
truemiller Aug 29, 2024
bc234f8
Merge branch 'staging' of github.com:valory-xyz/olas-operate-app into…
solarw Aug 29, 2024
fe6cf4a
bump install.js to rc121
truemiller Aug 29, 2024
f04521d
fix: rollback install.js from 120, as it will conflict with Windows r…
truemiller Aug 29, 2024
d158a63
Merge pull request #302 from valory-xyz/staging
truemiller Aug 29, 2024
e6128a4
Merge pull request #304 from valory-xyz/fix/readme-outdated
truemiller Aug 30, 2024
5d6b007
Merge branch 'staging' of github.com:valory-xyz/olas-operate-app into…
solarw Aug 30, 2024
b398318
Merge branch 'main' of github.com:valory-xyz/olas-operate-app into fe…
solarw Aug 30, 2024
d80ef14
lint fixes
solarw Aug 30, 2024
70af1d5
win release updates
solarw Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/release_win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release for Windows

# This workflow is triggered on pushing a tag BE CAREFUL this application AUTO UPDATES !!!
# git tag vX.Y.Z
# git push origin tag vX.Y.Z

on: [pull_request]

jobs:
build-windows:
runs-on: windows-latest
#strategy:
# matrix:
# arch: [ x64, arm64 ]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
# version: '1.4.0'
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/my-custom-path
installer-parallel: true
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Install dependencies
run: poetry install

- name: install node deps
run: yarn install-deps

- name: set env vars to prod.env
env:
NODE_ENV: production
DEV_RPC: https://rpc-gate.autonolas.tech/gnosis-rpc/
IS_STAGING: ${{ github.ref != 'refs/heads/main' && 'true' || 'false' }}
FORK_URL: https://rpc-gate.autonolas.tech/gnosis-rpc/
GH_TOKEN: ${{ secrets.github_token}}
run: |
echo NODE_ENV=$NODE_ENV >> prod.env
echo DEV_RPC=$DEV_RPC >> prod.env
echo IS_STAGING=$IS_STAGING >> prod.env
echo FORK_URL=$FORK_URL >> prod.env
cat prod.env
- run: rm -rf /dist
- name: "Build, notarize, publish"
run: make build
5 changes: 4 additions & 1 deletion .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ d8149e9b5b7bd6a7ed7bc1039900702f1d4f287b:operate/services/manage.py:generic-api-
99c0f139b037da2587708212fcf6d0e20786d0ba:operate/services/manage.py:generic-api-key:455
91ec07457f69e9a29f63693ac8ef887e4b5f49f0:operate/services/manage.py:generic-api-key:454
410bea2bd02ff54da69387fe8f3b58793e09f7b0:operate/services/manage.py:generic-api-key:421
410bea2bd02ff54da69387fe8f3b58793e09f7b0:operate/services/manage.py:generic-api-key:422
410bea2bd02ff54da69387fe8f3b58793e09f7b0:operate/services/manage.py:generic-api-key:422
467e8e64f51fb3659e5af17ba53ab587ec24fc30:operate/services/manage.py:generic-api-key:290
64afe2ea92daafa2515c054f0e09931622d99f31:operate/services/manage.py:generic-api-key:290
64afe2ea92daafa2515c054f0e09931622d99f31:operate/services/manage.py:generic-api-key:289
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

define setup_env
$(eval ENV_FILE := $(1).env)
@echo " - setup env $(ENV_FILE)"
$(eval include $(1).env)
$(eval export)
endef


./trader/:
pwd
git clone https://github.com/valory-xyz/trader.git

./dist/aea_win.exe: ./trader/
mkdir -p dist
cd trader && poetry install && poetry run pyinstaller --collect-data eth_account --collect-all aea --collect-all autonomy --collect-all operate --collect-all aea_ledger_ethereum --collect-all aea_ledger_cosmos --collect-all aea_ledger_ethereum_flashbots --hidden-import aea_ledger_ethereum --hidden-import aea_ledger_cosmos --hidden-import aea_ledger_ethereum_flashbots --hidden-import grpc --hidden-import openapi_core --collect-all google.protobuf --collect-all openapi_core --collect-all openapi_spec_validator --collect-all asn1crypto --hidden-import py_ecc --hidden-import pytz --onefile pyinstaller/trader_bin.py --name trader_win
cp -f trader/dist/trader_win.exe ./dist/aea_win.exe
pwd


./dist/tendermint_win.exe: ./operate
pwd
poetry install && poetry run pyinstaller operate/services/utils/tendermint.py --onefile --name tendermint_win


./dist/pearl_win.exe: ./dist/aea_win.exe ./dist/tendermint_win.exe
pwd
poetry install && poetry run pyinstaller --collect-data eth_account --collect-all aea --collect-all coincurve --collect-all autonomy --collect-all operate --collect-all aea_ledger_ethereum --collect-all aea_ledger_cosmos --collect-all aea_ledger_ethereum_flashbots --hidden-import aea_ledger_ethereum --hidden-import aea_ledger_cosmos --hidden-import aea_ledger_ethereum_flashbots operate/pearl.py --add-binary dist/aea_win.exe:. --add-binary dist/tendermint_win.exe:. --onefile --name pearl_win


.PHONY: operate
operate: ./dist/pearl_win.exe

.PHONY: build
build: ./dist/pearl_win.exe
$(call setup_env, prod)
echo ${DEV_RPC}
mkdir -p ./electron/bins
cp -f dist/pearl_win.exe ./electron/bins/pearl_win.exe
echo ${NODE_ENV}
NODE_ENV=${NODE_ENV} DEV_RPC=${DEV_RPC} FORK_URL=${FORK_URL} yarn build:frontend
node build-win.js


.PHONY: build-tenderly
build-tenderly: ./dist/pearl_win.exe
$(call setup_env, dev-tenderly)
echo ${DEV_RPC}
cp -f dist/pearl_win.exe ./electron/bins/pearl_win.exe
echo ${NODE_ENV}
NODE_ENV=${NODE_ENV} DEV_RPC=${DEV_RPC} FORK_URL=${FORK_URL} yarn build:frontend
node build-win-tenderly.js
44 changes: 3 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Pearl is an application used to run autonomous agents powered by the OLAS Networ
- Javascript / TypeScript
- Python (3.10)
- Poetry (^1.7.1)
- Docker Engine

## Getting Started

Expand All @@ -26,7 +25,7 @@ The following installation steps assume you have the following on each OS:

<details><summary><h4>NodeJS</summary></h4>

NodeJS is best installed and managed through NVM. It allows you to install and select specific versions of NodeJS. Pearl has been built using version 20.11, LTS.
NodeJS is best installed and managed through NVM. It allows you to install and select specific versions of NodeJS. Pearl has been built using version 20 LTS.

<h5>Linux</h5>

Expand Down Expand Up @@ -117,38 +116,6 @@ If promoted to run `pipx ensurepath`, run it.

</details>

<details><summary><h4>Docker</h4></summary>

<h5>Linux</h5>

*Update the `ubuntu.22.04~jammy` version string to your current OS version before running the following command:*

```bash
VERSION_STRING=5:24.0.7-1~ubuntu.22.04~jammy
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
```

If you are unsure about your current OS version/codename, you can find it by running:

```bash
lsb_release -a
```

<h5>MacOS</h5>

You can [install Docker Desktop via the Docker website](https://www.docker.com/products/docker-desktop/). Be sure to select the correct version for your system's CPU architecture.

If you are unsure about your system's CPU architecture, run the following command:

```bash
uname -p
# x86 64 Intel chip
# arm64 Apple chip
```

</details>

<h3>Setting up your .env file</h3>

Create an `.env` file in the root directory, or rename `.env.example` to `.env`.
Expand Down Expand Up @@ -202,7 +169,7 @@ Provided your system dependencies are installed, environment variables are set,
You can start Pearl by running the following command in the root directory:

```bash
yarn start
yarn dev
```

This will run Electron, which launches the NextJS frontend and the Python backend as child processes.
Expand Down Expand Up @@ -254,9 +221,4 @@ poetry run python scripts/fund.py 0xYOURADDRESS
poetry run python scripts/transfer_olas.py PATH_TO_KEY_CONTAINING_OLAS ADDRESS_TO_TRANSFER AMOUNT
```

</details>

<h2>Notes and Common Issues</h2>

- If Pearl is running, it will kill any attempt to run another Pearl instance. This is to ensure there are no port conflicts.
- Enivironment variables are cached in the terminal, if you change them while your terminal is open, you will need to restart the terminal.
</details>
38 changes: 38 additions & 0 deletions build-win-tenderly.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* This script is used to build the electron app **with notarization**. It is used for the final build and release process.
*/
require('dotenv').config();
const build = require('electron-builder').build;

const { publishOptions } = require('./electron/constants');

const main = async () => {
console.log('Building...');

/** @type import {CliOptions} from "electron-builder" */
await build({
publish: 'onTag',
config: {
appId: 'xyz.valory.olas-operate-app',
artifactName: '${productName}-${version}-${platform}-${arch}-tenderly.${ext}',
productName: 'Pearl',
files: ['electron/**/*', 'package.json'],
directories: {
output: 'dist',
},
nsis: {
oneClick: false,
},
extraResources: [
{
from: 'electron/bins',
to: 'bins',
filter: ['**/*'],
},
],

},
});
};

main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e));
48 changes: 48 additions & 0 deletions build-win.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* This script is used to build the electron app **with notarization**. It is used for the final build and release process.
*/
require('dotenv').config();
const build = require('electron-builder').build;

const { publishOptions } = require('./electron/constants');


function artifactName() {
const env = process.env.NODE_ENV;
const prefix = env === 'production' ? '' : 'dev-';
return prefix + '${productName}-${version}-${platform}-${arch}.${ext}';
}

const main = async () => {
console.log('Building...');

/** @type import {CliOptions} from "electron-builder" */
await build({
publish: 'onTag',
config: {
appId: 'xyz.valory.olas-operate-app',
artifactName: artifactName(),
productName: 'Pearl',
files: ['electron/**/*', 'package.json'],
directories: {
output: 'dist',
},
nsis: {
oneClick: false,
},
publish: publishOptions,
category: 'public.app-category.utilities',
icon: 'electron/assets/icons/splash-robot-head-dock.png',
extraResources: [
{
from: 'electron/bins',
to: 'bins',
filter: ['**/*'],
},
],

},
});
};

main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e));
Loading
Loading