-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support infrastructural scripts on devnet #235
Comments
What I designed is as follow. First, I will provider a method named In file
const ckbDockerNetwork = new CkbDockerNetwork()
await ckbDockerNetwork.start({
port: port.toString(),
detached,
genesisAccountArgs: genesisArgs,
})
await ckbDockerNetwork.depolyInfraScripts() Create a folder to store scripts in package
In file
deploy() {
// load scripts bin from scripts file
// deploy them by prepared account
// output the cell info of deployed scripts to command line and file What I inspires me is Force Bridge. https://github.com/Magickbase/force-bridge/blob/feature-nervos-to-ethereum/offchain-modules/packages/x/src/ckb/tx-helper/deploy.ts |
An entry to extend the script list on devnet should be provided for users to add custom scripts. Since we're going to support the deployment of multiple contracts(#230) and binaries(#231), how about specifying a directory full of contract binaries and a metadata file as an index of the contracts to deploy, e.g. {
"sudt": {
"path": "built-in/sudt"
},
"custom": {
"path": "./custom"
}
} And the deployed tx info will be appended into the metadata file for reference in dapp. |
That's a good idea. I will change the file as follow. {
"sudt": {
"path": "built-in/sudt",
// will be added to file after the deployment
"cellDep": {
"depType": "${code}",
"outPoint": {
"txHash": "${txHash}",
"index": "0x0",
},
},
"script": {
"codeHash": "${codeHash}",
"hashType": "data"
}
} |
Should we need to consider how to deploy a contract that |
Please cover this in the contract deployment by kuai-cli @PainterPuppets |
{
"builtIn": [
{
"name": "sudt",
"path": ["built-in/sudt"],
// will be added to file after the deployment
"cellDep": {
"depType": "code",
"outPoint": {
"txHash": "${txHash}",
"index": "0x0"
}
},
"script": {
"codeHash": "${codeHash}",
"hashType": "data"
}
}
],
"custom": [
{
"name": "custom",
"path": ["custom1"],
// will be added to file after the deployment
"cellDep": {
"txHash": {
"txHash": "${txHash}",
"index": "0x0"
},
"depType": "depGroup",
"cellDeps": [
{
"txHash": {
"txHash": "${txHash}",
"index": "0x0"
},
"depType": "code"
}
]
}
}
] Set deps while the dep type is dep group. |
Another point, should we place the binary files into the repo? I think there are three ways to provide the built-in contracts
@Keith-CY @yanguoyu @zhangyouxin @PainterPuppets I prefer the first way. |
Building on users' PC is unacceptable because it requires the setup of develop environment. Another option is to build binaries by CI and publish them in an independent repo, as a git submodule of Ref: |
Is this ticket already is in development? Maybe we can reuse the e2e node of Nexus's ckb-js/nexus#239 |
We're still designing it. This topic has been discussed in discord channel and can be continued there because it covers not only these two projects. We can even propose a project for e2e test in various projects. |
You're right, the wrapper will
|
I'll have a try in |
I copied the code from nexus, and made some necessary modification, to instead of using docker node. And then I will create a repo to publish the binary files of built-in scripts for @Keith-CY @homura @yanguoyu @PainterPuppets @zhengjianhui The PR will be updated tomorrow after fully test. |
So we will not use docker to start ckb dev chain? But if we start |
Any feedback from lumos users that complain about launching ckb node? @homura @zhangyouxin @PainterPuppets @IronLu233 |
Lumos will only launch a CKB node when run its E2E testing, so the users of Lumos do not need to install a Docker or CKB node |
So we can assume that users of lumos can host their own node successfully. But after consideration, I think it is necessary to use docker for the production environment because we may recommend users to deploy projects built by kuai via docker. |
PR: #257 |
The following are the most prevailing scripts that not provided on devnet by default
But they are widely used in dapps, and are usually inevitable in dapp development. It would be quite helpful if they are out-of-the-box in kuai
The text was updated successfully, but these errors were encountered: