Skip to content

Commit

Permalink
Cleanup the priviledge specific nix files.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadales authored and jbgi committed Apr 6, 2021
1 parent 5a575bd commit 141d412
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
11 changes: 10 additions & 1 deletion examples/shelley-testnet/README.md
Expand Up @@ -110,7 +110,7 @@ files are there and that this works.
export MYENV=my-env # Choose the name of your environment.
cp examples/shelley-testnet/globals.nix globals-$MYENV.nix
ln -s globals-$MYENV.nix globals.nix
cp examples/topologies/shelley-testnet.nix topologies/$MYENV.nix
cp examples/shelley-testnet/topology.nix topologies/$MYENV.nix
```

After the files above are created change the `enviromentName` of
Expand Down Expand Up @@ -369,6 +369,15 @@ by running:
```sh
cardano-cli shelley query stake-distribution --testnet-magic 42 --shelley-mode
```
### Querying the blocks produced per-stakepool

You can dump the ledger state and look into the value to the `nesBprev` field
or the `nesBCur` field to get the number of blocks produced per-stakepool in
the previous and current epochs, respectively. For instance:

```sh
cardano-cli shelley query ledger-state --testnet-magic 42 --shelley-mode | jq '.nesBcur'
```

### Key hashing

Expand Down
File renamed without changes.
@@ -1,7 +1,18 @@
#!/bin/bash

#!/usr/bin/env bash
#
# This is a simple test that submits an update proposal so that stakepools can
# produce blocks, and registers stakepools.
#
# This script requires the following environment variables to be defined:
#
# - BFT_NODES: names of the BFT nodes
# - POOL_NODES: names of the stake pool nodes
#
set -euo pipefail

[ -z ${BFT_NODES+x} ] && (echo "Environment variable BFT_NODES must be defined"; exit 1)
[ -z ${POOL_NODES+x} ] && (echo "Environment variable POOL_NODES must be defined"; exit 1)

if [ -z ${1+x} ];
then
echo "'redeploy' command was not specified, so the test will run on an existing testnet";
Expand All @@ -10,7 +21,7 @@ else
redeploy )
echo "Redeploying the testnet"
nixops destroy
create-shelley-genesis-and-keys
./scripts/create-shelley-genesis-and-keys.sh
nixops deploy -k
;;
* )
Expand All @@ -19,20 +30,17 @@ else
esac
fi

sleep 30

# TODO: can we get this from the nix files?
BFT_NODES=( bft-a-1 )
POOL_NODES=( stk-b-1-IOHK1 stk-c-1-IOHK2 stk-d-1-IOHK3 )
BFT_NODES=($BFT_NODES)
POOL_NODES=($POOL_NODES)

for f in ${BFT_NODES[@]}
do
nixops scp $f submit-update-proposal.sh /root/ --to
nixops scp $f examples/shelley-testnet/scripts/submit-update-proposal.sh /root/ --to
done

for f in ${POOL_NODES[@]}
do
nixops scp $f register-stake-pool.sh /root/ --to
nixops scp $f examples/shelley-testnet/scripts/register-stake-pool.sh /root/ --to
done

for f in ${BFT_NODES[@]}
Expand Down
File renamed without changes.

0 comments on commit 141d412

Please sign in to comment.