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

Investigation of DApp development frameworks #2

Open
Keith-CY opened this issue Aug 28, 2022 · 6 comments
Open

Investigation of DApp development frameworks #2

Keith-CY opened this issue Aug 28, 2022 · 6 comments

Comments

@Keith-CY
Copy link
Member

Keith-CY commented Aug 28, 2022

Report Template

Basic Info

  • Framework name and site: name of the framework and url to its page;
  • Brief description: brief description of its goal and advantages.

MVP tutorial

simplest workflow to deploy a dapp onto the chain.

Main functionalities

its main functionalities such as creating a structured project, empowering to debug deeper, on-click to deploy contracts onto the chain

Advantages over other tools

its attractive points to developers, e.g. easy to debug a dapp.

Disadvantages to other tools

its points that do not attract developers so they need another one as complements.

@Keith-CY
Copy link
Member Author

Let's append reports of DApp frameworks in this issue for the next discussion. @homura @yanguoyu

@Keith-CY Keith-CY added this to the 2022/08/31 - 2022/09/07 milestone Aug 28, 2022
@yanguoyu
Copy link

I have used hardhat to deploy a simple contract on the goerli. I will give a report about it.

@yanguoyu
Copy link

Basic Info

  • Homepage: https://hardhat.org/

  • Goal

    Flexible. Extensible. Fast. Editing, compiling, debugging and deploying your smart contracts and dApps.

  • Advantages

    It's composed with Hardhat Runner, Hardhat Network.

    • Runner manage user's tasks, it excute tasks with plugins. You can define tasks to combine operations or only define a simple js(ts) file to do something.
    • Network manage ETH networks.
    • Use javascript, typescript
    • A extension plugin support for VsCode

MVP tutorial

I have used harthat to deploy and call contract in https://github.com/yanguoyu/hardhat-test

Main functionalities

  • Plugins
    Many plugins to help us to do with contract. But to use it better we should know more plugins.
  • Network
    It has inner network, i never need to know how to start a eth node locally. It's also easy to test with other networks with config.

Advantages over other tools

If you have some other viewpoints, help us add.

@Keith-CY
Copy link
Member Author

Basic Info

  • Homepage: hardhat.org

  • Goal
    Flexible. Extensible. Fast. Editing, compiling, debugging and deploying your smart contracts and dApps.

  • Advantages
    It's composed with Hardhat Runner, Hardhat Network.

    • Runner manage user's tasks, it excute tasks with plugins. You can define tasks to combine operations or only define a simple js(ts) file to do something.
    • Network manage ETH networks.
    • Use javascript, typescript
    • A extension plugin support for VsCode

MVP tutorial

I have used harthat to deploy and call contract in yanguoyu/hardhat-test

Main functionalities

  • Plugins
    Many plugins to help us to do with contract. But to use it better we should know more plugins.
  • Network
    It has inner network, i never need to know how to start a eth node locally. It's also easy to test with other networks with config.

Advantages over other tools

If you have some other viewpoints, help us add.

There're 4 more points attracting me

  1. Hardhat is a debugging-first framework for dApp development, it provides detailed stack trace, explicit error messages and an easy-to-use console.log;
  2. Hardhat binds TypeScript with TypeChain out-of-the-box, not only uses typescript in a hardhat project but also outputs type definition of the contract for dApp development;
  3. Hardhat supports HD Wallet which is a super desirable feature for CKB or other generic UTXO blockchain;
  4. Hardhat ships omakase of toolbox, including contract verification via etherscan API, gas reporter, contract test coverage, typechain.

And some features not so outstanding but also required

  1. clearly defined project structure
.
├── README.md
├── contracts
├── hardhat.config.ts
├── node_modules
├── package-lock.json
├── package.json
├── scripts
├── test
└── tsconfig.json
  1. supports in-memory instance of hardhat network for debugging

Some plugins outside @nomicfoundation/hardhat-toolbox worth watching:

  1. hardhat contract sizer: https://www.npmjs.com/package/hardhat-contract-sizer
  2. @openzeppelin/hardhat-upgrades: https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades
  3. @primitivefi/hardhat-dodoc: https://www.npmjs.com/package/@primitivefi/hardhat-dodoc
  4. hardhat-log-remover: https://www.npmjs.com/package/hardhat-log-remover
  5. hardhat-storage-layout: https://www.npmjs.com/package/hardhat-storage-layout

@felicityin
Copy link

felicityin commented Sep 5, 2022

Aptos

1 Good

  1. It's very easy to set up development environment.
    a. Just run the scripts/dev_setup.sh bash script as shown below. This will prepare your developer environment.

    /scripts/dev_setup.sh

    b. You can transact directly with devnet without a local testnet.

    NODE_URL = "https://fullnode.devnet.aptoslabs.com"; 
    FAUCET_URL = "https://faucet.devnet.aptoslabs.com";

    c. You can also start a local testnet using the following Aptos CLI command:

    aptos node run-local-testnet --with-faucet

    And Configure your Aptos CLI to use the local testnet.

    aptos init --profile local --rest-url http://localhost:8080 --faucet-url http://localhost:8081

    d. You can create and fund an account at the same time, other than have token after mining.
    Create and fund an account in code:

    await faucetClient.fundAccount(alice.address(), 20_000); 

    Create and fund an account in CLI:

    aptos account fund-with-faucet --account a345dbfb0c94416589721360f207dcc92ecfe4f06d8ddc1c286f569d59721e5a

    e. You can install the Petra extension on your Chrome browser: Aptos Wallet extension

    The wallet has implemented some of the basics of interacting with Aptos. Such as found you account with test coins, send coins to another address, and so on.
    dApps can make requests to the wallet from their website.

  2. Developer tutorial friendly.

    There are four examples for beginners. And the tutorial explains the code line by line.
    It is also easy to run these examples, such as yarn run transfer_coin.

  3. SDK friendly

    Aptos provides Typescript SDK, Python SDK and Rust SDK. You can create, sign and submit a transaction using the SDK.

    To reduce the burden of serializing payload arguments manually, Typescript SDK also provides an ABI (Application Binary Interface) based transaction builder.

    The Aptos Typescript SDK design is well structured, there are three logical layers:

    1. The transport layer.
    2. The core SDK layer.
    3. An optional application layer.

    And the SDK is highly abstract. For example, CoinClient is used for common coin operations such as transferring coins and checking balances. The coinClient.transfer() function generates a transaction payload and has the client sign, send, and wait for it.

    In Nervos, there are several libraries to choose from, such as lumos, pw-core and cikit, makes it difficult for developers to make a choice.

  4. Only one CLI is needed: Aptos CLI.
    Using Aptos CLI, you can do everything, such as debugging, development, and node operation.
    In Nevros, there are two CLI need to be installed: ckb-cli and capsule.

2 Bad

  1. Developer need to learn Move, a new language like Rust to develop contracts.
  2. The tutorial on how to publish a new token is empty: https://aptos.dev/tutorials/your-first-coin/

@Keith-CY
Copy link
Member Author

Keith-CY commented Sep 9, 2022

Run

Basic Info

  • Framework name and site: Run, https://run.network
  • Brief description: A token protocol of interactive objects Bitcoin, provides several predefined Models like, Jig, Code, Token

MVP tutorial

https://run.network/lessons/mockchain-jig-web-console/

const run = new Run()
class Dragon = extends Jig { // generate an output but not sent to the chain
  setName(name) {
    this.name =name
  }
}

const dragon = new Dragon // generate another output and sent with DragonClass to the chain
dragon.setName('Empress') // generate an output and sent to the chain

await run.inventory.sync()
run.inventory.jigs // get all jigs

Main functionalities

It defines a general interactive object(Jig) to create, update, send, sync, destroy, and interoperate.

Based Jigs, some most used Models are derived

  • Code: store data to control the Jig, or provide reusable helper functions to share.

    • Deploy
    • Load
    • Link: connect to other function
    • Extend
    • Sync
    • Update
    • Upgrade
    • Trust
  • Token: extend a Jig to a token similar to ERC-20, used for stablecoins, in-game currencies, tradable reward points, etc.

    • Define
    • Mint
    • Send
    • Combine
    • Redeem
    • Limit Supply
    • Blacklist

Jigs will be delivered with standard metadata for wallet/explorer to present

Some predefined rules for property management

  • Lock: an object produces a Bitcoin output script that is assigned as the owner to jigs. Lock class's script() method defines how the output script is built from the lock instance's properties, and a Jig uses the result of script() as authorization.

Advantages over other tools

It sets a lower limit for designing a dapp, confines generally used Property, Token, Function models

Disadvantages to other tools

// TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants