Skip to content

cryptape/ckb-tutorial

Repository files navigation

Time to Hello World on CKB

The target of this tutorial is very simple: use CKB SDKs in various languages to write "Hello Common Knowledge Base!" into a cell on CKB testnet and check it on CKB explorer.

Sample Code

Here's an example of how to write an on-chain message:

ckb-tutorial/js/index.ts

Lines 125 to 136 in 42bf1b5

// Step 1: this is the message that will be written on chain
const onChainMemo: string = "Hello Common Knowledge Base!";
// Step 2: construct the transaction
let txSkeleton = await constructHelloWorldTx(onChainMemo);
// Step 3: sign and send the transaction
const txHash = await signAndSendTx(txSkeleton, testPrivKey);
console.log(`Transaction ${txHash} sent.\n`);
// Done, let's see the transaction in CKB Testnet Explorer
console.log(`See ${CKB_TESTNET_EXPLORER}/transaction/${txHash}`);

Tutorials in different languages

About

Time to `Hello World` on CKB

Topics

Resources

License

Stars

Watchers

Forks