CRE Templates
Templates are workflow examples you can copy and customize for your own projects. They are curated and maintained by Chainlink, offering patterns you can use as references or starting points for your own workflows.
Building Blocks and Starter Templates
Templates are organized into two categories:
1. Building Blocks
Building Blocks are small, focused examples that teach one concept at a time. Each Building Block is self-contained and demonstrates a specific CRE capability or pattern. They feature minimal code, clear configuration, and are runnable locally with cre workflow simulate.
Available Building Blocks:
-
kv-store(Key-Value Store with AWS S3)- Reads a value from an AWS S3 object, increments it, and writes it back
- Demonstrates: SigV4-signed HTTP requests, CRE secrets (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY), and consensus read ā single write flow - Use case: Learn offchain write patterns with secrets and consensus
-
read-data-feeds(Chainlink Data Feeds)- Reads
decimals()andlatestAnswer()from Chainlink Data Feeds on a cron schedule - Demonstrates: Contract ABIs, Go bindings generation, RPC configuration, and onchain reads
- Use case: Learn how to read onchain data via contract calls
- Reads
When to use Building Blocks:
- You want to learn a specific feature quickly (e.g., secrets + HTTP signing, reading a data feed, cron triggers)
- You need a focused code snippet to copy into your project
- You're exploring a new capability before integrating it into a larger workflow
2. Starter Templates
Starter Templates are complete, end-to-end workflows that combine multiple capabilities and mirror real-world use cases. These templates are more comprehensive than Building Blocks and include production-like configuration, optional precompiled smart contracts, and generated bindings. They can be adapted directly into your own projects.
Available Starter Templates:
-
custom-data-feed(Custom Data Feed)- Periodically fetches offchain data via HTTP and pushes updates onchain
- Demonstrates: Cron scheduling, secrets management, contract bindings, and blockchain writes
- Use case: Build data feeds that combine offchain APIs with onchain smart contracts
-
bring-your-own-data(BYOD - NAV & PoR)- End-to-end examples for publishing Net Asset Value (NAV) and Proof of Reserve (PoR) data onchain
- Demonstrates: Complete workflow with demo contracts for publishing institutional data
- Use case: Publish verified financial or reserve data to smart contracts
-
multi-chain-token-manager(Multi-Chain Token Manager)- Orchestrates token operations and state across multiple blockchain networks
- Demonstrates: Multi-chain RPC configuration, bindings, and cross-chain coordination patterns
- Use case: Manage token operations across different EVM chains from a single workflow
When to use Starter Templates:
- You want a runnable reference architecture that shows production-ready patterns
- You're starting a new project and need a solid foundation
- You want to see how multiple CRE capabilities integrate in a real workflow
How to access templates
All templates are available on GitHub at github.com/smartcontractkit/cre-templates
- Browse all Building Blocks and Starter Templates
- Clone or fork templates to customize them for your use case
- View individual READMEs for detailed usage instructions
When to use what
Choose the right template based on where you are in your CRE journey:
| Your Situation | Recommended Action |
|---|---|
| Just finished the Getting Started guide | Run the Custom Data Feed template to see a more complex, real-world example |
| Want to learn offchain writes with secrets and consensus | Clone the kv-store Building Block (AWS S3 example) |
| Need to read Chainlink Data Feeds in your workflow | Clone the read-data-feeds Building Block (onchain reads with ABIs) |
| Building a custom data feed for your protocol | Fork the custom-data-feed Starter Template and customize it |
| Publishing NAV or PoR data onchain | Fork the bring-your-own-data Starter Template (includes demo contracts) |
| Managing tokens across multiple chains | Fork the multi-chain-token-manager Starter Template (cross-chain patterns) |
Next steps
Ready to explore templates?
-
Run the Custom Data Feed Template - Walk through this template with our step-by-step guide (available in Go and TypeScript)
-
Browse all templates on GitHub - Explore the full collection of Building Blocks and Starter Templates