dfinity/ic

GitHub: dfinity/ic

Internet Computer 区块链协议的 Rust 核心实现,提供节点 replica 软件及完整的 IC-OS 构建与可复现性验证系统,支撑以 Web 速度运行且可无限扩展的去中心化计算网络。

Stars: 1756 | Forks: 398

= Internet Computer Protocol (ICP) :toc: macro ifdef::env-github[] ++++

++++ endif::[] Internet Computer 是世界上第一个以 Web 速度运行且可以无限扩展其容量的区块链。它就像由遵循 TCP/IP 协议的众多机器组成的 Internet,以及区块链协议(例如 Bitcoin 和 Ethereum)一样。 :toc-title: toc::[] == Internet Computer 相关资源 === 研发文档 您可以在此处了解有关 Internet Computer 协议、功能和设计的更多信息,这里是一些有用的资源: 协议文档: - https://medium.com/dfinity/a-technical-overview-of-the-internet-computer-f57c62abc20f[A Technical Overview of the Internet Computer (博客文章)] - https://medium.com/dfinity/software-canisters-an-evolution-of-smart-contracts-internet-computer-f1f92f1bfffb[Canisters, an Evolution of Smart Contracts] - https://medium.com/dfinity/applied-crypto-one-public-key-for-the-internet-computer-ni-dkg-4af800db869d[Noninteractive Distributed Key Generation] - https://medium.com/dfinity/the-internet-computers-token-economics-an-overview-29e238bd1d83[The Internet Computer’s Token Economics: An Overview] - https://medium.com/dfinity/understanding-the-internet-computers-network-nervous-system-neurons-and-icp-utility-tokens-730dab65cae8[Understanding the Internet Computer’s Network Nervous System, Neurons, and ICP Utility Tokens] - https://github.com/dfinity/nns-proposals[List of NNS Proposals] - https://medium.com/dfinity/achieving-consensus-on-the-internet-computer-ee9fbfbafcbc[Consensus protocol] 工程 - https://sdk.dfinity.org/docs/developers-guide/concepts/what-is-ic[What is the Internet Computer?] - https://sdk.dfinity.org/docs/quickstart/quickstart-intro.html[Tutorials, SDKs, and sample apps to get started] - https://docs.dfinity.org/[Rust Cargo docs for the replica] === ICP 控制台 您可以观察 Internet Computer 基础设施(节点、数据中心、子网)的状态以及传统的区块链指标(出块率、Token 供应量等) - https://dashboard.internetcomputer.org === 社区 要与社区进行互动,请访问开发者论坛:https://forum.dfinity.org/ === ICP 的 Rust 实现 此代码库包含许多不同的部分(包括测试和其他基础设施组件),但最重要的一部分是 `*replica*` 的 Rust 实现源代码(在某些区块链中相当于 "client"),这些代码由共同组成 Internet Computer 的机器编译和运行。 === DFINITY 基金会 https://dfinity.org/[DFINITY Foundation] 是一个位于瑞士苏黎世的瑞士非营利组织,负责监督位于帕洛阿尔托、旧金山和苏黎世的研究中心。其目标是推进 Internet Computer Protocol 的设计、开发和采用。 == 入门指南 === 谁应该使用此代码 - *如果您是应用开发者*,并且您的意图是构建应用程序,因此您想在本地机器上部署一个本地 Internet Computer replica,您最好使用由 DFINITY Foundation 编写的 https://sdk.dfinity.org/docs/quickstart/quickstart-intro.html[Canister SDK]。它为此进行了优化,并且更加轻量级(只需不到 2 分钟即可开始使用)。它将构建并运行一个本地 replica,而您无需深入了解系统代码即可运行它。 - *如果您是区块链爱好者*,并且您的意图是了解协议(而非具体实现),您最好去阅读 https://medium.com/dfinity/achieving-consensus-on-the-internet-computer-ee9fbfbafcbc[Consensus protocol] 和 https://sdk.dfinity.org/docs/interface-spec/index.html[IC Interface Specification]。这些内容(由 DFINITY 研究团队提供)是为理解协议和设计量身定制的。 - *如果您是区块链矿工*,您应该知道 Internet Computer Protocol(虽然它是一个区块链)并没有您可能期望的传统区块链项目那样的挖矿或验证过程。Internet Computer Protocol 使用了新颖的密码学技术进行设计,不需要“挖矿”……但它确实需要独立的节点提供商,这可能包括您自己。您当然可以查看此代码库中的源代码,但更好的资源可能是这里:https://wiki.internetcomputer.org/wiki/Internet_Computer_wiki#For_Node_Providers[Internet Computer Wiki - For Node Providers] - *如果您是希望构建新的 SDK、预言机、钱包或任何能够启用和改善 Internet Computer 生态系统的工程师*,您应该看一看 https://sdk.dfinity.org/docs/interface-spec/index.html[Interface Specification],这是用于与 Internet Computer 进行底层交互的规范。 - *如果您是系统工程师、安全工程师或密码学家*,并且您的意图是通过深入研究源代码并在本地构建来了解其底层原理,*那么您来对地方了*。 == 构建代码 *系统要求* - 基于 x86-64 的系统(最低要求:16 GB 内存/交换空间,100 GB 可用磁盘空间) - Ubuntu 22.04 或更高版本 - https://podman.io/getting-started/installation[Podman] 有关构建 IC-OS 映像的详细信息,请参阅 link:ic-os/README.adoc[IC-OS README] 或者,要使用简单的容器化环境构建所有 IC-OS 映像,请运行: $ ./ci/container/build-ic.sh -i 要仅构建二进制文件和 Canister,请使用 `-b` 和/或 `-c` 标志: $ ./ci/container/build-ic.sh -b -c 所有构建的产物将位于顶层的 artifacts/ 目录中。 == 验证发布版本 === 概述 Internet Computer 提供了一个强大的系统,用于验证 IC-OS 更新映像的构建可复现性。每个 https://dashboard.internetcomputer.org/releases[发布提案] 都包含详细的验证说明。 === 前置条件 * Ubuntu 22.04 或更高版本 * Python 3.x * curl (`sudo apt install curl`) * `$HOME` 中大约有 100 GB 的可用磁盘空间(或通过 `--cache-dir` 选项指定的其他卷) === 快速入门 要验证 IC OS 版本选举提案: 重要提示:请始终使用带有版本号的 repro-check URL(将 `{COMMIT_ID}` 替换为实际的提交哈希),而不是使用 `master`,以确保 repro-check 脚本与该特定提交的构建系统兼容。 ## [source,bash] # 通过提案编号验证 curl -fsSL https://raw.githubusercontent.com/dfinity/ic/{COMMIT_ID}/ci/scripts/repro-check | \ python3 - -p # 通过 git 提交验证 ## curl -fsSL https://raw.githubusercontent.com/dfinity/ic/{COMMIT_ID}/ci/scripts/repro-check | \ python3 - -c {COMMIT_ID} === 特定组件验证 您可以单独验证特定的组件: ## [source,bash] # 仅验证 GuestOS curl -fsSL https://raw.githubusercontent.com/dfinity/ic/{COMMIT_ID}/ci/scripts/repro-check | \ python3 - -c {COMMIT_ID} --guestos # 仅验证 HostOS curl -fsSL https://raw.githubusercontent.com/dfinity/ic/{COMMIT_ID}/ci/scripts/repro-check | \ python3 - -c {COMMIT_ID} --hostos # 仅验证 SetupOS ## curl -fsSL https://raw.githubusercontent.com/dfinity/ic/{COMMIT_ID}/ci/scripts/repro-check | \ python3 - -c {COMMIT_ID} --setupos == 贡献 === 网络神经系统 感谢您抽出时间了解有关 Internet Computer Protocol 的更多信息。您可以为其中任何一个做出贡献,但需要注意的是,Internet Computer 由一个名为网络神经系统 (NNS) 的去中心化系统管理。您可以在此处了解更多信息: - https://medium.com/dfinity/understanding-the-internet-computers-network-nervous-system-neurons-and-icp-utility-tokens-730dab65cae8[Understanding the Internet Computer’s Network Nervous System, Neurons, and ICP Utility Tokens] - https://github.com/dfinity/nns-proposals[List of NNS Proposals] === 开源政策 DFINITY Foundation 向公众公开了 Internet Computer 的代码。 这一点非常重要,这样社区就可以审查定义 Internet Computer 行为的代码。此外,社区将能够构建代码,并验证其是否派生自通过网络神经系统 (NNS) 发布的升级提案中引用的相同二进制映像。 Internet Computer 的所有代码均根据 Apache 2.0 许可证授权,少数组件除外,它们根据 link:licenses/IC-1.0.txt[Internet Computer Community Source License] 和 link:licenses/IC-shared-1.0.txt[Internet Computer Shared Community Source License] 授权,这些许可证比 Apache 2.0 许可证更具限制性,以保护 DFINITY Foundation 的知识产权 (IP)。 === 提交新的贡献 我们很快将接受外部贡献(日期待定)。请遵循以下指南 link:CONTRIBUTING.md[CONTRIBUTING.md] === Bug 报告 如果您发现任何错误和漏洞,请遵循 link:SECURITY.md[SECURITY.md] 中概述的程序 === Rust 依赖策略 为了使单一存储库 (mono repository) 取得成功,需要制定一些基本规则以加快开发速度。 * 添加新的外部 crate 依赖项时,请确保它是必要的。请检查 ** 是否没有另一个已导入且具有类似功能的 crate。 ** 该 crate 是否得到了良好的维护,并且来自信誉良好的作者。 * 更新外部 crate 的语义版本时,请对整个代码库进行统一更新。避免导入同一 crate 的多个版本。 * 保持 Bazel 和 Cargo 的 rust-lang 为最新版本。 * 使用 Cargo 工作区来推断外部 crate 版本,方法是将新 crate 添加到工作区 `Cargo.toml` 的 `[workspace.dependencies]` 部分,并将 `new-crate = { workspace = true }` 添加到需要它的每个特定包的 `Cargo.toml` 中。
标签:DApp, DKG, ICP, Internet Computer, Layer 1, NNS, Rust, TCP/IP, Web3, 互联网计算机, 代币经济学, 公链, 共识算法, 分布式密钥生成, 分布式账本, 区块链, 区块链协议, 去中心化, 去中心化应用, 可视化界面, 容器, 智能合约, 源代码, 网络流量审计, 网络神经系统, 节点软件, 逆向工具, 通知系统