Spore Examples
Here we provide several examples which are minimum viable snippets designed for a Node environment, each showcasing a specific feature implemented using the Spore SDK.
These examples serve as practical guides for developers, demonstrating how to implement specific features in a straightforward manner, for instance, how to create a spore by a transaction with spore-sdk. And for those who are looking for documentation on how to develop a fully functional application, refer to: Spore Demos.
Scenario examples
Creating your first spore on-chain
Spore-first-example is a hello world example for spore-sdk, showing you how to upload an image file and create a spore on Nervos CKB in a split second. This is a well-suited code example for beginners to learn the very basics of Spore Protocol.
Lock script examples
CKB Default lock
CKB Default lock is the most commonly used lock script on Nervos CKB, also a great starting point for beginners due to its simplicity. Let's kick things off right here to start learning:
- Create/transfer clusters with the CKB Default lock
- Create/transfer/destroy spores with the CKB Default lock
Anyone-can-pay
Anyone-can-pay (ACP) lock can be unlocked by anyone without signature verification and accepts any amount of CKB/UDT payment from the unlocker. Leverage its flexibility to:
- Create public clusters with the Anyone-can-pay lock
- Create spores in public clusters with the CKB Default lock
Omnilock
Omnilock is a universal and interoperable lock script supporting various blockchains (Bitcoin, Ethereum, EOS, etc.) verification methods and extensible for future additions. Combine Omnilock with spore-sdk to:
- Create public clusters with the Omnilock ACP lock
- Create spores in public clusters with the Omnilock lock