Skip to content

Commit aac5559

Browse files
committed
Merge branch 'main' of https://github.com/smartcontractkit/documentation into ccip-0209
2 parents a19e63a + 2dc932a commit aac5559

File tree

11 files changed

+261
-236
lines changed

11 files changed

+261
-236
lines changed

src/config/sidebar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
323323
url: "cre/guides/workflow/time-in-workflows",
324324
highlightAsCurrent: ["cre/guides/workflow/time-in-workflows-ts", "cre/guides/workflow/time-in-workflows-go"],
325325
},
326+
{
327+
title: "Using Randomness in Workflows",
328+
url: "cre/guides/workflow/using-randomness",
329+
},
326330
],
327331
},
328332
{
@@ -420,10 +424,6 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
420424
url: "cre/concepts/non-determinism",
421425
highlightAsCurrent: ["cre/concepts/non-determinism-go", "cre/concepts/non-determinism-ts"],
422426
},
423-
{
424-
title: "Random in CRE",
425-
url: "cre/concepts/random-in-cre",
426-
},
427427
{
428428
title: "TypeScript Runtime Environment",
429429
url: "cre/concepts/typescript-wasm-runtime",

src/content/cre/concepts/non-determinism-go.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Go's built-in `rand` package generates different random sequences on each node,
7979

8080
**The problem:** Each node generates different random values, breaking consensus.
8181

82-
**The solution:** Use `runtime.Rand()` from the CRE SDK, which provides consensus-safe random number generation. All nodes generate the same sequence of random values, enabling consensus. See [Random in CRE](/cre/concepts/random-in-cre) for details.
82+
**The solution:** Use `runtime.Rand()` from the CRE SDK, which provides consensus-safe random number generation. All nodes generate the same sequence of random values, enabling consensus. See [Using Randomness in Workflows](/cre/guides/workflow/using-randomness) for details.
8383

8484
## 6. Working with LLMs
8585

@@ -114,5 +114,5 @@ Large Language Models (LLMs) generate different responses for the same prompt, e
114114
## Related concepts
115115

116116
- **[Time in CRE](/cre/guides/workflow/time-in-workflows-go)**: Learn about DON Time and why `runtime.Now()` is required
117-
- **[Random in CRE](/cre/concepts/random-in-cre)**: Understand consensus-safe random number generation
117+
- **[Using Randomness in Workflows](/cre/guides/workflow/using-randomness)**: Understand consensus-safe random number generation
118118
- **[Consensus Computing](/cre/concepts/consensus-computing)**: Deep dive into how nodes reach agreement

src/content/cre/concepts/typescript-wasm-runtime.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ Javy uses [QuickJS](https://bellard.org/quickjs), a lightweight JavaScript engin
3434

3535
Not all Node.js built-in modules are available. For example, `node:crypto` is not supported. Before using third-party NPM packages, verify they don't rely on unsupported Node.js APIs.
3636

37+
{/* prettier-ignore */}
38+
<Aside type="tip" title="Cryptography libraries">
39+
If you need cryptographic functions, <a href="https://paulmillr.com/noble/" target="_blank" rel="noopener noreferrer">Noble</a> is a popular JavaScript cryptography library with minimal dependencies that works well with QuickJS. Always verify any third-party library in simulation before deploying.
40+
</Aside>
41+
3742
<Aside type="note" title="Note on async/await with SDK capabilities">
3843
While JavaScript `Promise` and `async/await` are supported by QuickJS, **SDK capabilities do not use them**. The CRE
3944
TypeScript SDK uses a custom `.result()` pattern instead. See the [Core SDK

src/content/cre/getting-started/before-you-build-go.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If your workflow needs random values (e.g., selecting a winner or generating non
3131

3232
{/* prettier-ignore */}
3333
<Aside type="tip" title="Learn more">
34-
See [Random in CRE](/cre/concepts/random-in-cre) for usage examples and best practices.
34+
See [Using Randomness in Workflows](/cre/guides/workflow/using-randomness) for usage examples and best practices.
3535
</Aside>
3636

3737
{/* prettier-ignore */}

src/content/cre/getting-started/before-you-build-ts.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Your TypeScript code compiles to WebAssembly and runs in a QuickJS environment,
2525
1. Check if it relies on Node.js built-in modules
2626
1. Test with `cre workflow simulate` — simulation uses the same WASM environment as production, so compatibility issues surface immediately
2727

28+
{/* prettier-ignore */}
29+
<Aside type="tip" title="Cryptography libraries">
30+
If you need cryptographic functions, <a href="https://paulmillr.com/noble/" target="_blank" rel="noopener noreferrer">Noble</a> is a popular JavaScript cryptography library that works well with QuickJS. Always verify any third-party library in simulation before deploying.
31+
</Aside>
32+
2833
{/* prettier-ignore */}
2934
<Aside type="tip" title="Learn more">
3035
See [TypeScript Runtime Environment](/cre/concepts/typescript-wasm-runtime) for details on QuickJS compatibility and how to [verify library support](/cre/concepts/typescript-wasm-runtime#checking-library-compatibility).

src/content/cre/guides/workflow/using-evm-client/onchain-write/overview-go.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ max := big.NewInt(1000)
180180
randomValue := new(big.Int).Rand(rnd, max)
181181
```
182182

183-
**Note**: For a complete understanding of how randomness works in CRE, including the difference between DON mode and Node mode randomness, see [Random in CRE](/cre/concepts/random-in-cre).
183+
**Note**: For a complete understanding of how randomness works in CRE, including the difference between DON mode and Node mode randomness, see [Using Randomness in Workflows](/cre/guides/workflow/using-randomness).
184184

185185
### Constructing input structs
186186

src/content/cre/guides/workflow/using-http-client/get-request-ts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,5 +383,5 @@ The request object provides several fields to customize your HTTP call. See the
383383

384384
- **Headers**: Custom HTTP headers
385385
- **Body**: Request payload (for POST, PUT, etc.)
386-
- **Timeout**: Request timeout in milliseconds
386+
- **Timeout**: Request timeout as a duration string in seconds (e.g., `"5s"`, `"8s"`)
387387
- **Cache settings**: Control response caching behavior

src/content/cre/concepts/random-in-cre.mdx renamed to src/content/cre/guides/workflow/using-randomness.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
section: cre
3-
title: "Random in CRE"
3+
title: "Using Randomness in Workflows"
44
sdkLang: "go"
55
date: Last Modified
66
metadata:
77
description: "Generate random numbers safely in CRE: use runtime.Rand() to ensure all nodes get the same values and maintain consensus."
88
datePublished: "2025-11-04"
9-
lastModified: "2025-11-04"
9+
lastModified: "2026-02-05"
1010
---
1111

1212
import { Aside } from "@components"

0 commit comments

Comments
 (0)