• Stars
    star
    201
  • Rank 194,456 (Top 4 %)
  • Language
    TypeScript
  • License
    BSD 3-Clause "New...
  • Created almost 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Safe Network Browser Application

SAFE Browser

Notes!

The Safe Browser is actively being developed against various iterations of The Safe Network. Both of which are still considered alpha software, so please be prepared to encounter and report bugs!

You currently (need the Safe Authenticator to be installed.)[https://github.com/maidsafe/safe-api#the-authenticator-daemon].

Known Issues

Currently 404 pages renders are being swallowed by electron (electron/electron#21046), so these errors / pages returned to browser will return a 200 error code, but a 404 page served by the browser's internal server.

Status

Linux/macOS
Build Status
Build

Table of contents

  1. About
  2. Web App Development
  3. Installation
  4. Design
  5. Further help
  6. License
  7. Contributing

About

Built upon peruse, but using its baked in extensibility to add SAFE Network functionality.

Web App Development

Looking for more information about developing websites/web apps for the SAFE Network? Take a look at the Web App Overview.

Installation

For normal SAFE Network browsing, you should download the latest version of the browser from The SAFE Browser releases page.

Application developers should use the same link, but choose the -dev postfixed version for their platform. This version uses a mock network to allow local development (without the need to pay PUT costs on a live SAFE Network).

We use a dev branch for development. And we keep master as a stable reference updated with each release.

Design

To find out more about the structure of Peruse and the SAFE functionality extending it, read the Browser Application Design Overview.

Build

Prerequisites

  • Node.js ^8.0.0 (we recommend installing it via nvm)
  • Git
  • Yarn (as a replacement for npm).
  • Windows-specific:
    • Yarn attempts to build modules concurrently with multiple child processes, which causes intermittent timing issues on Windows. Users need to run yarn config set child-concurrency 1 just once to effect local yarn settings.
    • In order to be able to build native Node modules for this library, run npm install --global --production windows-build-tools which installs Python 2.x, Visual Studio 2015 build tools, and Visual C++ build tools.
  • If you are using Ubuntu, Mint, or Debian 9 as OS, libgconf-2-4 and/or build-essential dependencies might be missing. Please install them as needed with Synaptic Package Mgr., or with apt from a shell console: $ sudo apt-get install libgconf-2-4 build-essential

Build steps

  • git clone https://github.com/maidsafe/safe_browser.git
  • git checkout master (master is the stable branch. dev is current working branch)
  • cd safe_browser
  • NODE_ENV=dev yarn (NODE_ENV is needed to install mock libs and to run yarn mock-dev).
  • yarn rebuild

And to run dev mode:

  • yarn mock-dev

Want to run 'production' variables, but with hot reloading?

  • yarn put-live-net-files-for-<windows|osx|linux>
  • yarn prod-dev

Note, you'll need a crust.config set for the application. Helper commands for osx/linux/windows

And to package:

  • yarn package

The resulting packages are contained within the releases folder.

A packaged application, built in a NODE_ENV=dev, can access either prod or dev networks. prod is the default, or alternatively you can open the application and pass a --mock flag to open and use a mock network.

linux

On Linux, the packaged application gets generated as a Shared Library file and hence cannot be run by double-clicking the executable. This is due to an issue with electron-builder( electron-userland/electron-builder#3950 ). But the application can be run through the terminal. You can run the browser by running ./safe-browser.

macOS

On macOS, the application should be located in the 'Applications' for security reasons. By default the packaged application will prompt to move the application. To override this, you can pass --ignoreAppLocation:

open release/safe-browser-<version>-mac-x64/SAFE\ Browser.app --args --ignoreAppLocation

Development commands

There are a few build commands for various situations:

  • yarn prod-dev will run a developer version of the application using the live network.
  • yarn build compiles all code, but you shouldn't need to use this
  • yarn build-preload will need to be run whenever you change the preload.js file for changes to show up in the browser.

Release

Pushes to master will be automatically released, with changelog generated from conventional commits (enforced at commit time, and checked at CI), and the version bumped autmomatically.

Alpha/Beta Channels

To release alpha/beta versions of the browser, simply create a version tag for the release you want, ie v0.18.0-alpha.0 and push this to the repository to trigger a build of that alpha/beta version.

Testing

  • yarn test runs jest (you have the optional yarn test-watch, too).
  • yarn test-e2e runs spectron integration tests (not yet stable).

Linting

  • yarn lint runs the linter and throws all of the lint errors
  • yarn lint-fix runs the linter, Automatically fix problems that it can & throws the remaining lint errors

Logging

Via electron-log: import { logger } from '$Logger', and you can logger.info('things').

Logs are printed to both render console and stdout. Logs are also written to a log file per system.

yarn log-osx will tail the file. Similar commands (as yet untested) exist for linux/windows.

electron-logis used under the hood, and ouputs logs to:

  • on Linux: ~/.config/safe-browser/logs/{process type}.log
  • on macOS: ~/Library/Logs/Safe Browser/{process type}.log
  • on Windows: %USERPROFILE%\AppData\Roaming\Safe Browser\logs{process type}.log

Further Help

You can discuss development-related questions on the SAFE Dev Forum. If you are just starting to develop an application for the SAFE Network, it's very advisable to visit the SAFE Network Dev Hub where you will find a lot of relevant information, including a tutorial to create an example SAFE web application which makes use of the API exposed by the SAFE Browser.

License

This SAFE Network library is dual-licensed under the Modified BSD (LICENSE-BSD https://opensource.org/licenses/BSD-3-Clause) or the MIT license (LICENSE-MIT https://opensource.org/licenses/MIT) at your option.

Contributing

Want to contribute? Great πŸŽ‰

There are many ways to give back to the project, whether it be writing new code, fixing bugs, or just reporting errors. All forms of contributions are encouraged!

For instructions on how to contribute, see our Guide to contributing.

More Repositories

1

qp2p

peer-to-peer communications library for Rust based on QUIC protocol
Rust
359
star
2

sn_routing

Routing - specialised storage DHT
Rust
276
star
3

crdt_tree

Rust
117
star
4

temp_safe_network

The Safe Network. A libp2p backed data and transfer network
Rust
109
star
5

self_encryption

file self encryptor
Rust
107
star
6

lru_time_cache

LRU cache settable via size or time to live
Rust
100
star
7

rfcs

Request for Comment (RFC) papers and discussions on Project SAFE core libraries and APIs
Rust
97
star
8

rust_sodium

This crate is no longer maintained. Looking for maintainers.
Rust
78
star
9

sn

The Safe Network Core. API message definitions, routing and nodes, client core api.
Rust
68
star
10

safe_network

Rust
56
star
11

sn_data_types

Safe Network Data Types
Rust
24
star
12

maidsafe-utilities

Utility functions
Rust
22
star
13

bls_dkg

Implementation of a BLS DKG mechanism, requires signing key, encryption key and SocketAddr of participants
Rust
20
star
14

sn_nodejs

Rust
18
star
15

blsttc

poanetwork/threshold_crypto using supranational/blst for sign+verify
Rust
18
star
16

safenetwork.tech

JavaScript
16
star
17

QA

JavaScript
15
star
18

sn_launch_tool

A cross platform tool to easily launch a SAFE Network test section from home
Rust
12
star
19

sn_transfers

Implementation of Transfers in the SAFE Network.
Rust
11
star
20

xor_name

Small library. XorName is an array that is useful for calculations in DHT etc.
Rust
11
star
21

safe-web-id-manager-js

JavaScript
10
star
22

maidsafe.net

Repository for maidsafe.net company website
CSS
10
star
23

sn_dbc

Safe Network DBCs
Rust
10
star
24

qjsonrpc

Provides the implementation of JSON-RPC over QUIC, which is required by the Authenticator daemon communication protocol.
Rust
10
star
25

dev-website

SAFE Network Dev Website source.
JavaScript
9
star
26

brb

Rust
9
star
27

safe-patter-js

JavaScript
8
star
28

sn_messaging

Rust
8
star
29

sn_testnet_tool

Just
7
star
30

sn_entropy_check

Rust
6
star
31

sn_fs

Rust
5
star
32

sn_cli

A Rust application which implements a CLI (Command Line Interface) for the Safe Network.
Rust
5
star
33

routing_model

Documentation of the control and message flows in Routing, and tests for validating these.
Rust
5
star
34

Whitepapers

MaidSafe Whitepapers
TeX
4
star
35

brb_membership

Rust
4
star
36

brb_node_qp2p

Rust
4
star
37

sn_authd

Rust
4
star
38

sn_sdkg

Synchronous Distributed Key Generation
Rust
4
star
39

sn_consensus

Rust
4
star
40

pr_size_checker

A GitHub Action which checks the number of additions and deletions made in each submitted PR, adding them together to come up with a total lines changed value, then checking whether this value exceeds the default or set max_lines_changed value. If it does exceed then the CI job will exit with code 1, i.e. fail.
4
star
41

sn_diagrams

Diagrams of the Safe Network codebase structure
HTML
3
star
42

brb_dt_orswot

Rust
3
star
43

brb_dt_at2

Rust
3
star
44

bls_ringct

Rust
3
star
45

bls_signature_aggregator

A Generic BLS Signature Accumulator for SAFE Network
Rust
3
star
46

brb_dt_tree

Rust
3
star
47

rust-version-bump-branch-creator

Bump your rust repo's version automatically, using conventional commits to generate a changelog and determine the correct new version.
JavaScript
3
star
48

sn_url

Rust
2
star
49

secured_linked_list

Rust
2
star
50

resource_proof

A 'proof' of bandwidth, cpu and storage for nodes in a decentralised network
Rust
2
star
51

bls_bulletproofs

Rust
1
star
52

blog-redirection

HTML
1
star
53

sn_testnet_action

1
star
54

safeup

Install and update safe-related components
Rust
1
star
55

cargo-nextest

Github Action for performing a test run using Nextest
1
star
56

sn-local-testnet-action

Github Action for administering local testnets
1
star