Skip to content
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

Merged
merged 4 commits into from
Jun 16, 2023
Merged

feat(mvp): support contract #294

merged 4 commits into from
Jun 16, 2023

Conversation

zhengjianhui
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2023

Codecov Report

Merging #294 (aae40bc) into develop (5c34cdd) will decrease coverage by 1.67%.
The diff coverage is n/a.

Impacted file tree graph

@@             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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c34cdd...aae40bc. Read the comment docs.

@Keith-CY
Copy link
Member

Keith-CY commented Jun 2, 2023

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

@Keith-CY
Copy link
Member

Keith-CY commented Jun 4, 2023

The readme(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

## Contract build

$ capsule build --release

Which directory should I go to run this command

packages/samples/mvp-dapp/contract/README.md Show resolved Hide resolved
[[cells]]
name = "sample-dapp"
enable_type_id = true
# [[cells]]
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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

@zhengjianhui zhengjianhui reopened this Jun 5, 2023
@zhengjianhui
Copy link
Contributor Author

zhengjianhui commented Jun 5, 2023

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

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building contract can be done by kuai-cli

$ kuai contract build --release

Ref: #242

## Contract new

```shell
$ kuai contract new --name kuai-mvp-contract
Copy link
Member

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

Copy link
Member

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',
Copy link
Contributor

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.

Copy link
Contributor Author

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

Comment on lines +8 to +40
## 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: {
...
},
}

```
Copy link
Member

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
Copy link
Member

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

@Keith-CY

This comment was marked as resolved.

@Keith-CY

This comment was marked as resolved.

@Keith-CY
Copy link
Member

Issue that if libs-like module should be included by default: nervosnetwork/capsule#124

@Keith-CY
Copy link
Member

Any update on these unresolved conversations?

@Keith-CY Keith-CY merged commit 11ea8fb into develop Jun 16, 2023
2 checks passed
@Keith-CY Keith-CY deleted the feat/mvp-contract branch June 16, 2023 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants