Cosmos Voyager — the user interface for the Cosmos Network.
faboweb and fedekunze Fabo/1291 query full nodes (#1394)
* implemented querying a fixed full node directly

* removed tests for dead code

* linted

* changelog

* linting

* fixed pinging tests

* use local endpoints in e2e tests

* added node module coverage

* removed dead code in main thread

* removed dead tests

* readded connection tests

* rephrased test

* comment

* fixed lcdclient tests

* fix staking using remote

* removed comments

* added additional check for rpcURL
Latest commit e659c78 Oct 12, 2018
Permalink
Failed to load latest commit information.
.circleci Delete release-candidate tag correctly. Oct 4, 2018
app Fabo/1291 query full nodes (#1394) Oct 12, 2018
archive/components e2es failing because of local storage Aug 16, 2018
docs synced release.md Jul 23, 2018
tasks Delete release-candidate tag correctly. Oct 4, 2018
test Fabo/1291 query full nodes (#1394) Oct 12, 2018
.babelrc first commit Jan 21, 2017
.eslintignore Add /app/networks to .eslintignore. Jul 12, 2018
.eslintrc.js Fabo/quotes rule (#1362) Sep 27, 2018
.gitattributes Reduce CHANGELOG.md conflicts. Aug 19, 2018
.gitignore sneeked in ignor local tesnet folder Jul 11, 2018
.npmrc Use exact version numbers for dependencies. Mar 26, 2018
.prettierignore Tell Prettier to ignore automatically generated files within /test/un… Apr 19, 2018
CHANGELOG.md Fabo/1291 query full nodes (#1394) Oct 12, 2018
CODEOWNERS Update CODEOWNERS Mar 23, 2018
CONTRIBUTING.md typo May 23, 2018
ISSUE_TEMPLATE.md prettier May 23, 2018
LICENSE create basic pages and add license, author Jan 21, 2017
PULL_REQUEST_TEMPLATE.md Update PULL_REQUEST_TEMPLATE.md May 23, 2018
README.md Fabo/1291 query full nodes (#1394) Oct 12, 2018
codecov.yaml Update codecov.yaml Jul 11, 2018
jest.config.js Fabo/quotes rule (#1362) Sep 27, 2018
package.json Changed minor component of version number to match testnet version. Oct 10, 2018
webpack.main.config.js Fabo/quotes rule (#1362) Sep 27, 2018
webpack.renderer.config.js Fabo/quotes rule (#1362) Sep 27, 2018
yarn.lock Add integrity field to yarn.lock. Oct 10, 2018

README.md

Cosmos Voyager logo — spaceship blasting off

Cosmos Voyager

CircleCI codecov

👋 Welcome to Voyager, the official desktop application for the Cosmos Network.

⚠️ This is still alpha-level software. DO NOT enter your Cosmos fundraiser seed into Voyager.

💻 Voyager runs on macOS 10.9+, Windows 7+, and Debian-based Linux distros.

🎉 Binary releases are available here. After downloading and untar/unzip-ing, navigate to the source directory and click on the Cosmos Voyager icon to launch Voyager.


Voyager Prerequisites

Docker

Building Voyager and its dependencies requires Docker installed.

Build Gaia (Cosmos SDK)

Build the Gaia CLI (gaiacli) and full node (gaiad), which are part of the Cosmos SDK, with the following command:

yarn build:gaia

The version built is specified in tasks/build/Gaia/COMMIT.sh and the programs are placed in the builds/Gaia directory.

Testnet Configurations

To connect to a testnet, Voyager needs the configuration files of those networks in the folder app/networks/{network_name}. Gaia has a Git repository that holds the configuration files. Voyager has script to download those configurations for you:

yarn build:testnets

Check Out Voyager

Voyager requires Node.js >=9.4.0. If you have a different version of Node.js installed (e.g. Node.js 8.11 LTS), you can use n to install the correct version. The following command will use n to install it alongside your current version of Node.js.

npm i -g n && n 9.4.0

Yarn is a JS package packager we use manage Voyager dependencies. Download it.

With Node.js and Yarn installed, you're ready to check out the source code:

git clone https://github.com/cosmos/voyager.git
cd voyager
yarn install

Voyager Development

To run Voyager on the default testnet:

$ yarn start

To run Voyager on a specific testnet, see the status page for a list of available testnets.

$ yarn start <networkName>

To run Voyager on a local node:

First, start a full node following the testnet instructions.

Then start Voyager pointing at your local node.

$ COSMOS_NODE=localhost yarn start

Building Voyager Binaries

First Build Gaia and Download the testnet configurations.

Here's an example build command:

yarn run build --commit=HEAD --network=gaia-8001

You can specify --help to see all options with explanations.

When the build is complete, you can find the files in builds/Voyager.

To test if your build worked run:

$ yarn test:exe {path to the unpacked executable}

To make an official release, follow the instructions in docs/release.md.


Testing

Voyager is using Jest to run unit tests.

$ yarn test

You can run the unit tests for a single file (e.g., PageValidator.spec.js) whenever there are changes like this:

$ yarn watch PageValidator

To check test coverage locally run following. It will spin up a webserver and provide you with a link to the coverage report web page.

$ yarn test:coverage

Debug

To debug the electron application, build it and run the node inspector for the built files:

$ electron --inspect-brk builds/{{your build}}/resources/app/dist/main.js

Then attach to the debugger via the posted url in Chrome.

To debug the electron view, set the environment variable COSMOS_DEVTOOLS to something truthy like "true". The Chrome DevTools will appear when you start Voyager.

To see the console output of the view in your terminal, set the environment variable ELECTRON_ENABLE_LOGGING to something truthy like 1.


Run a local node

Sometimes you may want to run a local node, i.e. in the case there is no available network. To do so first Build Gaia, then use our automatic script or the manual process to set up your node.

Automatically

You can do the entire process in one command by running:

$ yarn build:local --overwrite=true

(Be careful with the --overwrite flag as it will remove previous local node configurations)

Manually

You can do the entire process manually by following these steps:

First initialize your node:

$ builds/Gaia/{OS}/gaiad init --home ~/.gaiad-testnet --name local

Write down the 12 word secret phrase to be able to import an account that holds tokens later on.

Copy the configuration files (assuming you are in the Voyager dir):

$ mkdir builds/testnets/local-testnet
$ cp ~/.gaiad-testnet/config/{genesis.json,config.toml} builds/testnets/local-testnet/

Enter your local node as a seed:

$ sed -i.bak 's/seeds = ""/seeds = "localhost"/g' ./builds/testnets/local-testnet/config.toml

Activate TX indexing in your local node:

$ sed -i.bak 's/index_all_tags = false/index_all_tags = true/g'  ~/.gaiad-testnet/config/config.toml

Store the gaia version used in your local testnet:

$ ./builds/Gaia/{OS}/gaiad version > ./builds/testnets/local-testnet/gaiaversion.txt

Start your local node:

$ ./builds/Gaia/{OS}/gaiad start --home ~/.gaiad-testnet

Then run Voyager for your local testnet:

$ yarn start local-testnet

Import the account with the 12 word seed phrase you wrote down earlier.

Flags

A list of all environment variables and their purpose:

Variable Values default Purpose
NODE_ENV 'production', 'development'
LOGGING 'true', 'false' 'true' Disable logging
COSMOS_NETWORK {path to network configuration folder} '../networks/gaia-7001' Network to connect to
COSMOS_HOME {path to config persistence folder} '$HOME/.cosmos-voyager[-dev]'
LCD_URL {URL of a Cosmos light client interface} see 'app/config.toml' Cosmos Light Client interface to connect to
RPC_URL {URL of a Tendermint rpc interface} see 'app/config.toml' Tendermint node to connect to
COSMOS_DEVTOOLS 'true', 'false' 'false' Open the debug panel in the electron view
ELECTRON_ENABLE_LOGGING 'true', 'false' 'false' Redirect the browser view console output to the console
PREVIEW 'true', 'false' 'true' if NODE_ENV 'development' Show/Hide features that are in development
COSMOS_E2E_KEEP_OPEN 'true', 'false' 'false' Keep the Window open in local E2E test to see the state in which the application broke.
CI 'true', 'false' 'false' Adds better structured output, makes a screenshot and adds logs to files (used on CircleCI).

FAQ

  • If tendermint crashes and the log shows Tendermint state.AppHash does not match AppHash after replay. delete the config folders at $HOME/.cosmos-voyager[-dev].

  • If you use yarn, the post-install hook may not execute. If this happens you'll have to execute the script manually:

$ cd app
$ yarn
$ cd ..
$ npm run rebuild
  • If electron shows the error: A DLL initialization routine has failed. rebuild the electron dependencies:
$ npm run rebuild
  • If you have trouble installing dependencies, remove all the lockfiles and try installing again.
$ rm -rf app/yarn.lock
$ rm -rf app/package-lock.json
$ rm -rf yarn.lock
$ rm -rf package-lock.json
  • If your components are not found using a short path, check if the path resolution is applied for Webpack (webpack.renderer.js > rendererConfig.resolve.alias) and Jest (package.json > jest.moduleNameMapper).

  • If starting the development server fails with the error: Error: listen EADDRINUSE 127.0.0.1:9080, you have still a development server process running. Kill it with kill $(lsof -t -i:9080) on Unix systems. On Windows Powershell first look for the processes with netstat -a -o -n | Select-String -Pattern "9080" then kill them with taskkill /F /PID {PID}.

  • If yarn test:e2e outputs an error about ChromeDriver timeout, remove your node_modules folder and reinstall all dependencies.
  • The version mismatch (The network you are trying to connect to requires gaia X, but the version Voyager is using is Y.) is testing the gaia version in /builds/Gaia/... against the one specified in the config dir ~/.cosmos-voyager[-dev]/{NETWORK}/gaiaversion.txt. If you know that you have the correct version, change it in gaiaversion.txt.

✌️