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…

What is this?Linera is a decentralized blockchain infrastructure built for highly scalable, secure, low-latency Web3 applications, using a microchain architecture where each user can own their own chain.
Is this a blockchain protocol, an SDK, or both?It is both: a full protocol implementation (core, chain, storage, rpc crates) and a Rust SDK (linera-sdk) for writing WebAssembly smart-contract applications that run on it.
How do I get a test network running?Use the Linera CLI tool: it sets up a local test network and lets you run transfers between microchains owned by a single wallet, with a configurable wallet path.
What do I need installed before building this repo?You need the software requirements listed in the repo's INSTALL.md to develop against Linera, and a Rust toolchain since the whole protocol is written in Rust targeting Wasm.
Where are the bigger examples and docs if the quickstart isn't enough?More complex examples live in the developer manual and in the example applications folder included in this repository.
What's a microchain in Linera?It is a lightweight chain that an individual user (or application) can own; the protocol crates (linera-chain, linera-core) handle their blocks, certificates, and cross-chain messaging.
Which crate should I look at first to understand execution?linera-execution holds the persistent data and logic for running Linera applications, sitting between linera-chain and linera-storage in the dependency graph.
Can I run a Linera client from the browser?Yes, linera-client is a shared library used by the CLI wallet, node service, and also powers a Web client in linera-web.
How is the proxy/validator setup organized?linera-service provides the executables for CLI wallets, the proxy (validator frontend), and servers, while linera-rpc defines the message schemas they use to communicate.
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