Giter VIP home page Giter VIP logo

cardano-tutorials's Introduction

Tutorials and Exercises

Find here a series of resources to help you with installation, operation and development against the Cardano platform. We're constantly developing materials to help you understand our platform and make use of its features.

Tutorials

The current release of tutorials focus on setting up & monitoring the node and use of its Command Line Interface (CLI) to perform a number of fundamental operations. The tutorials can be found here.

Exercises

A set of exercises to help you become familiar with running a stake pool on the Testnet can be found here.

.. toctree::
   :maxdepth: 3
   :titlesonly:
   :hidden:

   node-setup/000_AWS.md
   node-setup/000_install.md
   node-setup/010_getConfigFiles_AND_Connect.md
   node-setup/011_cli.md
   node-setup/012_understanding-config-files.md
   node-setup/020_keys_and_addresses.md
   node-setup/030_faucet.md
   node-setup/040_transactions.md
   node-setup/050_register_key.md
   node-setup/060_node_keys.md
   node-setup/061_KES_period.md
   node-setup/070_core_relay.md
   node-setup/080_register_stakepool.md
   node-setup/081_start_your_nodes.md
   node-setup/090_retire_stakepool.md
   node-setup/091_logging.md
   node-setup/092_ekg.md
   node-setup/093_prometheus.md

cardano-tutorials's People

Contributors

adajaws avatar arturwieczorek avatar askbid avatar aticomismana avatar bahamasbahamas avatar bergr01 avatar brunjlar avatar carloslopezdelara avatar codiepp avatar dmitrystas avatar dostrelith678 avatar elfinka avatar gmanroney avatar gufmar avatar hexadecimal-pool avatar kevinhammond avatar laplasz avatar lunarpool avatar mertenvg avatar michaeljfazio avatar nahern avatar nilaysaha avatar noctljrne avatar polypool avatar rickymac68 avatar robcohen avatar stakepool247 avatar steakandbake avatar sviksha avatar wi-ski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cardano-tutorials's Issues

Excercise 1: Monitoring a Node with EKG Step 3

Erroneous command cfg=configuration/defaults/mainnet

needs to say either:
cfg=configuration/defaults/mainnet-via-fetcher
-or-
cfg=configuration/defaults/mainnet-silent

for it to work correctly

Exercise 3 : Wrong impression of creating stake pool

All we seem to be doing in exercise 3 is creating and using actual cryptographic keys that will be used for creating and registering StakePool certificate. Reading the exercise gives an impression that we are running a stake pool.

I feel the seperation between creating/using keys and actually creating pool (which involves defining pool parameters via pool certificate, alongwith getting a pool ID) - leave alone registering it on chain should be distinctly clear.

Exercise 1: Monitoring a node with EKG Step 3 part 2

I think this command:
cardano-node run
--topology topology.json
--database-path db
--socket-path db/socket
--port 8080
--config config.yaml

Is supposed to be:
cardano-node run
--topology topology.json
--database-path db
--socket-path db/socket
--host-addr 127.0.0.1\ <---- Add this?
--port 8080 \ <---- Is this the correct port number? topolgy says 3002
--config config.yaml

Typo in logging tutorial

Hi,
in logging tutorial there is a typo in the last sentence

It is also possible to exert more fine-grained control on what information to log, but we will not conver this in this tutoral.

Which should be cover and tutorial respectively.

Transactions tutorial: tx not processed

What to do if after following the Transaction tutorial, the transaction I submitted was not processed - the funds were not taken from the source address and they did not get to the destination address?

Is there any way we can see:

  • if our nodes are synced?
  • the status of the submitted/created transactions?

Exercise 1: Block Producers and Relays Step 1 Error in how genesis.json is created

In the section Block Producers and Relays Step 1 it has the user perform:
cd cardano-node
mkdir block-producing
mkdir relay
cp config.yaml genesis.json topology.json block-producing/
cp config.yaml genesis.json topology.json relay/

The problem with these steps is that is copies an unusable genesis.json to the directories /block-producing/ and /relay/

The unusable genesis.json was created during the section Monitoring a Node with EKG Step 3. Need procedures to capture the correct genesis.json before performing this step.

Exercice 3 : Third point of the Exercice section

We can read "We will use 0 for the KES period, since we are creating the first KES key."

The CLI definition for the KES period is :
--kes-period NATURAL The start of the KES key validity period.

Therefore, it is unclear in the exercice if --kes-period 0 was selected because it was early days/hours in the blockchain or if it is because it is the first KES used.

Could you clarify if the start of the KES key validity period is actually the slot height we want to new op-cert to be valid at ? May be also in the CLI ?

Error in tutorial address.md

There is a error in the tutorial for creating a payment and stake address:

cardano-cli shelley address build
--payment-verification-key-file payment.vkey
--stake-verification-key-file stake.vkey
--out-file payment.addr

The command above states: stake-verification-key-file. This should be staking-verification-key-file.

There are no clear instructions on how to connect to the Friends&Family Testnet

My understanding is there will be a Friends&Family Testnet but the only tutorial I see is related to how to connect to Mainnet.

It would be nice to have a more explicit tutorial for connecting to the F&F Tesnet:

  1. build the node as per - https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/build.md
  2. download the genesis and node configuration files from here - https://hydra.iohk.io/build/2611795/download/1/index.html:
  3. create 2 local nodes (and start them) - as per https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/topology.md

Like you see above, there are different pieces in different places. It would be useful to have all them in 1 place.

Solution 1 Issues

cabal build all

Sometimes cabal is installed as 2.4.0.0 while we need cabal 3.2.0.0. This can be fixed by running:

cabal update
cabal install Cabal cabal-install 
export PATH="$HOME/.cabal/bin:$PATH"

cabal install cardano-node cardano-cli

You need to sometimes run cabal user-config update before the installation works, although this is only really documented in github issues such as haskell/cabal#5973

build-enterprise

This has changed and should just be build

Exercise 2: Incorrect parameter specified for `transaction submit`

In section 5 the incorrect parameter is used (--tx-filepath instead of --tx-file)

  1. Submit your transaction to the Blockchain:
 cardano-cli shelley transaction submit \
     --testnet-magic … \
     --tx-filepath txout

This should be

  1. Submit your transaction to the Blockchain:
 cardano-cli shelley transaction submit \
     --testnet-magic … \
     --tx-file txout

Build Failure On Debian 10 in Build.Md

I tried to adapt the build rules for Debian 10 based on what is in the tutorials. Installed the following packages on Debian 10:

git libgmp-dev zlib1g-dev libsystemd-dev ncurses-dev g++ libffi-dev make

All instructions were followed up to and including stack install

A lot of log messages appeared punctuated by the following:
...
...
Cabal > [141 of 220] Compiling Distribution.Simple.Utils
Cabal > [142 of 220] Compiling Distribution.Utils.NubList
Cabal > [143 of 220] Compiling Distribution.Utils.LogProgress
Cabal > [144 of 220] Compiling Distribution.Simple.Program.ResponseFile
Cabal > [145 of 220] Compiling Distribution.Simple.Program.Find
Cabal > [146 of 220] Compiling Distribution.Simple.Program.Types
Cabal > [147 of 220] Compiling Distribution.Simple.Program.Run
Cabal > [148 of 220] Compiling Distribution.Simple.Program.Script
Cabal > [149 of 220] Compiling Distribution.Simple.Program.Hpc
Cabal > [150 of 220] Compiling Distribution.Simple.Glob
Cabal > [151 of 220] Compiling Distribution.Simple.Compiler
Cabal > [152 of 220] Compiling Distribution.Simple.GHC.ImplInfo
Cabal > [153 of 220] Compiling Distribution.Simple.Program.GHC
Cabal > [154 of 220] Compiling Distribution.Simple.Program.Builtin
Cabal > [155 of 220] Compiling Distribution.Simple.Program.Db
Cabal > [156 of 220] Compiling Distribution.Simple.Program
Cabal > [157 of 220] Compiling Distribution.Simple.Program.Strip
Cabal > [158 of 220] Compiling Distribution.Simple.Command
Cabal > [159 of 220] Compiling Distribution.Simple.Setup
Cabal > ghc: internal error: Unable to commit 1048576 bytes of memory
Cabal > (GHC version 8.6.5 for x86_64_unknown_linux)
Cabal > Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug

-- While building package Cabal-2.4.1.0 using:
/home/cardano/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1 build --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure (-6)

Expectation was that the build would complete without error.

version bump to 1.12 needed when following instructions to copy executables

This affects the following two sets of instructions:

https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/GuideForExcercise1.md

(^ thank you for creating this - I am sure it will make exercise 1 much easier)

https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/build.md

The following steps need to be updated to 1.12

cabal build all
 cp -p dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-node-1.11.0/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
 cp -p dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-cli-1.11.0/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/

I made the silly mistake of building version 1.12 and then copying version 1.11 into place. This succeeded as I had 1.11 lying around and I didn't notice straight away.

Excercise 1: Block Producers and Relays missing steps to set TPraos vice RealPBFT in config.yaml

The section in Excercise 1: Block Producers and Relays missing steps to set TPraos vice RealPBFT in config.yaml

The current setting is
Protocol: RealPBFT

But according to resident experts it needs to be set to:
Protocol: TPraos

Before launching the node later in the exercise. This might also be a good point to make sure people are using the correct genesis.json since there is a difference between RealPBFT and TPraos in how they use genesis.json

Relays nodes and the topology

I think the description in
https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/topology.md
is not up to date.
AFAIK in a setup with a relay-node and a dedicated block producer (running on separate servers),
there is no need to open incoming ports in the firewall of the server of the block-producer
and also it is not necessary to add the block-producer to the topology description of the relay-node.
I tried this simplified setup and it works fine.

Magic number

Most cli calls require the magic number.
It would be good to have a section explaining what this is and why it is required.

Exercise 2: Improve steps for calculating fees and ttl

This exercise could be improved by including the steps for calculating the minimum fee for the transaction instead of a hard-coded number. When sending real transactions, people will want to know how to do this.

Also, the TTL is just set to a hardcoded high value. I think it's important to query the tip and add 1000 or so to the slot number.

Creating an address tutorial build vs build-enterprise

Tutorial: https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/address.md

The code blocks refer to using the parameter build-enterprise which doesn't work in pioneer-3. There is a comment in the running text that says to use build instead of build-enterprise in recent versions but I didn't notice it at first.

Unless it's necessary to support several versions of cardano-cli in the tutorial I think it might be clearer to remove this comment and replace all instances of build-enterprise with build.

Exercise 2: https://github.com/input-output-hk/cardano-tutorials/blob/master/pioneers-testnet/pioneers-exercise-2.md
Exercise 2 also refers to build-enterprise when I think it should be build.

Accessing EKG externally

Running the node on a VPS and my config file I have:

setupBackends:
  - KatipBK
  - EKGViewBK

hasEKG: 12782

I have no firewall configured.

Opening
http://myIp:12782 in the browser does not load anything (times out).

Is it possible to access EKG from an external machine?

EKG Assumes Local Connection & Won't Work If Remote - EKG.md

On EKG.MD we say "On our local machine, we can go to 127.0.0.1:8080 in our browser and see the EKG monitoring information." If users have followed instructions they will not be able to perform this step unless they install a desktop and export the display. We need to provide instructions here for how to connect to the web browser from an external IP address. Am assuming here that EKG comes as part of the Cardano installation as there are no instructions to do so.

Address.md is outdated

The arguments have changed for generating addresses cardano-cli shelley address. This has affected build and also it's subsequent arguments.

ekg.md - Provide default config files

In the 'Monitoring a node with EKG' exercise, step 3, the instructions for copying the configuration.yaml, topology.json and genesis.json files are not ideal.

cfg=configuration/defaults/mainnet-via-fetcher
cp $cfg/configuration.yaml config.yaml
cp $cfg/topology.json .
cp $cfg/genesis.json .

The configuration.yaml file specified requires modification:
Protocol: RealPBFT
RequiresNetworkMagic: RequiresNoMagic

It would be preferable to provide a shortcut to an existing config.yaml file that can be downloaded using wget.

Comments On node-setup/AWS.md

In https://github.com/gmanroney/cardano-tutorials/blob/master/node-setup/AWS.md

- "In order to build a node from source, run it and connect it to the Cardano mainnet, you need a Linux system with at least 4GB RAM and 24GB harddrive space. The RAM is mostly needed for building the node; for running it, 1GB would be sufficient. " - Is this the RAM requirements for Stakepool Operators on mainnet? Can this also be reviewed by @kevinhammond please so guidelines there are consistent?

  • AWS is an option and users are free to use whatever provider or hardware they wish.

  • Assume this configuration is applicable to testnets only?

Firewall Rules For EKG.md & Prometheus.md

We need generic firewall rules that can be used with iptables to allow for external access to EKG and Prometheus including accessing browsers and exporting displays. We have good AWS guidlelines but it needs to be more generic

Please fix the payment and stake address creation in all tutorial files

hi,

so exercise 4 goes now back to the

cardano-cli shelley stake-address build

command? that command was changed to

cardano-cli shelley address build

with the two vkeys as parameter before?

so the payment and stakeaddress is no longer related to each other?

please correct the usage in exercise-4 if false, also in node-setup/address.md and also in node-setup/staking-key.md

thx!

best regards,
martin

Address creation doc generates the old address (start with 8) instead of the new format (start with 6)

Hi all,

2nd wave Pioneer :) yay! I'm following the exercises one at the time and doing as told.

On the tutorial on how to make an address, if one follows the instruction verbatim ends up with the old address type (starts with 8). However the G Docs now use a new format (starts with 6). To generate the right kind of address (start with 6) I had to remove one line.

docs: https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/address.md#payment-address

current instructions (8 addr):

cardano-cli shelley address build \
 --payment-verification-key-file payment.vkey \
 --stake-verification-key-file stake.vkey \
 --out-file payment.addr  

working instructions (6 addr):

cardano-cli shelley address build \
 --payment-verification-key-file payment.vkey \
 --out-file payment.addr  

I don't know if the 6 address is a temporary thing, or if it's supposed to be 8 at the end. I just found the docs misleading for the current state of affairs. I hope this can help.

Cheers

Exercise-3: elegant way to copy the right files

Hi,

instead of:

git checkout tags/pioneer-3
git branch
> * (HEAD detached at pioneer-3)
…
cabal build all
cp …/cardano-node ~/.local/bin
cp …/cardano-cli ~/.local/bin

a more elegant way of doing the executables copy would be:

cp $(find . -name cardano-node -executable -type f) ~/.local/bin
cp $(find . -name cardano-cli -executable -type f) ~/.local/bin

this should work also for future updates on ghc or cardano-node version numbers.

best regard,
martin - atada_stakepool

Exercise 1: Creating an Address: Step 3 CARDANO_NODE_SOCKET_PATH failed error

I am using the pioneer branch and the correct ff-genesis.json renamed to genesis.json, Ubuntu 20.04 and I get this error at Step 3:

rick@digiff:~/cardano-node$ cardano-cli shelley query filtered-utxo --address 82065820eb0a15e9e378203230ada87ab74b749dde774741c3e7fba4f4a4028fbdeb3ad0 --testnet-magic 42

Lookup of environment variable "CARDANO_NODE_SOCKET_PATH" failed.

I don't know if this is a procedural error related to #39 or a code error reading the json, or related to the TPraos / RealPBFT setting in the config.yaml

Screen Shot 2020-05-13 at 10 54 43 PM

Exercise 2: Improvements

  1. At the beginning of section Exercises I would add direct link to:
    https://github.com/input-output-hk/cardano-tutorials/blob/master/node-setup/tx.md

with info that we will be following steps from there.

  1. I don't understand the paragraph 4:

Generate a signing key, txsign.
cardano-cli keygen …

We already have an address and all associated with it keys (including signing key) created in Excercise 1, referred here as myaddr, so for signing this tx, we just need to use it here, or I am misunderstood something ?

  1. As it was pointed here: #36 fix syntax in some commands

cardano-cli shelley address build does not work anymore on `Pioneer` tag

root@ubuntu-4gb-nbg1-2:~/cardano-node# cardano-cli shelley address build
Invalid argument `build'
Usage: cardano-cli shelley address COMMAND
  Shelley address commands

The build argument is no longer available and 4 new arguments are present - build-staking, build-reward, build-enterprise, 'build-multisig'

root@ubuntu-4gb-nbg1-2:~/cardano-node# cardano-cli shelley address
Usage: cardano-cli shelley address COMMAND
  Shelley address commands

Available commands:
  key-gen                  Create a single address key pair.
  key-hash                 Print the hash of an address key to stdout.
  build-staking            Build a standard Shelley address (capable of
                           receiving payments and staking).
  build-reward             Build a Shelley reward address (special address for
                           recieving staking rewards).
  build-enterprise         Build a Shelley enterprise address (can recieve
                           payments but not able to stake, eg for exchanges).
  build-multisig           Build a multi-sig address.
  info                     Print information about an address.

The old parameters are used both into tutorials (https://github.com/input-output-hk/cardano-tutorials) and documentation (https://github.com/input-output-hk/cardano-node/blob/master/doc/shelley-genesis.md)

Exercise 1: Configuring Logging prior to step 1

Here we will look at various ways to control log output generated by the node.

should say...

Here we will look at various ways to control log output generated by the node using the config.yaml file

This way new users know where they are looking. The file had not been referred to yet.

Excercise 2 - broken link

What: Broken link
Where: Prerequisites, 2, link b

There is redundant b. before url that makes it broken HOWEVER when the link is corrected to - https://testnet.cardano.org/ - it is also not working.

Read the IOHK Tutorial Documentation and General Documentation on Basic Transactions, Metadata, Addresses, Blocks and Slots at: a. https://github.com/input-output-hk/cardano-tutorials/ b. [https://testnet.cardano.org/](b. https://testnet.cardano.org/)

CC: @robcohen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.