• Stars
    star
    2,934
  • Rank 14,782 (Top 0.4 %)
  • Language
    Haskell
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The core component that is used to participate in a Cardano decentralised blockchain.

GitHub Actions
GitHub Workflow Status (master) GitHub Workflow Status (branch)

Overview of the cardano-node repository

Integration of the ledger, consensus, networking and node shell repositories.

Logging is provided as a feature by the node shell to the other packages.

  • The cardano-node is the top level for the node and aggregates the other components from other packages: consensus, ledger and networking, with configuration, CLI, logging and monitoring.
  • The node no longer incorporates wallet or explorer functionality. The wallet backend and explorer backend are separate components that run in separate external processes that communicate with the node via local IPC.

Network Configuration, Genesis and Topology Files

The latest supported networks can be found at https://book.world.dev.cardano.org/environments.html

Obtaining cardano-node

Building from source

Documentation for building the node can be found here.

Executables

You can download the hydra binaries of cardano-node and cardano-cli from the [release notes](https://github.com/input-output-hk/cardano-node/releases)

Running the node on Windows

The download includes cardano-node.exe and a .dll. To run the node with cardano-node run you need to reference a few files and directories as arguments. These can be copied from the cardano-node repo into the executables directory. The command to run the node on mainnet looks like this:

cardano-node.exe run --topology ./configuration/cardano/mainnet-topology.json --database-path ./state --port 3001 --config ./configuration/cardano/mainnet-config.yaml  --socket-path \\.\pipe\cardano-node

Docker image

You can pull the docker image with the latest version of cardano-node from here.

docker pull inputoutput/cardano-node

Using cardano-node

Command line summary: cardano-node

This refers to the client that is used for running a node.

The general synopsis is as follows:

Usage: cardano-node run [--topology FILEPATH] [--database-path FILEPATH]
                        [--socket-path FILEPATH]
                        [--byron-delegation-certificate FILEPATH]
                        [--byron-signing-key FILEPATH]
                        [--shelley-kes-key FILEPATH]
                        [--shelley-vrf-key FILEPATH]
                        [--shelley-operational-certificate FILEPATH]
                        [--host-addr IPV4-ADDRESS]
                        [--host-ipv6-addr IPV6-ADDRESS]
                        [--port PORT]
                        [--config NODE-CONFIGURATION] [--validate-db]
  Run the node.
  • --topology - Filepath to a topology file describing which peers the node should connect to.
  • --database-path - Path to the blockchain database.
  • --byron-delegation-certificate - Optional path to the Byron delegation certificate. The delegation certificate allows the delegator (the issuer of said certificate) to give his/her own block signing rights to somebody else (the delegatee). The delegatee can then sign blocks on behalf of the delegator.
  • --byron-signing-key - Optional path to the Byron signing key.
  • --shelley-signing-key - Optional path to the Shelley signing key.
  • --shelley-kes-key - Optional path to the Shelley KES signing key.
  • --shelley-vrf-key - Optional path to the Shelley VRF signing key.
  • --shelley-operational-certificate - Optional path to the Shelley operational certificate.
  • --socket-path - Path to the socket file.
  • --host-addr - Optionally specify your node's IPv4 address.
  • --host-ipv6-addr - Optionally specify your node's IPv6 address.
  • --port - Specify which port to assign to the node.
  • --config - Specify the filepath to the config .yaml file. This file is responsible for all the other node's required settings. See examples in configuration (e.g. config-0.yaml).
  • --validate-db - Flag to revalidate all on-disk database files

Configuration

The --config flag points to a .yaml (or a structurally equivalent .json) file that is responsible to configuring the logging & other important settings for the node. E.g. see the Byron mainnet configuration in this configuration.yaml.

Some of the more important settings are as follows:

  • Protocol: RealPBFT -- Protocol the node will execute
  • RequiresNetworkMagic: RequiresNoMagic -- Used to distinguish between mainnet (RequiresNoMagic) and testnets (RequiresMagic)

Scripts

Please see scripts/README.md for information on the various scripts.

Using cardano-cli

A CLI utility to support a variety of key material operations (genesis, migration, pretty-printing..) for different system generations. Usage documentation can be found at cardano-cli/README.md.

The general synopsis is as follows:

Usage: cardano-cli (Era based commands | Byron specific commands | Miscellaneous commands)

> NOTE: the exact invocation command depends on the environment. If you have only built cardano-cli, without installing it, then you have to prepend cabal run -- `` before ``cardano-cli. We henceforth assume that the necessary environment-specific adjustment has been made, so we only mention cardano-cli.

Command line options: cardano-cli

The subcommands are subdivided in groups, and their full list can be seen in the output of cardano-cli --help.

All subcommands have help available. For example:

cabal run -- cardano-cli -- byron key migrate-delegate-key-from --help

cardano-cli -- byron key migrate-delegate-key-from
Usage: cardano-cli byron key migrate-delegate-key-from --from FILEPATH
                                                       --to FILEPATH
  Migrate a delegate key from an older version.


Available options:
  --byron-legacy-formats   Byron/cardano-sl formats and compatibility
  --byron-formats          Byron era formats and compatibility
  --from FILEPATH          Signing key file to migrate.
  --to FILEPATH            Non-existent file to write the signing key to.
  -h,--help                Show this help text

Genesis generation

The Byron genesis generation operations will create a directory that contains:

  • genesis.json: The genesis JSON file itself.
  • avvm-seed.*.seed: Ada Voucher Vending Machine seeds (secret). Affected by --avvm-entry-count and --avvm-entry-balance.
  • delegate-keys.*.key: Delegate private keys. Affected by: --n-delegate-addresses.
  • delegation-cert.*.json: Delegation certificates. Affected by: --n-delegate-addresses.
  • genesis-keys.*.key: Genesis stake private keys. Affected by: --n-delegate-addresses, --total-balance.
  • poor-keys.*.key: Non-delegate private keys with genesis UTxO. Affected by: --n-poor-addresses, --total-balance.

More details on the Byron Genesis JSON file can be found in docs/reference/byron-genesis.md

Byron genesis delegation and related concepts are described in detail in:

https://hydra.iohk.io/job/Cardano/cardano-ledger-specs/byronLedgerSpec/latest/download-by-type/doc-pdf/ledger-spec

The canned scripts/benchmarking/genesis.sh example provides a nice set of defaults and illustrates available options.

Key operations

Note that key operations do not support password-protected keys.

Signing key generation & verification key extraction

Signing keys can be generated using the keygen subcommand.

Extracting a verification key out of the signing key is performed by the to-verification subcommand.

Delegate key migration

In order to continue using a delegate key from the Byron Legacy era in the new implementation, it needs to be migrated over, which is done by the migrate-delegate-key-from subcommand:

$ cabal v2-run -- cardano-cli byron key migrate-delegate-key-from
        --from key0.sk --to key0Converted.sk

Signing key queries

One can gather information about a signing key's properties through the signing-key-public and signing-key-address subcommands (the latter requires the network magic):

$ cabal v2-run -- cardano-cli byron key signing-key-public --byron-formats --secret key0.sk

public key hash: a2b1af0df8ca764876a45608fae36cf04400ed9f413de2e37d92ce04
public key: sc4pa1pAriXO7IzMpByKo4cG90HCFD465Iad284uDYz06dHCqBwMHRukReQ90+TA/vQpj4L1YNaLHI7DS0Z2Vg==

$ cabal v2-run -- cardano-cli signing-key-address --byron-formats --secret key0.pbft --testnet-magic 42

2cWKMJemoBakxhXgZSsMteLP9TUvz7owHyEYbUDwKRLsw2UGDrG93gPqmpv1D9ohWNddx
VerKey address with root e5a3807d99a1807c3f161a1558bcbc45de8392e049682df01809c488, attributes: AddrAttributes { derivation path: {} }

Transactions

Creation

Transactions can be created via the issue-genesis-utxo-expenditure & issue-utxo-expenditure commands.

The easiest way to create a transaction is via the scripts/benchmarking/issue-genesis-utxo-expenditure.sh script as follows:

./scripts/benchmarking/issue-genesis-utxo-expenditure.sh transaction_file

NB: This by default creates a transaction based on configuration/defaults/liveview/config-0.yaml

If you do not have a genesis_file you can run scripts/benchmarking/genesis.sh which will create an example genesis_file for you. The script scripts/benchmarking/issue-genesis-utxo-expenditure.sh has defaults for all the requirements of the issue-genesis-utxo-expenditure command.

Submission

The submit-tx subcommand provides the option of submitting a pre-signed transaction, in its raw wire format (see GenTx for Byron transactions).

The canned scripts/benchmarking/submit-tx.sh script will submit the supplied transaction to a testnet launched by scripts/benchmarking/shelley-testnet-liveview.sh script.

Issuing UTxO expenditure (genesis and regular)

To make a transaction spending UTxO, you can either use the:

  • issue-genesis-utxo-expenditure, for genesis UTxO
  • issue-utxo-expenditure, for normal UTxO

subcommands directly, or, again use canned scripts that will make transactions tailored for the aforementioned testnet cluster:

  • scripts/benchmarking/issue-genesis-utxo-expenditure.sh.
  • scripts/benchmarking/issue-utxo-expenditure.sh.

The script requires the target file name to write the transaction to, input TxId (for normal UTxO), and optionally allows specifying the source txin output index, source and target signing keys and lovelace value to send.

The target address defaults to the 1-st richman key (configuration/delegate-keys.001.key) of the testnet, and lovelace amount is almost the entirety of its funds.

Local node queries

You can query the tip of your local node via the get-tip command as follows

  1. Open tmux
  2. Run cabal build cardano-node
  3. Run ./scripts/lite/shelley-testnet.sh example

4. Run export CARDANO_NODE_SOCKET_PATH=/cardano-node/example/socket/node-1-socket 4. ``cabal exec cardano-cli -- get-tip --testnet-magic 42

You will see output from stdout in this format:

Current tip:
Block hash: 4ab21a10e1b25e39
Slot: 6
Block number: 5

Update proposals

Update proposal creation

A Byron update proposal can be created as follows:

cardano-cli -- byron governance
               create-update-proposal
                 (--mainnet | --testnet-magic NATURAL)
                 --signing-key FILEPATH
                 --protocol-version-major WORD16
                 --protocol-version-minor WORD16
                 --protocol-version-alt WORD8
                 --application-name STRING
                 --software-version-num WORD32
                 --system-tag STRING
                 --installer-hash HASH
                 --filepath FILEPATH
               ..

The mandatory arguments are --mainnet | --testnet-magic, signing-key, protocol-version-major, protocol-version-minor, protocol-version-alt, application-name, software-version-num, system-tag, installer-hash and filepath.

The remaining arguments are optional parameters you want to update in your update proposal.

You can also check your proposal's validity using the validate-cbor command. See: `Validate CBOR files`_.

See the Byron specification for more details on update proposals.

Update proposal submission

You can submit your proposal using the submit-update-proposal command.

Example:

cardano-cli -- byron governance
            submit-update-proposal
            --config configuration/defaults/mainnet/configuration.yaml
            (--mainnet | --testnet-magic NATURAL)
            --filepath my-update-proposal

See the Byron specification for more details on update proposals.

Update proposal voting

You can create and submit byron update proposal votes with the create-proposal-vote & submit-proposal-vote commands. The following are two example commands:

Byron vote creation:

cabal exec cardano-cli -- byron governance create-proposal-vote
                       (--mainnet | --testnet-magic NATURAL)
                       --signing-key configuration/defaults/liveview/genesis/delegate-keys.000.key
                       --proposal-filepath ProtocolUpdateProposalFile
                       --vote-yes
                       --output-filepath UpdateProposalVoteFile

Byron vote submission:

cabal exec cardano-cli -- byron governance submit-proposal-vote
                       (--mainnet | --testnet-magic NATURAL)
                       --filepath UpdateProposalVoteFile

Development

GHCID

run ghcid with: ghcid -c "cabal repl exe:cardano-node --reorder-goals"

Note: When developing locally, for any package you are working on, in cabal.project set, ghc-options to -Wwarn and set the development flag, e.g.:

package cardano-node
  ghc-options: -Wwarn
  flags: +development

Otherwise GHC might complain about unused packages.

Native Tokens

Native tokens is a new feature that enables the transacting of multi-assets on Cardano. Native tokens are now supported on mainnet and users can transact with ada, and an unlimited number of user-defined (custom) tokens natively. Note that users who do not need to create new assets (“token holders”) will be able to send and receive existing multi-asset tokens using a wallet such as Daedalus or Yoroi, and with no requirement to use any CLI commands.

To help you get started, see:

To start, please ensure that you are familiar with setting up and operating the Cardano node. Alternatively, see instructions on how to start your node to submit the commands. You will not need to set up and start a full block producing node ('stake pool'), just a much simpler relay node. This node will need to connect to a Cardano network that is capable of processing native tokens (e.g., the native token pre-production environment (PPE), or the Cardano mainnet).

API Documentation

The API documentation is published here.

The documentation is built with each push, but is only published from master branch. In order to test if the documentation is working, build the documentation locally with ./scripts/haddocs.sh and open haddocks/index.html in the browser.

Using the cardano-node Haskell packages

If you want to use the cardano-node Haskell packages from another project, you should use CHaP to get the packages defined in this repository. Please note that you may need to use any source-repository-package stanzas defined in cabal.project, although we will endeavour to keep these to an absolute minimum.

Style guide

The style guide <https://github.com/input-output-hk/cardano-node-wiki/wiki/Style-guide> for can be found on the cardano-node repository's wiki <https://github.com/input-output-hk/cardano-node-wiki/wiki>.

Troubleshooting cardano-node issues

For some troubleshooting help with building or running cardano-node, the wiki has a troubleshooting page that documents some common gotchas.

More Repositories

1

cardano-sl

Cryptographic currency implementing Ouroboros PoS protocol
Haskell
3,757
star
2

plutus

The Plutus language implementation and tools
Haskell
1,472
star
3

plutus-pioneer-program

This repository hosts the lectures of the Plutus Pioneers Program. This program is a training course that the IOG Education Team provides to recruit and train software developers in Plutus, the native smart contract language for the Cardano ecosystem.
Haskell
1,385
star
4

daedalus

The open source cryptocurrency wallet for ada, built to grow with the community
TypeScript
1,227
star
5

essential-cardano

Repository for the Essential Cardano list
738
star
6

haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
Nix
524
star
7

Scorex

Modular blockchain framework. Public domain
JavaScript
503
star
8

nami

Nami Wallet is a browser based wallet extension to interact with the Cardano blockchain. Support requests: https://iohk.zendesk.com/hc/en-us/requests/new
JavaScript
368
star
9

jormungandr

privacy voting blockchain node
Rust
366
star
10

plutus-apps

The Plutus application platform
Haskell
304
star
11

rust-byron-cardano

rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)
Rust
276
star
12

cardano-db-sync

A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL
Haskell
254
star
13

cardano-documentation

TypeScript
254
star
14

ouroboros-network

An implementation of the Ouroboros family of consensus algorithms, with its networking support
Haskell
254
star
15

hydra

Implementation of the Hydra Head protocol
Haskell
241
star
16

mantis

A Scala based client for Ethereum-like Blockchains.
Scala
227
star
17

cardano-ledger

The ledger implementation and specifications of the Cardano blockchain.
Haskell
223
star
18

cardano-js-sdk

JavaScript SDK for interacting with Cardano, providing various key management options, with support for popular hardware wallets
TypeScript
206
star
19

scrypto

Cryptographic primitives for Scala
Scala
202
star
20

plutus-starter

A starter project for Plutus apps
Nix
197
star
21

lobster-challenge

Simple Plutus contract to help give Charles' stuffed lobster a name
Haskell
177
star
22

adrestia

APIs & SDK for interacting with Cardano.
Markdown
175
star
23

marlowe

Prototype implementation of domain-specific language for the design of smart-contracts over cryptocurrencies
Isabelle
170
star
24

bitte

Nix Ops for Terraform, Consul, Vault, Nomad
Nix
151
star
25

symphony-2

Immersive 3D Blockchain Explorer
JavaScript
127
star
26

cardano-addresses

Addresses and mnemonic manipulation & derivations
Haskell
125
star
27

iohk-ops

NixOps deployment configuration for IOHK devops
Nix
118
star
28

cardano-tutorials

ARCHIVED-This content in this repository is now located at https://docs.cardano.org/projects/cardano-node/
Makefile
114
star
29

Alonzo-testnet

repository for the Alonzo testnet
Haskell
113
star
30

mithril

Stake-based threshold multi-signatures protocol
Rust
110
star
31

stack2nix

Generate nix expressions for Haskell projects
Nix
99
star
32

iodb

Multiversioned key-value database, especially useful for blockchain
Scala
96
star
33

nix-tools

Translate Cabals Generic Package Description to a Nix expression
95
star
34

marlowe-cardano

Marlowe smart contract language Cardano implementation
Haskell
88
star
35

cardano-base

Code used throughout the Cardano eco-system
Haskell
83
star
36

cardano-byron-cli

Cardano Command Line Interface (CLI) (Deprecated)
Rust
83
star
37

lace

The Lace Wallet.
TypeScript
82
star
38

react-polymorph

React components with highly customizable logic, markup and styles.
JavaScript
79
star
39

high-assurance-legacy

Legacy code connected to the high-assurance implementation of the Ouroboros protocol family
Haskell
78
star
40

shelley-testnet

Support triage for the Shelley testnet
70
star
41

cardano-crypto

This repository provides cryptographic libraries that are used in the Byron era of the Cardano node
C
67
star
42

plutus-use-cases

Plutus Use Cases
64
star
43

cardano-ops

NixOps deployment configuration for IOHK/Cardano devops
Nix
63
star
44

iohk-nix

nix scripts shared across projects
Nix
59
star
45

cardano-rt-view

RTView: real-time watching for Cardano nodes (ARCHIVED)
Haskell
59
star
46

nix-hs-hello-windows

Cross compiling Hello World (haskell) to Windows using nix.
Nix
58
star
47

symphony

Symphony v1
JavaScript
53
star
48

spongix

Proxy for Nix Caching
Go
53
star
49

cardano-ledger-byron

A re-implementation of the Cardano ledger layer, replacing the Byron release
Haskell
52
star
50

rscoin-haskell

Haskell implementation of RSCoin
Haskell
51
star
51

cardano-node-tests

System and end-to-end (E2E) tests for cardano-node.
Python
51
star
52

project-icarus

Icarus, a reference implementation for a lightweight wallet developed by the IOHK Engineering Team.
45
star
53

cardano-rest

HTTP interfaces for interacting with the Cardano blockchain.
Haskell
44
star
54

offchain-metadata-tools

Tools for creating, submitting, and managing off-chain metadata such as multi-asset token metadata
Haskell
42
star
55

medusa

3D github repository visualiser
JavaScript
41
star
56

cicero

event-driven automation for Nomad
Go
40
star
57

nothunks

Haskell
39
star
58

bech32

Haskell implementation of the Bech32 address format (BIP 0173).
Haskell
37
star
59

foliage

🌿 Foliage is a tool to create custom Haskell package repositories, in a fully reproducible way.
Haskell
37
star
60

smash

Stakepool Metadata Aggregation Server
Haskell
36
star
61

chain-libs

blockchain libs
Rust
35
star
62

cardanodocs.com-archived

Cardano Settlement Layer Documentation
HTML
35
star
63

catalyst-core

⚙️ Core Catalyst Governance Engine and utilities.
Rust
35
star
64

iohk-monitoring-framework

This framework provides logging, benchmarking and monitoring.
Haskell
33
star
65

mallet

JavaScript
32
star
66

project-icarus-chrome

Icarus, a reference implementation for a lightweight wallet developed by the IOHK Engineering Team.
JavaScript
32
star
67

js-cardano-wasm

various cardano javascript using wasm bindings
Rust
31
star
68

cardano-shell

Node shell, a thin layer for running the node and it's modules.
Haskell
31
star
69

cardano-launcher

Shelley cardano-node and cardano-wallet launcher for NodeJS applications
TypeScript
31
star
70

cardano-world

Cardano world provides preprod and preview cardano networks, configuration documentation and miscellaneous automation.
Nix
30
star
71

rscoin-core

Haskell
29
star
72

io-sim

Haskell's IO simulator which closely follows core packages (base, async, stm).
Haskell
28
star
73

stakepool-management-tools

JavaScript
27
star
74

devx

The Developer Experience Shell - This repo contains a nix develop shell for haskell. Its primary purpose is to help get a development shell for haskell quickly and across multiple operating systems (and architectures).
Nix
27
star
75

cardano-haskell-packages

Metadata for Cardano's Haskell package repository
Shell
24
star
76

cardano-haskell

Top level repository for building the Cardano Haskell node and related components and dependencies.
Shell
24
star
77

quickcheck-dynamic

A library for stateful property-based testing
Haskell
23
star
78

cardano-transactions

Library utilities for constructing and signing Cardano transactions.
Haskell
23
star
79

Developer-Experience-working-group

22
star
80

psg-cardano-wallet-api

Scala client to the Cardano wallet REST API
Scala
22
star
81

pvss-haskell

Haskell
21
star
82

cardano-wallet-legacy

Official Wallet Backend & API for Cardano-SL
Haskell
21
star
83

scalanet

Scala
20
star
84

cardano-explorer

Backend solution powering the cardano-explorer. ⚠️ See disclaimer below. ⚠️
Haskell
20
star
85

formal-ledger-specifications

Formal specifications of the cardano ledger
Agda
19
star
86

marlowe-ts-sdk

Marlowe TypeScript SDK
TypeScript
19
star
87

casino

Demo / PoC / implementation of IOHK MPC protocols
Haskell
19
star
88

hackage.nix

Automatically generated Nix expressions for Hackage
19
star
89

cardano-configurations

A common place for finding / maintaining configurations of various services of the Cardano eco-system
19
star
90

js-chain-libs

chain-libs javascript SDK
Rust
18
star
91

metadata-registry-testnet

Nix
18
star
92

cardano-coin-selection

A library of algorithms for coin selection and fee balancing.
Haskell
18
star
93

ouroboros-consensus

Implementation of a Consensus Layer for the Ouroboros family of protocols
Haskell
18
star
94

sanchonet

Sources for the SanchoNet website
TypeScript
18
star
95

jormungandr-nix

jormungandr nix scripts
Nix
18
star
96

marlowe-pioneer-program

Lectures, documentation, and examples for Marlowe Pioneer Program.
Haskell
18
star
97

cardano-clusterlib-py

Python wrapper for cardano-cli for working with cardano cluster
Python
18
star
98

jortestkit

jormungandr QA
Rust
17
star
99

chain-wallet-libs

Rust
17
star
100

marlowe-starter-kit

This repository contains lessons for using Marlowe via REST and at the command line. It is meant to be used with demeter.run or with a Docker deployment of Marlowe Runtime.
Jupyter Notebook
17
star