This document describes how to launch a Cardano cluster on AWS from scratch.
This document is to support developers in their need to deploy ad hoc clusters.
- cardano-sl git revision hash.
- iohk-ops branch. In absence of preference, the default is
master
. - Issue ID being worked on.
Note that io
is an alias to iohk-ops
which becomes available when
you enter the nix-shell
.
Replace ISSUE-ID
with your issue ID, or any name to identify the cluster.
This should all be in lowercase to avoid problems when updating DNS entries.
- SSH to the
staging
jumpserver. iohk-ops clone ISSUE-ID
-- the branch defaults tomaster
.cd ISSUE-ID
- optional:
git checkout SOME-BRANCH
iohk-ops set-rev cardanosl CARDANO-REVISION
nix-shell -A withAuxx
io new [--dont-generate-keys] [--configuration-key CONFIGURATION-KEY] ISSUE-ID Nodes [Explorer]
- the
CONFIGURATION-KEY
defaults todevnet
- this will generate stake keys using
cardano-keygen
, unless--dont-generate-keys
was passed - the elements after
ISSUE-ID
name cluster components, for the CSL nodes, explorer and report server, correspondingly -- which all are, strictly speaking, optional, with the caveat that having aNodes
-free cluster doesn't make a lot of sense
- the
io deploy
, with following optional arguments:--bump-system-start-held-by 15
-- bump--system-start
by N minutes from now, where now is the moment when thedeploy
subcommand starts to execute (which might be later than the invocation of theio
command itself, due to command pipelining)
- Make sure to use
io destroy --confirm delete
after you are done with the cluster to destroy the Nixops deployment -- all the local files remain intact.
systemd-journald
journals can be obtained -- either cluster-wide, or from a single node:
iohk-ops [--on u-a-1] -c staging-testnet.yaml get-journals [--since "2017-11-18 21:10:00 UTC"] [--until "2017-11-18 21:40 UTC"]
Notably:
--on NODE-NAME
--since JOURNALD-TIME-SPEC
, defaults to6 hours ago
--until JOURNALD-TIME-SPEC
, defaults to unspecified (essentiallynow
)
When one wants to redeploy a cluster, it's not necessary to destroy the machines and redeploy them from scratch: typically the following will suffice:
io deploy --build-only # only need this on deployments of new cardano commits
io stop wipe-node-dbs --confirm wipe-journals deploy --bump-system-start-held-by 5
- The genesis JSON file must be referred to from the
configuration.yaml
for thecardano-sl
commit specified incardano-sl-src.json
. - Secret keys need to be placed at
keys/keyN.sk
, whereN
ranges in0..k-1
, where k is the number of nodes. io new
needs be passed--dont-generate-keys
io deploy
needs NOT be passed--bump-system-start-held-by
This uses the customizable wallet connect script generator in cardano-sl (see Exchange Onboarding).
You need to clone the cardano-sl
repository and checkout the
particular commit used in io set-rev
(see rev
attribute of cardano-sl-src.json
):
git clone https://github.com/input-output-hk/cardano-sl.git && cd cardano-sl
git checkout CARDANO-REVISION
Important: make sure you are in the
cardano-sl
directory not iohk-ops
-- otherwise the parameters
won't take effect.
Create a file called custom-wallet-config.nix
with the following
contents:
{
walletListen = "127.0.0.1:8090";
## Directory for the wallet's local state.
## must be enclosed in double quotes.
stateDir = "./state-wallet-fragment";
## Set this to the DNS name of the relay in the dev cluster.
relays = "r1-ISSUE-ID.aws.iohkdev.io";
# Selects the "devnet" configuration,
environment = "override";
confFile = ./lib/configuration.yaml;
confKey = "devnet";
# A dummy value is required or the wallet will fail.
additionalNodeArgs = "--system-start 1";
}
That file contains the parameters for building the connect script. If the parameters change, then the connect script needs to be built again. To build the connect script:
nix-build -A connectScripts.demoWallet -o ./connect-devnet.sh
Run the wallet and it will connect to the developer cluster.
./connect-devnet.sh