Skip to content

Commit

Permalink
Merge pull request #2292 from dfinity/accel-dev-journey
Browse files Browse the repository at this point in the history
Hackathon Prep Guide (Accelerated Developer Journey)
  • Loading branch information
letmejustputthishere authored Jan 16, 2024
2 parents e64f5de + 0c8141c commit e7aec5e
Show file tree
Hide file tree
Showing 42 changed files with 1,985 additions and 2 deletions.
Binary file added docs/tutorials/_attachments/gitpod-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/_attachments/gitpod-example-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/_attachments/gitpod-example-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/_attachments/motoko-react-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/_attachments/motoko-react-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/_attachments/motoko-react-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/tutorials/developer-journey/level-0/01-ic-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Smart contracts on ICP are referred to as **canisters**. Canisters are computati

Canisters are able to communicate with each other through asynchronous messages. The execution of messages is done in isolation, allowing for increased levels of concurrent execution.

Canister code can be written in a number of different languages. Currently, Motoko and Rust are supported and maintained by DFINITY through the [IC SDK](/docs/developer-docs/setup/install/index.mdx), and there are several community-developed SDKs such as Python and Typescript.
Canister code can be written in a number of different languages. Currently, Motoko and Rust are supported and maintained by DFINITY through the [IC SDK](/docs/developer-docs/setup/install/index.mdx), and there are several community-developed canister development kits such as Python and Typescript.

A canister is managed by **controllers**. A controller can be a centralized entity, a decentralized entity such as a DAO, or it can have no controller at all, which would make it an immutable smart contract. Controllers are the only ones that can deploy the canister to ICP, start or stop their execution, and push updated code to the canister.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Then, redeem your coupon with the command:
dfx wallet --network ic redeem-faucet-coupon COUPON_CODE
```

Replace **COUPON_CODE** with the cycles coupon code sent to you by the DFINITY team member.
Replace **COUPON_CODE** with the cycles coupon code sent to you by the DFINITY faucet bot.

Verify your cycles balance with the command:

Expand Down
188 changes: 188 additions & 0 deletions docs/tutorials/hackathon-prep-course/1-what-is-icp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# 1: What is the Internet Computer?

## Overview

The Internet Computer (ICP) is a transparent and secure blockchain network that enables developers to create and deploy fully decentralized applications. Decentralized applications are created through deploying smart contracts, which are known as **canisters** on ICP. Canisters are highly scalable to directly serve user experiences. Each canister on the Internet Computer is hosted on an independent version of the blockchain network called a **subnet**. **Subnets** can seamlessly communicate with each other.

## Vision of the Internet Computer

The Internet Computer's vision is to extend the public internet with serverless cloud functionality to create a blockchain so powerful, it plays the role of 'Cloud 3.0'.

Developers can build almost anything using ICP's advanced smart contract capabilities without using traditional IT infrastructure. Users can interact with decentralized applications deployed on ICP directly in their web browser without needing a crypto wallet.

You can learn more about the vision of the Internet Computer in the [ICP deck](https://deck.internetcomputer.org/).

## Architecture of the Internet Computer Protocol
### Subnets

A subnet is a collection of nodes that run their own instance of the Internet Computer Protocol's consensus algorithm, essentially running their own blockchain. Each subnet consists of node machines, or nodes, which are used to host canister smart contracts. Each canister's code, along with its state and computation, is replicated across every node on the subnet.

Subnets are designed to be highly scalable and host canister smart contracts efficiently. Each subnet operates concurrently with and independently of the other subnets, but can communicate asynchronously with other subnets. Multiple independent subnets run in parallel, allowing the Internet Computer to break through the single-machine barrier that limits traditional blockchains.

![Subnets](./_attachments/subnets.png)

### Deterministic decentralization

The term deterministic decentralization refers to a concept used to maximize the decentralization and diversity of each subnet on ICP. Deterministic decentralization measures and maximizes the decentralization of every layer of the ICP infrastructure by maximizing the number of different node providers, data centers, geographies, and jurisdictions. The purpose of deterministic decentralization is to ensure that the network remains diverse and decentralized.

You can read more about deterministic decentralization on the [Internet Computer wiki.](https://wiki.internetcomputer.org/wiki/Deterministic_Decentralization#firstHeading)

### Chain-key cryptography

A core component of ICP is the protocol's advanced cryptographic mechanisms, which are collectively referred to as chain-key cryptography. Chain-key cryptographic methods provide the ability for ICP to achieve functionalities and scalability that other networks can't.

Chain-key cryptography uses a secret signing key in a [threshold signature scheme](/how-it-works/chain-key-technology) that is distributed across all replicas in a subnet.

Chain-key cryptography enables the following functionalities:

- Content received from the Internet Computer can be verified through validating a signature without needing to sync the entire network.

- New subnets and nodes can be added to the network autonomously. Faulty nodes can be recovered autonomously as well.

- Pseudo-randomness through chain-key cryptography can be used within dapps that require randomness.

- Transactions that are targeted at other blockchain networks can be computed fully on-chain, allowing for integrations with chains such as Bitcoin and Ethereum.

To learn more about chain-key cryptography, check out [this documentation.](/how-it-works/chain-key-technology/)


## ICP superpowers

### Seamless user onboarding

Users can be onboarded into the ICP ecosystem seamlessly through dozens of different educational resources in all different formats, lengths, and focuses. Seamless onboarding helps developers get started building on ICP quickly, and provides resources for connecting with other developers to ask questions or help others. Onboarding also helps facilitate widespread adoption and advocation for ICP. A few onboarding resources include:

- [ICP.Hubs](https://internetcomputer.org/community): Local communities dedicated to promoting adoption and awareness of ICP through education, strategic partnerships, and project acceleration. You can learn more about ICP.Hubs [here].

- [ICP.Labs](https://dfinity.org/icplab): An advanced, tailored program provided by the DFINITY Foundation that's dedicated to onboarding teams and individuals onto ICP.

- [Developer Journey tutorial series](/docs/current/tutorials/developer-journey/).

- [Developer Journey video series](https://www.youtube.com/watch?v=3WpP8ux1zX0).

- [ICP Zero to Dapp workshop series](https://youtube.com/playlist?list=PLfEHHr3qexv8hKOJBV1XR10XhUKkyPIBp&si=KqnDuEgJZt51q4e4).

- [Motoko Bootcamp](https://www.motokobootcamp.com/).

- [ICP on Youtube](https://www.youtube.com/dfinity).

- [ICP Hackathons](https://dfinity.org/events-and-news/).

- [ICP Community Discord](https://discord.gg/jnjVVQaE2C).

- [DFINITY community forum](https://forum.dfinity.org/).

- [ICP Crash course video](https://www.youtube.com/watch?v=Zmm-oo3ibPA&t=3411s).


### Unbounded scalability

ICP is able to scale infinitely, meaning there is no limit to the amount of canisters it can host, memory it can store, or transactions it can process. This unbounded scalability is achieved through horizontal scaling, where new subnets can be added at any time, without a limit on the maximum number of subnets that can exist.

Infinite scalability is especially beneficial for hosting large scale projects or applications in a fully decentralized manner. You can learn more in the documentation [here](how-it-works/scalability/#infinite-scalability).

### Cross-chain interoperability

ICP is able to directly integrate with other blockchain networks without using bridges through the ICP's advanced cryptography. Through threshold ECDSA, coupled with chain-key cryptography, ICP can natively create signed transactions on other blockchains like Ethereum and Bitcoin. This allows for dapps deployed on ICP to interact directly with other networks and their smart contracts, tokens, and other digital assets.

ICP is integrated with the Bitcoin network using chain-key ECDSA signatures and a protocol-level integration, allowing for a canister to create a Bitcoin address, then send or receive bitcoin directly as if they were a regular Bitcoin user. ICP will also use chain-key ECDSA to facilitate an upcoming integration with Ethereum that will allow Ethereum smart contracts and digital assets like ERC-20 tokens to be used in ICP canisters.

Using Bitcoin or Ethereum through ICP is faster, cheaper, and more performant than using the other networks directly. You can learn more about cross-chain integrations, such as the Bitcoin integration, in the documentation [here](https://internetcomputer.org/bitcoin-integration/).


### Future-proof

ICP is designed with features that strive to make it future-proof. Some key components of ICP's future-proof capabilities include:

- Decentralization: ICP aims to be owned and operated by as many independent entities in as many geographic locations as possible. Decentralization contributes to the goals of future-proofing as it reduces the risk of a single point of failure within the network.

- Scalability: Through ICP's subnet architecture that enables unbounded scalability, 100% on-chain Web3 services are made possible. Scalability helps future-proof ICP as it helps increase adoption, demand, and usage.

- Governance: ICP is governed by an advanced decentralized autonomous organization (DAO) known as the Network Nervous System (NNS), which provides the ICP community with direct control over the governance of the network. Upgrades made to ICP are executed through proposals that are approved by the NNS without requiring the network to fork. This form of governance makes ICP future-proof as it provides the ability for the network to adapt and change to fit the needs of the ICP community.

- Interoperability: Through chain-key cryptography, ICP is able to directly interact with other blockchains without using bridges. This interoperability contributes to ICP's ability to adapt and change in the blockchain ecosystem.

## Canister smart contracts

The term **canister** refers to a smart contract on ICP. Canisters are a computational unit that bundles together both smart contract code and state. They can define functions that can be called by external services or other canisters. Canisters communicate with one another through asynchronous messages. Each message is executed in isolation, allowing for increased levels of concurrent execution.

At a high level, a canister is used to expose methods. A **method** is a piece of code specifying a task which declares a sequence of arguments and their associated result types. Methods return a response to the caller. Query calls, update calls, and other types of canister calls are used to call those methods to get a response.

Canister code can be written in any language that can be compiled into a Wasm module. Currently, Motoko and Rust are supported and maintained by DFINITY through the [IC SDK](/docs/developer-docs/setup/install/index.mdx), and there are several community-developed canister development kits such as Python and Typescript.

A canister is managed by a **controller**, which can be a centralized entity, a decentralized entity such as a DAO, or a canister can have no controller at all, which would make it an immutable smart contract. Controllers are the only ones that can deploy the canister to the IC, start or stop their execution, and push updated code to the canister.

You can learn more about canister smart contracts in [this documentation.](https://internetcomputer.org/how-it-works/canister-lifecycle/)

### Capabilities

Canister smart contracts can be used for almost any workflow, use-case, or project. A few possible ways to use canisters include:

- Hosting web servers and scripts.

- Hosting databases.

- Hosting server operating systems.

- Hosting distributed code.

- Virtualization.

- Hosting application servers.

- Connecting Web2 services to Web3 services without using oracles.

- Hosting failover and backups.

- Hosting websites, portfolios, and other digital assets.

- Creating virtual games.

- Creating marketplaces.

- Creating digital exchanges.

- Hosting social media applications.

- Hosting live auctions.

- Facilitating cross-chain infrastructure.

Want some inspiration? Check out the [Awesome ICP repo](https://github.com/dfinity/awesome-internet-computer) to see some projects in the ecosystem.


### Cycles

In addition to managing a canister, controllers are also responsible for assuring that a canister contains sufficient **cycles** to pay for the canister's resources, such as used network bandwidth, memory, and computational power. Each execution performed by a canister deployed on the mainnet has a cost of cycles.

Cycles are used to pay for the resources, such as memory, storage, and compute power, that are used by a canister using the Internet Computer Protocol's reverse gas model. When a canister is deployed on the mainnet, cycles are 'charged' for the creation of the canister, then for every action that a canister performs.

To obtain cycles, the Internet Computer Protocol's utility token, ICP, can be converted into cycles and transferred into a canister to be used to pay for that canister's consumed resources. Cycles have a fixed price in [XDR](https://internetcomputer.org/docs/current/references/glossary#xdr) in order to make canister costs predictable and independent of the price of ICP. One trillion cycles always correspond to one XDR.

### Languages

To develop a canister, many developers use the IC SDK, which natively supports Motoko and Rust. However, canisters can be deployed in any language if the code has been compiled into WebAssembly (Wasm) modules using a canister development kit (CDK). A CDK is an adapter used by the IC SDK that provides programming languages with the necessary tools and features required to create and manage canisters. There are several community contributed CDKs for languages such as Python and TypeScript.

It is possible to create a dapp that uses multiple canisters written in different languages. Canisters that are written in different languages utilize Candid, an interface description language (IDL), to share and exchange information.

Languages that are supported via the IC SDK and community CDKs currently include:

- **Motoko**: Designed by DFINITY specifically for ICP canister development. It supports ICP's unique features and workflows while providing a robust yet familiar programming environment. Motoko is easy to learn and use for application development. It is similar to languages such as JavaScript, Ruby, Python, or Solidity.

- **Rust**: Supported on ICP through the IC SDK and the DFINITY Rust CDK. The IC SDK automatically comes with the Rust CDK as part of the software, but the Rust CDK can be installed separately.

- **Candid**: Candid is an interface description language used to describe the public interface of a service. In reference to ICP, a service is a program deployed in the form of a canister. Candid is language-agnostic, which allows for interoperability between frontends and services that are written in different languages.

- **Python**: Python is a popular language for web development, AI functions, and data analysis. Python is available through the [Kybra CDK](https://demergent-labs.github.io/kybra) developed by [Demergent Labs](https://github.com/demergent-labs).

- **TypeScript**: TypeScript is available through the [Azle CDK](https://demergent-labs.github.io/azle) developed by [Demergent Labs](https://github.com/demergent-labs).

- **Solidity**: Solidity is an object-oriented language used for writing and implementing smart contracts on blockchain platforms, such as the Ethereum network. Solidity is supported on the IC through [Bitfinity](https://docs.bitfinity.network/), developed by the [Bitfinity EVM team](https://bitfinity.network/).

- **C++**: C++ is available through the [icpp-pro CDK](https://docs.icpp.world/) developed by icpp World.

## Next steps

- [2: Deploying your first fullstack dapp](./2-deploying-first-fullstack-dapp.md).


31 changes: 31 additions & 0 deletions docs/tutorials/hackathon-prep-course/10-resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 10: Resources to learn more

To learn more about ICP, a specific feature or workflow, or get help from other developers, check out the following resources:

- [ICP developer documentation.](/docs/current/home)

- [ICP Zero to Dapp Educate Series.](https://www.youtube.com/playlist?list=PLfEHHr3qexv8hKOJBV1XR10XhUKkyPIBp)

- [ICP developer journey tutorial series.](https://internetcomputer.org/docs/current/tutorials/developer-journey/)

- [ICP developer journey video series.](https://www.youtube.com/watch?v=oBUpJ4CqmN0)

- [Awesome Internet Computer repo.](/docs/current/home)

- [Developer Discord community](https://discord.com/invite/cA7y6ezyE2), which is a large chatroom for IC developers to ask questions, get help, or chat with other developers asynchronously via text chat.

- [Developer journey forum discussion](https://forum.dfinity.org/t/developer-journey-feedback-and-discussion/23893).

- [Developer tooling working group](https://www.google.com/calendar/event?eid=MHY0cjBubmlnYXY1cTkzZzVzcmozb3ZjZm5fMjAyMzEwMDVUMTcwMDAwWiBjX2Nnb2VxOTE3cnBlYXA3dnNlM2lzMWhsMzEwQGc&ctz=Europe/Zurich).

- [Motoko Bootcamp - The DAO Adventure](https://github.com/motoko-bootcamp/dao-adventure) - Discover the Motoko language in this 7 day adventure and learn to build a DAO on the Internet Computer.

- [Motoko Bootcamp - Discord community](https://discord.gg/YbksCUxdzk) - A community for and by Motoko developers to ask for advice, showcase projects and participate in collaborative events.

- [Motoko developer working group](https://www.google.com/calendar/event?eid=ZWVnb2luaHU0ZjduMTNpZHI3MWJkcWVwNWdfMjAyMzEwMTJUMTUwMDAwWiBjX2Nnb2VxOTE3cnBlYXA3dnNlM2lzMWhsMzEwQGc&ctz=Europe/Zurich).

- [Upcoming events and conferences](https://dfinity.org/events-and-news/).

- [Upcoming hackathons](https://dfinity.org/hackathons/).

- [Weekly developer office hours](https://discord.gg/4a7SZzRk?event=1164114241893187655) to ask questions, get clarification, and chat with other developers live via voice chat. This is hosted on our [developer Discord](https://discord.com/invite/cA7y6ezyE2) group.
Loading

0 comments on commit e7aec5e

Please sign in to comment.