-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ckb development network for src/tm... scripts
- Loading branch information
Showing
9 changed files
with
213 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,6 @@ | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
src/info.json | ||
src/migrations |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
URL="http://18.162.168.78:8114" | ||
|
||
rm -rf migrations | ||
mkdir migrations | ||
ckb-cli --url ${URL} deploy gen-txs \ | ||
--deployment-config ./deploy.toml \ | ||
--migration-dir ./migrations \ | ||
--from-address ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqt4z78ng4yutl5u6xsv27ht6q08mhujf8s2r0n40 \ | ||
--sign-now \ | ||
--info-file info.json | ||
ckb-cli --url ${URL} deploy sign-txs \ | ||
--from-account ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqt4z78ng4yutl5u6xsv27ht6q08mhujf8s2r0n40 \ | ||
--add-signatures \ | ||
--info-file info.json | ||
ckb-cli --url ${URL} deploy apply-txs --migration-dir ./migrations --info-file info.json | ||
rm -rf info.json | ||
rm -rf migrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[[cells]] | ||
name = "spore" | ||
enable_type_id = false | ||
location = { file = "binSpore" } | ||
|
||
[[cells]] | ||
name = "cluster" | ||
enable_type_id = false | ||
location = { file = "binCluster" } | ||
|
||
# The lock script set to output cells | ||
[lock] | ||
code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" | ||
args = "0x75178f34549c5fe9cd1a0c57aebd01e7ddf9249e" | ||
hash_type = "type" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
import { createConfig } from '@ckb-lumos/config-manager'; | ||
import { SporeConfig, PredefinedSporeConfigScriptName } from '@spore-sdk/core'; | ||
|
||
// export const config: SporeConfig<PredefinedSporeConfigScriptName> = { | ||
// lumos: createConfig(createConfig({ | ||
// PREFIX: "ckt", | ||
// SCRIPTS: { | ||
// SECP256K1_BLAKE160: { | ||
// CODE_HASH: | ||
// "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", | ||
// HASH_TYPE: "type", | ||
// TX_HASH: | ||
// "0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37", | ||
// INDEX: "0x0", | ||
// DEP_TYPE: "depGroup", | ||
// SHORT_ID: 0, | ||
// }, | ||
// SECP256K1_BLAKE160_MULTISIG: { | ||
// CODE_HASH: | ||
// "0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8", | ||
// HASH_TYPE: "type", | ||
// TX_HASH: | ||
// "0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37", | ||
// INDEX: "0x1", | ||
// DEP_TYPE: "depGroup", | ||
// SHORT_ID: 1, | ||
// }, | ||
// DAO: { | ||
// CODE_HASH: | ||
// "0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e", | ||
// HASH_TYPE: "type", | ||
// TX_HASH: | ||
// "0x8f8c79eb6671709633fe6a46de93c0fedc9c1b8a6527a18d3983879542635c9f", | ||
// INDEX: "0x2", | ||
// DEP_TYPE: "code", | ||
// }, | ||
// SUDT: { | ||
// CODE_HASH: | ||
// "0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4", | ||
// HASH_TYPE: "type", | ||
// TX_HASH: | ||
// "0xe12877ebd2c3c364dc46c5c992bcfaf4fee33fa13eebdf82c591fc9825aab769", | ||
// INDEX: "0x0", | ||
// DEP_TYPE: "code", | ||
// }, | ||
// ANYONE_CAN_PAY: { | ||
// CODE_HASH: | ||
// "0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356", | ||
// HASH_TYPE: "type", | ||
// TX_HASH: | ||
// "0xec26b0f85ed839ece5f11c4c4e837ec359f5adc4420410f6453b1f6b60fb96a6", | ||
// INDEX: "0x0", | ||
// DEP_TYPE: "depGroup", | ||
// SHORT_ID: 2, | ||
// }, | ||
// OMNILOCK: { | ||
// CODE_HASH: | ||
// "0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb", | ||
// HASH_TYPE: "type", | ||
// TX_HASH: | ||
// "0x27b62d8be8ed80b9f56ee0fe41355becdb6f6a40aeba82d3900434f43b1c8b60", | ||
// INDEX: "0x0", | ||
// DEP_TYPE: "code", | ||
// }, | ||
// }, | ||
// })), | ||
// ckbNodeUrl: 'https://testnet.ckb.dev/rpc', | ||
// ckbIndexerUrl: 'https://testnet.ckb.dev/indexer', | ||
// maxTransactionSize: 500 * 1024, | ||
// scripts: { | ||
// Spore: { | ||
// script: { | ||
// codeHash: '0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494', | ||
// hashType: 'data1', | ||
// }, | ||
// cellDep: { | ||
// outPoint: { | ||
// txHash: '0xfd694382e621f175ddf81ce91ce2ecf8bfc027d53d7d31b8438f7d26fc37fd19', | ||
// index: '0x0', | ||
// }, | ||
// depType: 'code', | ||
// }, | ||
// versions: [], | ||
// }, | ||
// Cluster: { | ||
// script: { | ||
// codeHash: '0x598d793defef36e2eeba54a9b45130e4ca92822e1d193671f490950c3b856080', | ||
// hashType: 'data1', | ||
// }, | ||
// cellDep: { | ||
// outPoint: { | ||
// txHash: '0x49551a20dfe39231e7db49431d26c9c08ceec96a29024eef3acc936deeb2ca76', | ||
// index: '0x0', | ||
// }, | ||
// depType: 'code', | ||
// }, | ||
// versions: [], | ||
// }, | ||
// }, | ||
// extensions: [], | ||
// }; | ||
|
||
|
||
export const config: SporeConfig<PredefinedSporeConfigScriptName> = { | ||
lumos: createConfig(createConfig({ | ||
PREFIX: "ckt", | ||
SCRIPTS: { | ||
SECP256K1_BLAKE160: { | ||
CODE_HASH: | ||
"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", | ||
HASH_TYPE: "type", | ||
TX_HASH: | ||
"0x94dfbac7f4ccb5b1f41b1cc314abae9df3f85108af214c5aaff569c8ada0885e", | ||
INDEX: "0x0", | ||
DEP_TYPE: "depGroup", | ||
SHORT_ID: 0, | ||
}, | ||
}, | ||
})), | ||
ckbNodeUrl: 'http://18.162.168.78:8114/rpc', | ||
ckbIndexerUrl: 'http://18.162.168.78:8114/indexer', | ||
maxTransactionSize: 500 * 1024, | ||
scripts: { | ||
Spore: { | ||
script: { | ||
codeHash: '0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494', | ||
hashType: 'data1', | ||
}, | ||
cellDep: { | ||
outPoint: { | ||
txHash: '0x769d127f11d81e8f6e8aefd45ea4fe8a32e9d84e70ec1267170c6db82b9796f0', | ||
index: '0x0', | ||
}, | ||
depType: 'code', | ||
}, | ||
versions: [], | ||
}, | ||
Cluster: { | ||
script: { | ||
codeHash: '0x598d793defef36e2eeba54a9b45130e4ca92822e1d193671f490950c3b856080', | ||
hashType: 'data1', | ||
}, | ||
cellDep: { | ||
outPoint: { | ||
txHash: '0x769d127f11d81e8f6e8aefd45ea4fe8a32e9d84e70ec1267170c6db82b9796f0', | ||
index: '0x0', | ||
}, | ||
depType: 'code', | ||
}, | ||
versions: [], | ||
}, | ||
}, | ||
extensions: [], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { transferSpore } from '@spore-sdk/core'; | ||
import { config } from './tmConfig'; | ||
import { accounts } from './tmWallet'; | ||
|
||
async function main() { | ||
let { txSkeleton } = await transferSpore({ | ||
outPoint: { | ||
txHash: '0xb83fa0529c76fede0531b211ddf61a689f52470584d9f487cd6c40a7df7cec53', | ||
index: '0x0', | ||
}, | ||
toLock: accounts.bob.lock, | ||
config: config, | ||
}); | ||
let hash = await accounts.alice.signAndSendTransaction(txSkeleton); | ||
console.log(`Spore transfered at: https://pudge.explorer.nervos.org/transaction/${hash}`); | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters