CRE Templates

CRE Templates are workflow examples that help you learn CRE concepts and accelerate your development. They are curated and maintained by Chainlink Labs, offering patterns you can use as references or starting points for your own workflows.

Template types

CRE Templates come in two flavors, each designed for different learning and development needs:

1. Building Blocks

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:

  1. 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
  2. read-data-feeds (Chainlink Data Feeds)

    • Reads decimals() and latestAnswer() 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

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

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:

  1. 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
  2. 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
  3. 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

CRE Templates Repository

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 SituationRecommended Action
Just finished the Getting Started guideRun the Custom Data Feed demo to see a more complex, real-world example
Want to learn offchain writes with secrets and consensusClone the kv-store Building Block (AWS S3 example)
Need to read Chainlink Data Feeds in your workflowClone the read-data-feeds Building Block (onchain reads with ABIs)
Building a custom data feed for your protocolFork the custom-data-feed Starter Template and customize it
Publishing NAV or PoR data onchainFork the bring-your-own-data Starter Template (includes demo contracts)
Managing tokens across multiple chainsFork the multi-chain-token-manager Starter Template (cross-chain patterns)

Next steps

Ready to explore templates? Here's where to go next:

Get the latest Chainlink content straight to your inbox.