spacemeshos / smapp

Spacemesh App (Smesher + Wallet) 🏦📊
https://spacemesh.io
Apache License 2.0
130 stars 38 forks source link
dashboard electron javascript react wallet

Latest Release CodeQL Discord made by GitHub License

 

Smapp - the Spacemesh App 🏦📊

Smesher UI + Wallet

This repo includes the source code for the Spacemesh App. A desktop application for Windows 10, OS X, and Linux which includes a Smesher and a basic wallet. The main artifacts of this repo are the app and an app installer for all supported platforms.

Important note: Currently, Smapp does not support Hardware Wallets. This feature will be implemented in the future, but until then we highly recommend using SMCLI to generate the necessary keys for your ledger setup.

Also, the Wallet-only mode is temporarily disabled.

Installation & Quick Start

Download the latest Smapp release from Spacemesh Website.

For the installation guide, follow this link.

Building from Source

Smapp is written in TypeScript and bundled within Electron. You need Node.js (v12) and Yarn to build from the source. Make sure they are available on your system.

  1. Clone the repository
  2. Read node/use-version file: this is the version of go-spacemesh that should be used
  3. Download the specified version from Go-spacemesh Releases
  4. Put the binary in either node/windows, node/mac, or node/linux folder, depending on your platform
  5. Run yarn to install dependencies
  6. Run yarn start to start the application in development mode

To build and pack the application:

  1. Run yarn build
  2. Run one of the commands depending on your platform:
    • yarn package-win
    • yarn package-mac set env variable DONT_SIGN_APP=1 to skip notarizing the app,
    • yarn package-linux

Arguments

Smapp can be started with additional arguments:

To run the application in dev mode with the same behavior set env variables instead:

PPROF_SERVER=1 DISCOVERY_URL=http://localhost:8000/networks.json yarn start

Environment Variables

Connect to custom networks:

DISCOVERY_URL=http://localhost:8000/networks.json yarn start

Alias for --discovery argument.

Deprecated > To run the application against DevNet you have to set URL to the config file to env variable `DEV_NET_URL`: > > ``` > DEV_NET_URL=https://.../config.json yarn start > ``` > > To run the application against DevNet in the Wallet Only mode you have to also set the URL (or list of URLs separated by commas) to GRPC API provider to env variable `DEV_NET_REMOTE_API`: > > ``` > export DEV_NET_REMOTE_API=https://192.168.0.1:31030 > export DEV_NET_URL=https://.../config.json > yarn start > ```

Profiling Node

PPROF_SERVER=1 yarn start

Alias for --pprof-server argument.

Building Artifacts in CI

Smapp uses two workflows. Both of them build an application for all supported platforms: Windows, macOS, and Linux.


Run the Spacemesh app on Ubuntu

We recommend choosing AppImage as it is not possible to embed certain features in the .deb package. For the Ubuntu platform Electron has an issue with setup, if you want to run it on the Ubuntu > 22.04 platform, please provide --no-sandbox flag

command: /opt/Spacemesh/spacemesh_app --no-sandbox


Troubleshooting

The first thing to check if you encounter any issues with Smapp

Additionally:

Windows:

Linux:

macOS:

CLI-tools

These tools are created for debugging and development purposes. They are not supposed to be used in the production (on real and valuable data). So use it at your own risk.

yarn script:composeTx

Compose the transaction (and sign if needed).

yarn script:decomposeTx

Decompose the transaction (byte array) to the human-readable structure (JSON)

yarn script:readSecrets

Read secrets from the wallet file. For example, if you need to export private keys or mnemonics.

yarn script:addViewAccount

Add a public key to the wallet file. It makes it possible to track someone else transactions and rewards. Pay attention that Smapp does not fully support such kinds of accounts. So in case you try to sign a message or publish a transaction — unhandled exceptions will occur.