Skip to content

Commit

Permalink
release: prepare release v0.12.4 (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslaw-szpiech authored Jul 26, 2023
2 parents cc4ca8d + c5369e4 commit 6453f16
Show file tree
Hide file tree
Showing 20 changed files with 317 additions and 545 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add_issue_to_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: "Add Issues To Project Board"
types:
- opened
env:
GH_TOKEN: ${{ secrets.GH_NEW_CARD_TO_PROJECT }}
GH_TOKEN: ${{ secrets.PROJECT_MANAGE_ACTION }}
PROJECT_ID: ${{ secrets.FRONT_END_PROJECT_ID }}
ISSUE_ID: ${{ github.event.issue.node_id }}
USER: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
env:
WAILS_VERSION: v2.4.1
NODE_VERSION: 18.12.0
GO_VERSION: 1.19
GO_VERSION: 1.20.6

jobs:
download-frontend:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conventional_commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- name: Commitsar conventional commits check
uses: aevea/commitsar@v0.18.0
uses: aevea/commitsar@v0.20.2
361 changes: 0 additions & 361 deletions .github/workflows/project_management.yml

This file was deleted.

26 changes: 14 additions & 12 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
env:
VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
WAILS_VERSION: v2.4.1
NODE_VERSION: 18.12.0
GO_VERSION: 1.20.6

jobs:
release-macos:
Expand All @@ -34,16 +36,16 @@ jobs:
- arch: arm64
user-friendly-arch: apple-silicon
steps:
- name: Set up Node 18.12
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: 18.12.0
node-version: ${{ env.NODE_VERSION }}
id: npm

- name: Set up Go
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: ${{ env.GO_VERSION }}
id: go

- name: Get Wails
Expand Down Expand Up @@ -151,16 +153,16 @@ jobs:
software-name: Fairground Wallet
filename: fairground-wallet
steps:
- name: Set up Node 18.12
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: 18.12.0
node-version: ${{ env.NODE_VERSION }}
id: npm

- name: Set up Go
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: ${{ env.GO_VERSION }}
id: go

- name: Get Wails
Expand Down Expand Up @@ -273,16 +275,16 @@ jobs:
software-name: Fairground Wallet
filename: fairground-wallet
steps:
- name: Set up Node 18.12
- name: Set up Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: 18.12.0
node-version: ${{ env.NODE_VERSION }}
id: npm

- name: Set up Go
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: ${{ env.GO_VERSION }}
id: go

- name: Check out repository
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.12.4

Support for vega v0.72.5

### 🛠 Improvements

- [675](https://github.com/vegaprotocol/vegawallet-desktop/issues/675) - Handle new interaction session for re-instated connections

## 0.12.3

Support for vega v0.71.6
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Vega Wallet desktop app

The Vega Wallet desktop app provides a graphical user interface for Vega Protocol's [wallet](https://github.com/vegaprotocol/vegawallet/) for Windows, MacOS and Linux.
The Vega Wallet desktop app provides a graphical user interface for Vega Protocol's [wallet](https://github.com/vegaprotocol/vegawallet/) for Windows, macOS and Linux.

[Latest release](https://github.com/vegaprotocol/vegawallet-desktop/releases): Download the latest release from the releases section.

[Wallet documentation](https://docs.vega.xyz/docs/mainnet/tools/vega-wallet/desktop-app/latest/getting-started): Read the quick-start guide for tips on using the desktop wallet app.

## Supported platforms

**MacOS:** >= 10.13 (High Sierra)
**macOS:** >= 10.13 (High Sierra)
**Windows:** >= 8
**Linux:** Supported but the minimum version is unknown.
**Linux:** Supported, but the minimum version is unknown.

### Dependencies

#### Golang

You will need to go 1.20.

#### Wails

This project uses [Wails](https://wails.io) to build the desktop app. To install Wails, follow the instruction on its [Getting started](https://wails.io/docs/gettingstarted/installation) page.

Be sure to have the following environment variables set:
Expand All @@ -31,14 +37,16 @@ To check if you have the correct dependencies installed, use the following comma
wails doctor
```

#### Frontend

To be able to compile the frontend, you'll also need to install:

- nodejs >= **v18.12.0**
- yarn >= **v1.22.19**

#### Platform Specific Dependencies

Be sure to follow the installation guide from Wails. There are specific dependencies that needs to be installed.
Be sure to follow the installation guide from Wails. Specific dependencies need to be installed.

For more details, see [https://wails.io/docs/gettingstarted/installation#platform-specific-dependencies](https://wails.io/docs/gettingstarted/installation#platform-specific-dependencies)

Expand All @@ -51,7 +59,7 @@ directory.

#### Using the script `build.sh`

There is scripts that ease the switch between fairground and mainnet:
There are scripts that ease the switch between fairground and mainnet:

**For fairground:**

Expand Down Expand Up @@ -85,7 +93,7 @@ To compile the optimization for fairground:
wails build -f -clean -tags fairground
```

**Note that this step alone won't correctly bundle the application for fairground.** There are hacks to be performed to have the right bundle name, metadata, and icon. See `build.sh` script for more detail.
**Note that this step alone won't correctly bundle the application for fairground.** Hacks must be performed to have the right bundle name, metadata and icon. See `build.sh` script for more detail.

More at the [Wails documentation](https://wails.io/docs/reference/cli#build).

Expand Down Expand Up @@ -129,7 +137,7 @@ VITE_FEATURE_MODE='fairground' wails build
A full list of these can be found below:

| Flag | Description |
| ---------------------------- | -------------------------------------------------------------------------------------------- |
|------------------------------|----------------------------------------------------------------------------------------------|
| VITE_FEATURE_NETWORK_WARNING | Enable warning the user if the network is a different version for the one configured for the |
| VITE_FEATURE_TELEMETRY_CHECK | Enable users being asked if they would like to send bug reports for the application |
| VITE_FEATURE_MODE | Build the app in fairground mode with different styling/messaging that is mode specific |
Expand All @@ -151,7 +159,7 @@ Error: EMFILE: too many open files, watch
at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
```

It appears on MacOS. It's fixed by installing `watchman`:
It is raised on macOS. It is fixed by installing `watchman`:

```sh
brew install watchman
Expand All @@ -169,7 +177,7 @@ go test ./...

#### End to end

Check out the [frontend guide](./frontend/README.md) to see how to run the end to end tests.
Check out the [frontend guide](./frontend/README.md) to see how to run the end-to-end tests.

## Support

Expand All @@ -191,7 +199,7 @@ Ask us for help, find out about scheduled open sessions, and keep up with Vega g

## About Vega

[Vega][vega-website] is a protocol for creating and trading derivatives on a fully decentralised network. The network, secured with proof-of-stake, will facilitate fully automated, end-to-end margin trading and execution of complex financial products. Anyone will be able to build decentralised markets using the protocol.
[Vega][vega-website] is a protocol for creating and trading derivatives on a fully decentralized network. The network, secured with proof-of-stake, will facilitate fully automated, end-to-end margin trading and execution of complex financial products. Anyone will be able to build decentralized markets using the protocol.

Read more at [https://vega.xyz][vega-website].

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var (

// Version specifies the version used to build the application.
// See VERSION in Makefile for details.
Version = "v0.12.3"
Version = "v0.12.3+dev"

About = fmt.Sprintf(aboutAppTemplate, Version, VersionHash)
)
Expand Down
11 changes: 7 additions & 4 deletions backend/api_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import (
const NewInteractionEvent = "new_interaction"

var (
ErrTraceIDIsRequired = errors.New("a trace ID is required for an interaction")
ErrNameIsRequired = errors.New("a name is required for an interaction")
ErrTraceIDIsRequired = errors.New("a trace ID is required for an interaction")
ErrNameIsRequired = errors.New("a name is required for an interaction")
ErrServiceIsNotRunning = errors.New("the service is not running")
)

func (h *Handler) APIV2GenerateAPIToken(params connections.GenerateAPITokenParams) (connections.Token, error) {
Expand Down Expand Up @@ -82,7 +83,9 @@ func (h *Handler) RespondToInteraction(interaction interactor.Interaction) error
return ErrContextCanceled
}

h.serviceStarter.responseChan <- interaction
if !h.serviceStarter.IsServiceRunning() {
return ErrServiceIsNotRunning
}

return nil
return h.serviceStarter.RespondToInteraction(interaction)
}
49 changes: 33 additions & 16 deletions backend/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ import (
"fmt"
"sync"
"sync/atomic"
"time"

vgclose "code.vegaprotocol.io/vega/libs/close"
"code.vegaprotocol.io/vega/libs/jsonrpc"
vgrand "code.vegaprotocol.io/vega/libs/rand"
vgzap "code.vegaprotocol.io/vega/libs/zap"
"code.vegaprotocol.io/vega/paths"
walletapi "code.vegaprotocol.io/vega/wallet/api"
"code.vegaprotocol.io/vega/wallet/api/interactor"
nodeapi "code.vegaprotocol.io/vega/wallet/api/node"
netStoreV1 "code.vegaprotocol.io/vega/wallet/network/store/v1"
svcStoreV1 "code.vegaprotocol.io/vega/wallet/service/store/v1"
serviceV2 "code.vegaprotocol.io/vega/wallet/service/v2"
"code.vegaprotocol.io/vega/wallet/service/v2/connections"
tokenStoreV1 "code.vegaprotocol.io/vega/wallet/service/v2/connections/store/v1"
tokenStoreV1 "code.vegaprotocol.io/vega/wallet/service/v2/connections/store/longliving/v1"
sessionStoreV1 "code.vegaprotocol.io/vega/wallet/service/v2/connections/store/session/v1"
"code.vegaprotocol.io/vega/wallet/wallet"
walletStoreV1 "code.vegaprotocol.io/vega/wallet/wallet/store/v1"
"code.vegaprotocol.io/vega/wallet/wallets"
Expand All @@ -33,7 +36,7 @@ type Handler struct {
// the one to inject on runtime methods like menu, event, dialogs, etc.
ctx context.Context

// To prevent multiple startup of the back and thus resource leaks.
// To prevent multiple startups of the back and thus resource leaks.
backendStarted atomic.Bool
startupMu sync.Mutex

Expand All @@ -49,7 +52,7 @@ type Handler struct {

configLoader *app.ConfigLoader

// resourcesCloser holds resources that are shared by several component
// resourcesCloser holds resources that are shared by several components
// which lifecycle is tied to the program.
// This is called when the program get closed or fully reloaded (because
// of a change of the home path).
Expand All @@ -71,6 +74,8 @@ type Handler struct {
svcStore *svcStoreV1.Store

icon []byte

interactorCancelFn context.CancelFunc
}

func NewHandler(icon []byte) *Handler {
Expand Down Expand Up @@ -172,7 +177,7 @@ func (h *Handler) reloadBackendComponentsFromConfig() (err error) {

h.resourcesCloser = vgclose.NewCloser()

// In case something goes wrong, we free up the resources.
// If something goes wrong, we free up the resources.
defer func() {
if err != nil {
h.closeAllResources()
Expand Down Expand Up @@ -220,7 +225,7 @@ func (h *Handler) reloadBackendComponentsFromConfig() (err error) {
h.walletStore.Close()
})

h.walletStore.OnUpdate(func(ctx context.Context, event wallet.Event) {
h.walletStore.OnUpdate(func(_ context.Context, event wallet.Event) {
runtime.EventsEmit(h.ctx, string(event.Type), event.Data)
})

Expand All @@ -235,7 +240,22 @@ func (h *Handler) reloadBackendComponentsFromConfig() (err error) {
h.tokenStore = tokenStore
h.resourcesCloser.Add(tokenStore.Close)

connectionsManager, err := connections.NewManager(serviceV2.NewStdTime(), walletStore, tokenStore)
sessionStore, err := sessionStoreV1.InitialiseStore(vegaPaths)
if err != nil {
h.log.Error("Could not initialise session store", zap.Error(err))
return fmt.Errorf("could not initialise session store: %w", err)
}

receptionChan := make(chan interactor.Interaction, 100)

// Dirty hack to ensure we can unblock a waiting interactor, when closing the
// application.
ctx, interactorCancelFn := context.WithCancel(h.ctx)
h.interactorCancelFn = interactorCancelFn

parallelInteractor := interactor.NewParallelInteractor(ctx, receptionChan)

connectionsManager, err := connections.NewManager(serviceV2.NewStdTime(), walletStore, tokenStore, sessionStore, parallelInteractor)
if err != nil {
h.log.Error(fmt.Sprintf("Couldn't initialise the connections manager: %v", err))
return fmt.Errorf("could not initialise the connections manager: %w", err)
Expand All @@ -245,14 +265,7 @@ func (h *Handler) reloadBackendComponentsFromConfig() (err error) {

h.initializeWalletAdminAPI()

serviceStarter, err := NewServiceStarter(
vegaPaths,
h.log.Named("service-starter"),
h.svcStore,
h.walletStore,
h.networkStore,
h.connectionsManager,
)
serviceStarter, err := NewServiceStarter(vegaPaths, h.log.Named("service-starter"), h.svcStore, h.walletStore, h.networkStore, connectionsManager, parallelInteractor, receptionChan)
if err != nil {
h.log.Error(fmt.Sprintf("Couldn't initialise the service starter: %v", err))
return fmt.Errorf("couldn't initialise the service starter: %v", err)
Expand All @@ -268,6 +281,10 @@ func (h *Handler) reloadBackendComponentsFromConfig() (err error) {
}

func (h *Handler) closeAllResources() {
if h.interactorCancelFn != nil {
h.interactorCancelFn()
}

if h.serviceStarter != nil {
h.serviceStarter.Close()
}
Expand Down Expand Up @@ -334,8 +351,8 @@ func (h *Handler) updateBackendComponentsFromConfig() error {
}

func (h *Handler) initializeWalletAdminAPI() {
nodeSelectorBuilder := func(hosts []string, retries uint64) (nodeapi.Selector, error) {
nodeSelector, err := nodeapi.BuildRoundRobinSelectorWithRetryingNodes(h.log, hosts, retries)
nodeSelectorBuilder := func(hosts []string, retries uint64, requestTTL time.Duration) (nodeapi.Selector, error) {
nodeSelector, err := nodeapi.BuildRoundRobinSelectorWithRetryingNodes(h.log, hosts, retries, requestTTL)
if err != nil {
h.log.Error(fmt.Sprintf("Could not initialise the node selector for wallet API: %v", err))
return nil, fmt.Errorf("could not initialise the node selector for wallet API: %w", err)
Expand Down
Loading

0 comments on commit 6453f16

Please sign in to comment.