A hands-on bootcamp for building with Chainlink Runtime Environment (CRE).
It is also available in:
Disclaimer: This tutorial represents an educational example to use a Chainlink system, product, or service and is provided to demonstrate how to interact with Chainlink's systems, products, and services to integrate them into your own. This template is provided "AS IS" and "AS AVAILABLE" without warranties of any kind, it has not been audited, and it may be missing key checks or error handling to make the usage of the system, product or service more clear. Do not use the code in this example in a production environment without completing your own audits and application of best practices. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for unintended outputs that are generated due to errors in code.
The bootcamp tutorial is available in a markdown book format.
Either visit:
https://smartcontractkit.github.io/cre-bootcamp-2026/
Or run locally:
cargo install mdbook
cd book
mdbook serve --openDay 1: Foundations + Market Creation
- CRE Mental Model
- Project Setup
- Smart Contract Development
- HTTP Trigger & EVM Write
Day 2: Complete Settlement Workflow
- Log Trigger
- EVM Read
- AI Integration (Gemini)
- End-to-End Testing
An AI-powered prediction market using CRE capabilities:
- HTTP Trigger - Create markets via API requests
- Log Trigger - Event-driven settlement automation
- EVM Read - Read market state from the blockchain
- HTTP Capability - Query Gemini AI for real-world outcomes
- EVM Write - Verified on-chain writes with DON consensus
Complete these before the bootcamp:
- Node.js v20+
- Bun v1.3+
- CRE CLI
- Foundry
- Ethereum Sepolia in your wallet
- Sepolia ETH from faucet
- Gemini API Key
git clone https://github.com/smartcontractkit/cre-bootcamp-2026.git
cd cre-bootcamp-2026The main focus of the bootcamp will be the following:
├── prediction-market
│ ├── contracts # smart contracts
│ ├── my-workflow # CRE workflows
│ ├── project.yaml # CRE project config
│ └── secrets.yaml # secrets for CRE to use at runtime
Create .env in prediction-market/ and set CRE_ETH_PRIVATE_KEY and GEMINI_API_KEY_VAR variables:
###############################################################################
### REQUIRED ENVIRONMENT VARIABLES - SENSITIVE INFORMATION ###
### DO NOT STORE RAW SECRETS HERE IN PLAINTEXT IF AVOIDABLE ###
### DO NOT UPLOAD OR SHARE THIS FILE UNDER ANY CIRCUMSTANCES ###
###############################################################################
# Ethereum private key or 1Password reference (e.g. op://vault/item/field)
CRE_ETH_PRIVATE_KEY=YOUR_PRIVATE_KEY_HERE
# Default target used when --target flag is not specified (e.g. staging-settings, production-settings, my-target)
CRE_TARGET=staging-settings
# Gemini configuration: API Key
GEMINI_API_KEY_VAR=YOUR_GEMINI_API_KEY_HEREcd prediction-market/my-workflow
bun install
cd ..source .env
cd contracts
forge create src/PredictionMarket.sol:PredictionMarket \
--rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \
--private-key $CRE_ETH_PRIVATE_KEY \
--broadcast \
--constructor-args 0x15fc6ae953e024d975e77382eeec56a9101f9f88Note: the contructor argument is the CRE Forwarder Contract address.
Save the deployed Prediction Market Contract address and update my-workflow/config.staging.json:
{
"evms": [
{
"marketAddress": "0xYOUR_DEPLOYED_ADDRESS",
...
}
]
}cd .. # Back to prediction-market/
cre workflow simulate my-workflow --broadcastSelect HTTP trigger (option 1) and enter:
{ "question": "Will Argentina win the 2022 World Cup?" }export MARKET_ADDRESS=0xYOUR_DEPLOYED_ADDRESS
cast send $MARKET_ADDRESS \
"predict(uint256,uint8)" 0 0 \
--value 0.01ether \
--rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \
--private-key $CRE_ETH_PRIVATE_KEYNote:
0 0above corresponds to do the Market Id and the prediction (Yes = 0, No = 1). See thepredict()function in./prediction-market/contracts/src/PredictionMarket.sol
Request settlement by passing in the relevant Market Id.
cast send $MARKET_ADDRESS \
"requestSettlement(uint256)" 0 \
--rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \
--private-key $CRE_ETH_PRIVATE_KEYSave the transaction hash!
cre workflow simulate my-workflow --broadcastSelect Log trigger (option 2), enter the tx hash from step 7 and event index 0.
cast send $MARKET_ADDRESS \
"claim(uint256)" 0 \
--rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \
--private-key $CRE_ETH_PRIVATE_KEY