|
1 | | -# Session 03: Environment Setup |
| 1 | +# Cardano Dev Environment |
2 | 2 |
|
3 | | -## Coming Soon |
| 3 | +A well-structured environment is essential for building, testing, and contributing to Cardano projects. This guide outlines the core components and links you to canonical setup instructions. For background on core repos and ecosystem resources, see the Kickoff session: [Core Repositories](../01-kickoff-orientation/readme.md#core-repositories) and [Documentation Resources](../01-kickoff-orientation/readme.md#documentation-resources). |
4 | 4 |
|
5 | | -This hands-on session guides developers through setting up their Cardano development environment. |
| 5 | +## Version Control |
6 | 6 |
|
7 | | -### Session Topics |
8 | | -- Installing Cardano Node and CLI |
9 | | -- Setting up development tools |
10 | | -- Configuring testnet connections |
11 | | -- Environment troubleshooting |
| 7 | +Use Git and GitHub for collaboration and traceability. |
12 | 8 |
|
13 | | -**Status**: Session materials in development |
| 9 | +- **Requirements**: |
| 10 | + - GitHub account (SSH or HTTPS access configured) |
| 11 | + - Git installed locally (`git --version`) |
| 12 | + - Suggested branch model: `main` (stable), `dev` (active), `feature/*` (scoped work) |
14 | 13 |
|
15 | | ---- |
| 14 | +Refer to governance, repos, and contribution links in [Documentation Resources](../01-kickoff-orientation/readme.md#documentation-resources) instead of duplicating here. |
16 | 15 |
|
17 | | -*This session is part of the Q1 2025 Developer Experience Working Group: "Laying the Foundations"* |
| 16 | +## Development Tools |
| 17 | + |
| 18 | +Recommended setup for editing, shell, and formatting: |
| 19 | + |
| 20 | +- **Editor**: [Visual Studio Code](https://code.visualstudio.com/) |
| 21 | +- **Shell**: Bash, Zsh, or Fish |
| 22 | +- **VS Code extensions**: |
| 23 | + - [Haskell](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) |
| 24 | + - [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) |
| 25 | + - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) or [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) |
| 26 | +- **Optional (protocol work/Haskell toolchain)**: [ghcup](https://www.haskell.org/ghcup/) to manage GHC, Cabal, HLS |
| 27 | + |
| 28 | +For broader tooling and SDKs, see [Essential Tooling](../01-kickoff-orientation/readme.md#essential-tooling). |
| 29 | + |
| 30 | +## Wallets |
| 31 | + |
| 32 | +You use wallets to hold keys, sign transactions, and interact with dApps. |
| 33 | + |
| 34 | +- **CLI/Programmatic wallets** (e.g., `cardano-cli`, `cardano-wallet` API): |
| 35 | + - When you use CLI/API wallets, you have full control and scriptability. It helps you automate key/tx flows, run offline signing, and integrate with backends. |
| 36 | + - Use for backend services, CI pipelines, cold/offline workflows, or advanced tx features. |
| 37 | +- **Browser extension wallets** (e.g., Lace, Eternl): |
| 38 | + - When you use extension wallets, you have an easy way to connect dApps in the browser. It helps you test user flows quickly with a familiar UI. |
| 39 | + - Use for dApp development, frontend integration, and user testing on testnets. |
| 40 | + |
| 41 | +See options and integration links in [Kickoff › Wallet Integration](../01-kickoff-orientation/readme.md#wallet-integration). |
| 42 | + |
| 43 | +## Cardano CLI and Node |
| 44 | + |
| 45 | +`cardano-cli` lets you create keys and addresses, build and sign transactions, and query the chain. Running `cardano-node` gives you direct access to the blockchain from your own machine. |
| 46 | + |
| 47 | +- **Install**: Use the official guide: [Installing cardano-node](https://developers.cardano.org/docs/operate-a-stake-pool/node-operations/installing-cardano-node) |
| 48 | + - Via Nix: see [Building via Nix](https://developers.cardano.org/docs/operate-a-stake-pool/node-operations/installing-cardano-node#building-via-nix) |
| 49 | +- **Node types**: relay/block-producing (network roles) or local dev nodes (testing/offline tx) |
| 50 | +- **Configs**: `config.json`, `topology.json`, and `db/` are required for synchronization and operation |
| 51 | + |
| 52 | +Keep your `cardano-cli` and `cardano-node` versions aligned with the official release cycle. |
| 53 | + |
| 54 | +### Why these tools? |
| 55 | + |
| 56 | +- When you run `cardano-node`, you have a full, up‑to‑date view of the chain on your machine. It helps you do low‑latency queries, participate directly in the network, and use features not always available via hosted APIs. |
| 57 | +- With `cardano-node`, you can run preview/preprod locally, power explorers/indexers, connect tools like Ogmios, and test end‑to‑end. |
| 58 | +- When you use `cardano-cli`, you have the standard tool for keys, addresses, transactions, and queries. It helps you follow the protocol exactly and keep sensitive signing offline if needed. |
| 59 | +- With `cardano-cli`, you can generate keys/addresses, build/balance/sign transactions, mint assets, register certificates, submit governance actions, and query UTXOs/parameters. |
| 60 | + |
| 61 | +## External APIs (No Local Node) |
| 62 | + |
| 63 | +Prefer an API if you don’t need to run a full node. |
| 64 | + |
| 65 | +### Why external APIs? |
| 66 | + |
| 67 | +- When you use external APIs, you have chain data without running your own node. It helps you start fast, avoid syncing/storage, and rely on managed uptime. |
| 68 | + |
| 69 | +### What are they for? |
| 70 | + |
| 71 | +- You can query accounts, UTXOs, blocks, and transactions from your app or server. |
| 72 | +- You can submit transactions built with `cardano-cli` or SDKs. |
| 73 | +- You can read derived data (like metadata or staking stats) without running your own indexers. |
| 74 | + |
| 75 | +For service options and links, see: |
| 76 | + |
| 77 | +- [Kickoff Orientation › Block Explorers & APIs](/docs/working-group/q1-2025/sessions/kickoff-orientation#block-explorers--apis) |
| 78 | + |
| 79 | +API keys and endpoints vary by network (mainnet, preprod, preview). |
| 80 | + |
| 81 | +## How to Work on Open-Source (Quick Flow) |
| 82 | + |
| 83 | +- Read the project `README`/docs to understand scope and setup |
| 84 | +- Review open issues; ask clarifying questions; confirm acceptance criteria |
| 85 | +- Comment to request assignment or alignment before starting |
| 86 | +- Fork the repository; clone your fork locally |
| 87 | +- Create a feature branch (`feature/<short-topic>`) |
| 88 | +- Implement changes with small, focused commits |
| 89 | +- Run tests/linting; update docs as needed |
| 90 | +- Push and open a Pull Request to the upstream repo |
| 91 | +- Address review feedback; keep your fork in sync with upstream `dev/main` |
| 92 | +- After merge, clean up branches and reference the issue |
| 93 | + |
| 94 | +## Environment Composition Summary |
| 95 | + |
| 96 | +- **Version Control**: Git & GitHub — collaboration and change tracking |
| 97 | +- **Editor**: VS Code — syntax, tasks, extensions |
| 98 | +- **Terminal**: Bash/Zsh/Fish — commands and scripts |
| 99 | +- **CLI**: `cardano-cli` — transactions, keys, queries |
| 100 | +- **Node**: `cardano-node` — local chain sync and direct access |
| 101 | +- **APIs**: Koios, Blockfrost, Ogmios, Cardano GraphQL — remote interaction |
| 102 | +- **Configs**: `config.json`, `topology.json`, `db/` — network parameters and state |
| 103 | + |
| 104 | +## Recommendations |
| 105 | + |
| 106 | +- Use environment variables for API keys and secrets |
| 107 | +- Maintain separate configs for `mainnet`, `preprod`, and `preview` |
| 108 | +- Align node/CLI versions with official releases |
| 109 | +- Document project-specific steps in your repo `README` for team consistency |
| 110 | +- For deeper ecosystem links (wallets, SDKs, explorers), see [Essential Tooling](../01-kickoff-orientation/readme.md#essential-tooling) and [Block Explorers & APIs](../01-kickoff-orientation/readme.md#block-explorers-apis) |
| 111 | +This document is part of the Q1 2025 Developer Experience Working Group sessions. |
0 commit comments