Skip to content

Commit

Permalink
Merge commit '56f730caaeabfec224aef219f0c32680a645b543'
Browse files Browse the repository at this point in the history
* commit '56f730caaeabfec224aef219f0c32680a645b543':
  controllers/main.go: tickets rpc error page (decred#483)
  stakepooldclient: continue loop on error (decred#482)
  new architecture diagram (decred#485)
  controller/main.go: remove enableStakepoold field (decred#490)
  fix styling of error page (decred#488)
  fix styling of error page (decred#488)
  Status page improvements (decred#484)
  stakepooldclient: more informative errors (decred#481)
  • Loading branch information
girino committed Sep 7, 2019
2 parents 6edcbc5 + 56f730c commit e991b4a
Show file tree
Hide file tree
Showing 9 changed files with 1,009 additions and 96 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vote on their behalf when the ticket is selected.

## Architecture

![Voting Service Architecture](https://i.imgur.com/2JDA9dl.png)
![Voting Service Architecture](img/architecture.png)

- It is highly recommended to use at least 2 dcrd+dcrwallet+stakepoold nodes for
production use on mainnet.
Expand Down
7 changes: 2 additions & 5 deletions controllers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ type MainController struct {
baseURL string
closePool bool
closePoolMsg string
enableStakepoold bool
feeXpub *hdkeychain.ExtendedKey
StakepooldServers *stakepooldclient.StakepooldManager
poolEmail string
Expand Down Expand Up @@ -1914,10 +1913,8 @@ func (controller *MainController) Tickets(c web.C, r *http.Request) (string, int
spui, err := controller.StakepooldServers.StakePoolUserInfo(multisig.String())
if err != nil {
// Render page with message to try again later
log.Infof("RPC StakePoolUserInfo failed: %v", err)
session.AddFlash("Unable to retrieve voting service user info", "main")
c.Env["Flash"] = session.Flashes("main")
return controller.Parse(t, "main", c.Env), http.StatusInternalServerError
log.Errorf("RPC StakePoolUserInfo failed: %v", err)
return "/error", http.StatusSeeOther
}

log.Debugf(":: StakePoolUserInfo (msa = %v) execution time: %v",
Expand Down
30 changes: 15 additions & 15 deletions harness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ fi
tmux new-session -d -s $SESSION

#################################################
# Setup the master node.
# Setup the dcrd node.
#################################################

tmux rename-window -t $SESSION 'master'
tmux rename-window -t $SESSION 'dcrd'

echo "Writing config for testnet dcrd node"
mkdir -p "${NODES_ROOT}/master"
cat > "${NODES_ROOT}/master/dcrd.conf" <<EOF
mkdir -p "${NODES_ROOT}/dcrd"
cat > "${NODES_ROOT}/dcrd/dcrd.conf" <<EOF
rpcuser=${RPC_USER}
rpcpass=${RPC_PASS}
rpccert=${DCRD_RPC_CERT}
Expand All @@ -55,8 +55,8 @@ testnet=true
logdir=${NODES_ROOT}/master/log
EOF

echo "Starting dcrd master node"
tmux send-keys "dcrd -C ${NODES_ROOT}/master/dcrd.conf" C-m
echo "Starting dcrd node"
tmux send-keys "dcrd -C ${NODES_ROOT}/dcrd/dcrd.conf" C-m

sleep 3 # Give dcrd time to start

Expand All @@ -75,30 +75,30 @@ for ((i = 1; i <= $NUMBER_OF_BACKENDS; i++)); do
# dcrwallet
#################################################
echo ""
echo "Writing config for voting-wallet-${i}"
mkdir -p "${NODES_ROOT}/voting-wallet-${i}"
cat > "${NODES_ROOT}/voting-wallet-${i}/dcrwallet.conf" <<EOF
echo "Writing config for dcrwallet-${i}"
mkdir -p "${NODES_ROOT}/dcrwallet-${i}"
cat > "${NODES_ROOT}/dcrwallet-${i}/dcrwallet.conf" <<EOF
username=${RPC_USER}
password=${RPC_PASS}
rpccert=${WALLET_RPC_CERT}
rpckey=${WALLET_RPC_KEY}
logdir=${NODES_ROOT}/voting-wallet-${i}/log
appdata=${NODES_ROOT}/voting-wallet-${i}
logdir=${NODES_ROOT}/dcrwallet-${i}/log
appdata=${NODES_ROOT}/dcrwallet-${i}
testnet=true
pass=${WALLET_PASS}
rpcconnect=${DCRD_RPC_LISTEN}
grpclisten=127.0.0.1:2010${i}
rpclisten=${WALLET_RPC_LISTEN}
EOF

echo "Starting voting-wallet-${i}"
tmux new-window -t $SESSION -n "voting-wallet-${i}"
tmux send-keys "dcrwallet -C ${NODES_ROOT}/voting-wallet-${i}/dcrwallet.conf --create" C-m
echo "Starting dcrwallet-${i}"
tmux new-window -t $SESSION -n "dcrwallet-${i}"
tmux send-keys "dcrwallet -C ${NODES_ROOT}/dcrwallet-${i}/dcrwallet.conf --create" C-m
sleep 2
tmux send-keys "${WALLET_PASS}" C-m "${WALLET_PASS}" C-m "n" C-m "y" C-m
sleep 2
tmux send-keys "${VOTING_WALLET_SEED}" C-m C-m
tmux send-keys "dcrwallet -C ${NODES_ROOT}/voting-wallet-${i}/dcrwallet.conf " C-m
tmux send-keys "dcrwallet -C ${NODES_ROOT}/dcrwallet-${i}/dcrwallet.conf " C-m
sleep 12 # Give dcrwallet time to start

#################################################
Expand Down
Binary file added img/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e991b4a

Please sign in to comment.