Creating a spore with Secp256k1 lock
In this walkthrough, we will get hands-on with the process of constructing and sending spore/cluster transactions on the Testnet (Aggron) by using the Secp256k1Blake160 lock for these transactions.
Ingredients:
Steps:
Step 1: Environment Setup
Directions:
Open your terminal and clone the spore-sdk repository:
Navigate to your
spore-sdk
directory (make sure to replace the pathname with yours) :
Install dependencies by running the command:
Once installed, build your local packages with:
Your environment setup is now ready if all commands execute without errors!
Step 2: Explore the Example
Directions:
In your terminal, navigate to the Spore Secp256k1 examples directory:
You will find the example code stored in examples/secp256k1/apis
. Feel free to experiment with the code.
Step 3: Construct and Send a Spore Transaction
Directions:
To create a spore on-chain, execute the apis/createSpore.ts
example by running the command:
This script will construct and send a transaction to create a spore on-chain. If successful, a Transaction Hash will be returned. You can use this hash to review your transaction details on the CKB Explorer.
What's Next?
Congratulations! You've successfully constructed and sent a spore/cluster transaction on Testnet (Aggron) and used the Secp256k1Blake160 lock for your transactions. Use these Spore examples as a starting point to further explore and develop with the Spore SDK. Keep experimenting!
Last updated
Was this helpful?