linera-protocol README

The project's README from github.com/linera-io/linera-protocol. As one markdown file: README.md.

License Build Status for Docker Build Status for Rust Build Status for Documentation Twitter Discord

Linera is a decentralized blockchain infrastructure designed for highly scalable, secure, low-latency Web3 applications.

Documentation

Visit our developer page and read our whitepaper to learn more about the Linera protocol.

Repository Structure

The main crates and directories of this repository can be summarized as follows: (listed from low to high levels in the dependency graph)

Prerequisites

See INSTALL.md for software requirements to develop in this repo.

Quickstart with the Linera CLI tool

The following commands set up a local test network and run some transfers between the microchains owned by a single wallet.

# Make sure to compile the Linera binaries and add them in the $PATH.
# cargo build -p linera-storage-service -p linera-service --bins
export PATH="$PWD/target/debug:$PATH"

# Import the optional helper function `linera_spawn`.
source /dev/stdin <<<"$(linera net helper 2>/dev/null)"

# Run a local test network with the default parameters and a number of microchains
# owned by the default wallet. This also defines `LINERA_TMP_DIR`.
linera_spawn \
linera net up --with-faucet --faucet-port 8080

# Remember the URL of the faucet.
FAUCET_URL=http://localhost:8080

# If you're using a testnet, start here and run this instead:
#   LINERA_TMP_DIR=$(mktemp -d)
#   FAUCET_URL=https://faucet.testnet-XXX.linera.net  # for some value XXX

Enable logs for user applications:

export LINERA_APPLICATION_LOGS=true

Set the path of the future wallet:

export LINERA_WALLET="$LINERA_TMP_DIR/wallet.json"
export LINERA_KEYSTORE="$LINERA_TMP_DIR/keystore.json"
export LINERA_STORAGE="rocksdb:$LINERA_TMP_DIR/client.db"

# Initialize a new user wallet.
linera wallet init --faucet $FAUCET_URL

# Request chains.
INFO1=($(linera wallet request-chain --faucet $FAUCET_URL))
INFO2=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN1="${INFO1[0]}"
ACCOUNT1="${INFO1[1]}"
CHAIN2="${INFO2[0]}"
ACCOUNT2="${INFO2[1]}"

# Show the different chains tracked by the wallet.
linera wallet show

# Query the chain balance of some of the chains.
linera query-balance "$CHAIN1"
linera query-balance "$CHAIN2"

# Transfer 10 units then 5 back.
linera transfer 10 --from "$CHAIN1" --to "$CHAIN2"
linera transfer 5 --from "$CHAIN2" --to "$CHAIN1"

# Query balances again.
linera query-balance "$CHAIN1"
linera query-balance "$CHAIN2"

# Now let's fund the user balances.
linera transfer 5 --from "$CHAIN1" --to "$ACCOUNT1@$CHAIN1"
linera transfer 2 --from "$ACCOUNT1@$CHAIN1" --to "$ACCOUNT2@$CHAIN2"

# Query user balances again.
linera query-balance "$ACCOUNT1@$CHAIN1"
linera query-balance "$ACCOUNT2@$CHAIN2"

More complex examples may be found in our developer manual as well as the example applications in this repository.

Contributing

We welcome contributions from the community! If you'd like to contribute to the Linera protocol:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

For detailed guidelines, see our contribution guide.

linera-protocol (linera-io/linera-protocol)

Searching Database…

这是什么?Linera 是一个去中心化区块链基础设施,专为高度可扩展、安全、低延迟的 Web3 应用而打造。它采用微链架构,每个用户都可以拥有自己的链。
这是区块链协议、SDK,还是两者都是?两者兼有:它既是完整的协议实现(包含 core、chain、storage、rpc 等 crate),也是一个 Rust SDK(linera-sdk),用于编写运行在其上的 WebAssembly 智能合约应用。
我该怎么把测试网络跑起来?使用 Linera CLI 工具即可:它能搭建本地测试网络,并让你在同一个钱包下拥有的微链之间进行转账,钱包路径可以自行配置。
在构建这个仓库之前,我需要先安装什么?你需要先安装该仓库 INSTALL.md 中列出的软件要求才能开发 Linera,另外还需要 Rust 工具链,因为整个协议都是用 Rust 编写、面向 Wasm 目标的。
如果快速入门不够用,去哪里找更复杂的示例和文档?更复杂的示例可以在开发者手册以及本仓库中的示例应用文件夹里找到。
Linera 里的微链是什么?微链是一种轻量级的链,可以由单个用户(或应用)拥有;协议 crate(linera-chain、linera-core)负责处理它的区块、证书和跨链消息。
想弄懂执行机制,应该先看哪个 crate?linera-execution 负责保存持久化数据并运行 Linera 应用的逻辑,在依赖关系中位于 linera-chain 和 linera-storage 之间。
我能在浏览器里运行 Linera 客户端吗?可以。linera-client 是一个共享库,CLI 钱包和节点服务都在使用它,它也为 linera-web 中的 Web 客户端提供支持。
代理和验证节点的部署是怎么组织的?linera-service 提供 CLI 钱包、代理(验证节点的前端)和服务器的可执行程序,而 linera-rpc 定义了它们之间通信所用的消息格式。
What are similar projects?fuel-core, WasmEdge, go-ethereum, diem, nuvex, fuels-rs, eos, TrustMint
Creator
linera-io
Size
238.7 MB
Stars
32.1K
Updated
CommitSep 18
Age
4y
Commits · 90 Days