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

automatic release created for v1.0.0-beta.11 #2142

Merged
merged 12 commits into from
Mar 2, 2019
18 changes: 12 additions & 6 deletions .aws/faucet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

AMOUNT=100stake
AMOUNTS=10000000stake
AMOUNTP=5photino
AMOUNTC=1cococoin

ACCOUNT=$1
PASSWORD=$2
NETWORK=$3
Expand All @@ -14,11 +17,14 @@ do
echo ${LIST} | while IFS= read -r row || [[ -n "$row" ]]; do
# for every file in the list pick the address and give money to it, then delete the file
DESTINATION=$(echo $row | awk '{print $4}')

# Just in case we were running this command with rest-server switched on, get again the address
ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address)
echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNT} --home . --from ${ADDRESS} --chain-id=${NETWORK}

if [[ ${#DESTINATION} -eq 45 ]];
then
# work only on stuff that have the right length
ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address)
echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTS} --home . --from ${ADDRESS} --chain-id=${NETWORK}
echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTP} --home . --from ${ADDRESS} --chain-id=${NETWORK}
echo ${PASSWORD} | ./gaiacli tx send ${DESTINATION} ${AMOUNTC} --home . --from ${ADDRESS} --chain-id=${NETWORK}
fi
# Remove this address from the ones that needs money
aws s3 rm s3://cosmos-gaia/addresses/${DESTINATION}
done
Expand Down
5 changes: 3 additions & 2 deletions .aws/first.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ aws s3 rm s3://cosmos-gaia/genesis.json
NODEID=$(./gaiad tendermint show-node-id --home .)

# Create our main account and add it to the genesis with a lot of money
echo ${PASSWORD} | ./gaiacli keys add ${ACCOUNT} --home . > main_node.log
./gaiad add-genesis-account $(./gaiacli keys show ${ACCOUNT} --home . --address) 100000000stake,100000photino,123cococoin --home .
echo ${PASSWORD} | ./gaiacli keys add ${ACCOUNT} --home . > account_address.log
./gaiad add-genesis-account $(./gaiacli keys show ${ACCOUNT} --home . --address) 100000000000000000stake,999000000000photino,123123123123cococoin --home .

echo ${PASSWORD} | ./gaiad gentx --name ${ACCOUNT} --home . --home-client .
./gaiad collect-gentxs --home .
Expand All @@ -28,3 +28,4 @@ screen -dmS gaia ./gaiad start --home .
screen -dmS rest ./gaiacli rest-server --laddr tcp://0.0.0.0:${API_PORT} --home . --node http://localhost:${PORT} --chain-id ${NETWORK} --trust-node true
screen -dmS faucet ./faucet.sh ${ACCOUNT} ${PASSWORD} ${NETWORK}

echo ${NODEID}
10 changes: 5 additions & 5 deletions .aws/others.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ PASSWORD=1234567890
ACCOUNT=operator_account
PORT=26656
# TODO: hardcoded temporary, this will become a parameter coming from the first ECS instance
MAINNODEID=a27e12bd071dc2eda3117a5a255743103259e184
MAINNODEID=a93accb0af3dfda1f40063bd45857c4808ba2d9b
MAINNODEIP=172.31.35.89
MAINACCOUNT=main_account
NETWORK=testnet
VALIDATOR_AMOUNT=10stake
VALIDATOR_AMOUNT=10000000stake

# Initialize local node with a secondary account
./gaiad init ${ACCOUNT} --home . --chain-id ${NETWORK}

GENESIS=`aws s3 ls s3://cosmos-gaia/genesis.json | grep genesis.json`
while [[ -z "$GENESIS" ]]; do
sleep 3s
ISTHERE=`aws s3 ls s3://cosmos-gaia/genesis.json | grep genesis.json`
GENESIS=`aws s3 ls s3://cosmos-gaia/genesis.json | grep genesis.json`
done
aws s3 cp s3://cosmos-gaia/genesis.json config/genesis.json

# GET Genesis file into config/genesis.json
NODEID=$(./gaiad tendermint show-node-id --home .)

# boot referring to the remote node
screen -dmS gaia ./gaiad start --home . --p2p.laddr=tcp://0.0.0.0:$((PORT)) --address=tcp://0.0.0.0:$((PORT+1)) --rpc.laddr=tcp://0.0.0.0:$((PORT+2)) --p2p.persistent_peers="$MAINNODEID@$MAINNODEIP:$((PORT))"
screen -dmS gaia ./gaiad start --home . --p2p.persistent_peers="$MAINNODEID@$MAINNODEIP:$((PORT))"

# get the key to make my node validator
PUBKEY=$(./gaiad tendermint show-validator --home .)
Expand All @@ -47,4 +47,4 @@ do
sleep 3s
done

echo ${PASSWORD} | ./gaiacli tx staking create-validator --home . --from ${ACCOUNT} --amount=${VALIDATOR_AMOUNT} --pubkey=${PUBKEY} --address-delegator=${ADDRESS} --moniker=${ACCOUNT} --chain-id=${NETWORK} --commission-max-change-rate=0 --commission-max-rate=0 --commission-rate=0 --min-self-delegation=1 -json
echo ${PASSWORD} | ./gaiacli tx staking create-validator --home . --from ${ACCOUNT} --amount=${VALIDATOR_AMOUNT} --pubkey=${PUBKEY} --address-delegator=${ADDRESS} --moniker=${ACCOUNT} --chain-id=${NETWORK} --commission-max-change-rate=0 --commission-max-rate=0 --commission-rate=0 --min-self-delegation=1
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ module.exports = {
"array-bracket-spacing": ["error", "never"],
"indent": ["error", 2, { "SwitchCase": 1 }],
"no-console": "off",
"semi": ["error", "never"]
}
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.0.0-beta.11] - 2019-03-02

### Changed

- [\#1887](https://github.com/cosmos/voyager/issues/1887) Activating Google Analytics anonymized by default @faboweb
- [\#2098](https://github.com/cosmos/voyager/issues/2098) rename devMode url flag to insecure @faboweb

### Fixed

- [\#2087](https://github.com/cosmos/voyager/issues/2087) More resilient scripts on Ec2 instances, added validators @sabau

## [1.0.0-beta.10] - 2019-03-01

### Added

- [\#135](https://github.com/cosmos/voyager/issues/135) Show fee distribution rewards @fedekunze @faboweb

### Changed

- [\#2044](https://github.com/cosmos/voyager/issues/2044) convert uatoms to atoms @faboweb
Expand Down
2 changes: 1 addition & 1 deletion app/src/helpers/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function getURLParams(window) {
const queries = window.location.search.slice(1).split(`&`)
return queries.reduce((config, current) => {
const [name, value] = current.split(`=`)
if ([`stargate`, `rpc`, `devMode`].includes(name)) {
if ([`stargate`, `rpc`, `experimental`].includes(name)) {
return {
...config,
[name]: value
Expand Down
6 changes: 3 additions & 3 deletions app/src/renderer/components/common/AppHeader.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<nav id="app-header" :class="{ mobile: !desktop }">
<div v-if="session.devMode" id="develop-mode-warning">
DEVELOPMENT MODE
</div>
<div class="container">
<div class="header-item header-item-logo">
<router-link to="/">
<img id="logo-white" src="~assets/images/cosmos-wordmark-white.svg">
</router-link>
</div>
<div v-if="!session.experimentalMode && session.insecureMode" id="develop-mode-warning">
INSECURE MODE
</div>
<app-menu v-if="open || desktop" @close="close" />
<template v-if="!desktop">
<div v-if="open" class="header-item close-menu" @click="close()">
Expand Down
4 changes: 2 additions & 2 deletions app/src/renderer/components/common/TmSessionWelcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@click.native="closeSession "
/>
<template
v-if="session.devMode"
v-if="session.insecureMode"
>
<li-session
v-if="accountExists"
Expand Down Expand Up @@ -45,7 +45,7 @@
subtitle="If you have a Ledger Wallet, choose this option."
@click.native="setState('hardware')"
/>
<fundraiser-warning v-if="session.devMode" />
<fundraiser-warning v-if="session.insecureMode" />
</div>
<div class="tm-session-footer" />
</div>
Expand Down
18 changes: 8 additions & 10 deletions app/src/renderer/components/staking/PageValidator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
{{ percent(validator.commission.rate) }}
</dd>
</dl>
<dl v-if="session.devMode" class="info_dl colored_dl">
<dl v-if="session.experimentalMode" class="info_dl colored_dl">
<dt>Slashes</dt>
<dd>--</dd>
</dl>
Expand Down Expand Up @@ -307,16 +307,14 @@ export default {
},
rewards() {
const { session, bondDenom, distribution, validator } = this
if (!session.signedIn) {
return null
if (!session.signedIn) {
return null
}

const validatorRewards = distribution.rewards[
validator.operator_address
]
const amount = validatorRewards ? full(
atoms(validatorRewards[bondDenom]) || 0
) : null
const validatorRewards = distribution.rewards[validator.operator_address]
const amount = validatorRewards
? full(atoms(validatorRewards[bondDenom]) || 0)
: null

if (amount) {
return `${amount} ${bondDenom}`
Expand All @@ -334,7 +332,7 @@ export default {
},
lastHeader: {
immediate: true,
handler(){
handler() {
if (this.session.signedIn) {
this.$store.dispatch(
`getRewardsFromValidator`,
Expand Down
2 changes: 2 additions & 0 deletions app/src/renderer/google-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports.enableGoogleAnalytics = function enableGoogleAnalytics(gaUID) {
(ga.q = ga.q || []).push(arguments)
}
ga.l = +new Date()
ga(`set`, `allowAdFeatures`, false)
ga(`set`, `anonymizeIp`, true)
ga(`create`, gaUID, `auto`)
}

Expand Down
11 changes: 8 additions & 3 deletions app/src/renderer/scripts/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import _Node from "../connectors/node"
import _Store from "../vuex/store"
import * as urlHelpers from "../../helpers/url.js"
import _config from "../../config"
import { enableGoogleAnalytics } from "../google-analytics"
const _enableGoogleAnalytics = enableGoogleAnalytics

export const routeGuard = store => (to, from, next) => {
if (from.fullPath !== to.fullPath && !store.getters.session.pauseHistory) {
Expand Down Expand Up @@ -52,7 +54,8 @@ export const startApp = async (
Store = _Store,
env = process.env,
Sentry = _Sentry,
Vue = _Vue
Vue = _Vue,
enableGoogleAnalytics = _enableGoogleAnalytics
) => {
Vue.use(Router)
Vue.use(Tooltip, { delay: 1 })
Expand Down Expand Up @@ -87,6 +90,8 @@ export const startApp = async (
window.addEventListener(`error`, function(event) {
Sentry.captureException(event.reason)
})

enableGoogleAnalytics(config.google_analytics_uid)
}

const stargate = urlParams.stargate || config.stargate
Expand All @@ -101,8 +106,8 @@ export const startApp = async (

router.beforeEach(routeGuard(store))

if (urlParams.devMode) {
store.commit(`setDevMode`)
if (urlParams.experimental) {
store.commit(`setExperimentalMode`)
}
if (urlParams.rpc) {
store.commit(`setRpcUrl`, urlParams.rpc)
Expand Down
2 changes: 1 addition & 1 deletion app/src/renderer/scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports.shortAddress = function (address, length = 4) {
}

module.exports.coinsToObject = function (coinArray) {
const coins = coinArray.reduce((dictionary, { denom, amount }) => { dictionary[denom] = Number(amount); return dictionary; }, {})
const coins = coinArray.reduce((dictionary, { denom, amount }) => { dictionary[denom] = Number(amount); return dictionary }, {})
return coins
}

Expand Down
24 changes: 9 additions & 15 deletions app/src/renderer/vuex/modules/session.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import * as Sentry from "@sentry/browser"
import noScroll from "no-scroll"
import {
enableGoogleAnalytics,
disableGoogleAnalytics,
track
} from "../../google-analytics.js"
import config from "../../../config"
Expand All @@ -13,7 +11,8 @@ export default () => {
const ERROR_COLLECTION_KEY = `voyager_error_collection`

const state = {
devMode: config.development,
experimentalMode: config.development,
insecureMode: config.development,
signedIn: false,
accounts: [],
localKeyPairName: null, // used for signing with a locally stored key, TODO move into own module
Expand All @@ -39,8 +38,6 @@ export default () => {
importKey,
testPassword,
generateSeed,
enableGoogleAnalytics,
disableGoogleAnalytics,
track,
Sentry
}
Expand All @@ -63,8 +60,11 @@ export default () => {

state.modals.help.active = value
},
setDevMode(state) {
state.devMode = true
setExperimentalMode(state) {
state.experimentalMode = true
},
setInsecureMode(state) {
state.insecureMode = true
},
addHistory(state, path) {
state.history.push(path)
Expand Down Expand Up @@ -208,19 +208,13 @@ export default () => {
dsn: state.externals.config.sentry_dsn,
release: state.externals.config.version
})
state.externals.enableGoogleAnalytics(
state.externals.config.google_analytics_uid
)
console.log(`Analytics and error reporting have been enabled`)
console.log(`Error collection has been enabled`)
state.externals.track(`pageview`, {
dl: window.location.pathname
})
} else {
console.log(`Analytics disabled in browser`)
console.log(`Error collection has been disabled`)
state.externals.Sentry.init({})
state.externals.disableGoogleAnalytics(
state.externals.config.google_analytics_uid
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cosmos-voyager",
"productName": "Cosmos Voyager",
"version": "1.0.0-beta.10",
"version": "1.0.0-beta.11",
"description": "Voyager is an electron-based user interface for the Cosmos Network.",
"author": "All In Bits, Inc <[email protected]>",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/helpers/vuex-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function vuexSetup() {
loadPersistedState: () => {}
}
})
store.state.session.devMode = true
store.state.session.experimentalMode = true

jest.spyOn(store, `dispatch`)
jest.spyOn(store, `commit`)
Expand Down
Loading