CKB Pulse

All lessons · CCC (TypeScript SDK) · Start here · Glossary

Pass a config object, not a URL string, to ccc.ClientPublicTestnetWorkingReproduced

Reproduced · Check: right · Checked 2026-11-19

In @ckb-ccc/core, the ClientPublicTestnet constructor takes an options object, so a custom RPC endpoint must be given as { url: rpcUrl } rather than as a bare string argument. This commit corrects the bare string calls in a deploy script to the object form.

Why it matters: If you pass a bare URL string, the constructor finds no url field, so the client silently falls back to the default public testnet endpoint and the --rpc or CKB_RPC_URL setting is ignored.

Pattern

Prefer
const client = new ccc.ClientPublicTestnet({ url: options.rpcUrl });

Taken from the commit, shortened.

A test changed in the same commit

It sits next to the fix. We did not run it.

Reproduced by a test

A public test runs what this lesson says on @ckb-ccc/core 1.23.1, with no node. Anyone can run it.

tests/ccc/client-config-object.test.mjs

Concepts
Network and RPC reliability
Evidence
Reproduced: reproduced by a public test
First seen
2026-10-13
Last changed
2026-10-13
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

Sources (1)

More about CCC (TypeScript SDK)

All 33 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "Pass a config object, not a URL string, to ccc.ClientPublicTestnet", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/pass-a-config-object-not-a-url-string-to-ccc-clientpublictes, CC BY 4.0, last changed 2026-10-13.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.