-
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
feat(mvp): support contract #294
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #294 +/- ##
===========================================
- Coverage 69.97% 68.30% -1.67%
===========================================
Files 85 85
Lines 2528 2638 +110
Branches 576 605 +29
===========================================
+ Hits 1769 1802 +33
- Misses 685 749 +64
- Partials 74 87 +13 see 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
The readme(https://github.com/ckb-js/kuai/blob/develop/packages/samples/mvp-dapp/README.md#getting-started) should be updated to include the workflow of how to integrate a ckb contract from implementation to deployment and set configuration in backend |
It's been updated at https://github.com/ckb-js/kuai/pull/294/files#diff-5bb1b6b97643dad1bac83aa32d59c26cfc757ee890522f597663e7c212b1305a, but the document is not that clear, say
Which directory should I go to run this command |
packages/samples/mvp-dapp/contract/contracts/kuai-mvp-contract/src/entry.rs
Outdated
Show resolved
Hide resolved
[[cells]] | ||
name = "sample-dapp" | ||
enable_type_id = true | ||
# [[cells]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration could be removed if it's useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration could be removed if it's useless
This is useful and will involve some deployment-related configuration here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the usage of this module should be elaborated on the top
I updated a version of the documentation, but it still lacks an example of the mpv-backend integration contract, so I need to try the integration process and document it again |
## Contract build | ||
|
||
```shell | ||
$ capsule build --release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Contract new | ||
|
||
```shell | ||
$ kuai contract new --name kuai-mvp-contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It throws
cd: .../contract: No such file or directory
Error: Command failed: cd .../samples/mvp-dapp/contract && capsule new-contract kuai-mvp-contract --template rust
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figure out that the contract project
should be initialized first
@@ -9,7 +9,7 @@ require('dotenv').config() | |||
module.exports = { | |||
host: process.env.HOST, | |||
port: process.env.PORT, | |||
network: process.env.NETWORK || 'devnet', | |||
network: 'testnet', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be edited in .env
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be edited in
.env
file.
ok
## Configuration file modification | ||
|
||
By default, we have integrated several [networks](https://github.com/ckb-js/kuai/blob/develop/packages/core/src/constants.ts#L8) that can be used in the configuration file as follows. | ||
|
||
```js | ||
module.exports = { | ||
... | ||
network: 'testnet' | 'mainnet', | ||
jest: { | ||
... | ||
}, | ||
} | ||
|
||
``` | ||
|
||
If we need to customize the network, we can modify the `kuai.config.js` file in the root of the project. | ||
|
||
```js | ||
module.exports = { | ||
... | ||
network: 'testnet', | ||
networks: { | ||
testnet: { | ||
rpcUrl: 'https://testnet.ckb.dev', | ||
prefix: 'ckt', | ||
} | ||
}, | ||
jest: { | ||
... | ||
}, | ||
} | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step is not mandatory in my journey of deploying contract
Ref: #306
## Contract new | ||
|
||
```shell | ||
$ kuai contract new --name kuai-mvp-contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figure out that the contract project
should be initialized first
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Issue that if |
Any update on these unresolved conversations? |
No description provided.