Skip to content

Latest commit

 

History

History

rholang

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Rholang Developer Reference

Verified against the f1r3node-rust implementation (Rust shard).

Reading Order

Fundamentals

  1. Language Overview -- Process calculus, names vs processes, core model
  2. Syntax Reference -- Complete syntax for all language constructs
  3. Data Types -- Primitives, strings, byte arrays, URIs, booleans
  4. Operators -- Arithmetic, comparison, logical, string, interpolation

Types and Collections

  1. Pattern Matching -- Patterns, connectives, destructuring, type guards
  2. Collections -- Lists, tuples, sets, maps with all methods
  3. PathMaps and Zippers -- Hierarchical trie structures and navigation
  4. Numeric Types -- Float, BigInt, BigRat, FixedPoint

Concurrency and State

  1. Channels and Concurrency -- Send, receive, persistent, peek, join, parallel
  2. Contracts and State -- Contract patterns, mutable cells, CRUD

Platform

  1. System Channels -- All rho:* URIs: I/O, crypto, registry, vaults, AI
  2. Registry -- Registry operations, TreeHashMap, URI generation
  3. Vaults and Tokens -- SystemVault, MakeMint, transfers, auth keys
  4. Cost Model -- Phlogiston accounting, cost functions, gas scaling

Patterns and Practice

  1. Design Patterns -- Security, capabilities, common idioms
  2. Rhox Macros -- .rhox template format
  3. Testing with RhoSpec -- Test framework, writing contract tests
  4. Deployment Workflow -- Deploy, propose, finalize, exploratory deploy
  5. Real-World Applications -- Embers template system, production patterns

Internal Reference

  • Crate Overview -- Interpreter crate architecture, compilation pipeline, system processes
  • Language Analysis -- Analysis of 88 .rho files: patterns, complexity levels, compiler implications

Legacy Tutorials (from RChain era -- core concepts still valid)

Examples

Working examples are in rholang/examples/:

File Topic
tut-hello.rho Contracts, channels, ack pattern
tut-lists-methods.rho List operations
tut-maps-methods.rho Map operations
tut-sets-methods.rho Set operations
tut-strings-methods.rho String operations
tut-pathmap-all-methods.rho PathMap operations
tut-pathmap-zippers.rho Zipper navigation (18 examples)
tut-hash-functions.rho SHA256, Blake2b, Keccak256
tut-registry.rho Registry insert/lookup
tut-philosophers.rho Dining philosophers (concurrency)
numeric-types.rho BigInt, BigRat, Float, FixedPoint
user-crud-example.rho Full CRUD with mutable state
vault_demo/ Vault address, balance, transfer

System Contracts

Production contracts are in casper/src/main/resources/:

File Purpose
Registry.rho Registry + TreeHashMap implementation
SystemVault.rho Fund management and transfers
MakeMint.rho Token/currency factory
ListOps.rho Functional list operations library
Either.rho Either monad (success/failure)
Stack.rho LIFO stack data structure
NonNegativeNumber.rho Constrained non-negative integers
AuthKey.rho Authentication key management
MultiSigSystemVault.rho Multi-signature vault
PoS.rhox Proof-of-Stake validator contract (macro)

Test Suites

Sophisticated contract tests in casper/src/test/resources/ using the RhoSpec framework. See Testing with RhoSpec.