This is a web app, hosted at dashpay.io, to help people intuitively create and edit Dash Platform data contracts. There are three options available for getting started. Users can:
- Use the ChatGPT widget to automatically generate a data contract based on the provided context.
- Manually fill out a dynamic form.
- Import an existing data contract and edit it.
The app also validates the data contracts against Dash Platform Protocol, so users can save time and money by validating before actually submitting data contracts to Dash Platform.
In the future, users will be able to register data contracts to Dash Platform directly from the web app. However, for now, they must use the JavaScript SDK, where they can copy and paste the contracts generated from here.
This app is built in Rust using the Yew framework and WebAssembly.
- Use ChatGPT to generate and modify Platform-compliant (usually) data contracts
- Dynamically create and modify data contracts using a web interface
- Import existing data contract schemas for editing
- Validate data contract schemas against Dash Platform Protocol rules
- Paste your OpenAI API key into the field at the top left.
- Describe your app in a few words or sentences and press return.
- Have a look at the generated contract and note any changes you'd like to make.
- It's recommended to make changes manually using the dynamic form, but you may also describe changes to the AI.
- Use the dynamic form on the left to add, edit, or remove document types, properties, and indexes manually.
- Once finished, click the "Submit" button.
- View the generated contract and potential validation errors with the right-side interface.
- If the right-side text area is already populated, click the "Clear" button.
- Paste a data contract into the right-side text area.
- Click the "Import" button. The dynamic form should automatically populate.
This app is available to use at dashpay.io, however, you can also run the code locally, following these steps:
Yew environment:
- Install WebAssembly target:
rustup target add wasm32-unknown-unknown
- Install Trunk:
cargo install --locked trunk
App:
- Clone the repository:
git clone https://github.com/dashpay/data-contract-creator.git
- Change into the project directory:
cd data-contract-creator
- Mac users may need to run the following commands if they have issues compiling certain libraries such as secp256k1-sys:
export AR_PATH=$(command -v llvm-ar)
export CLANG_PATH=$(command -v clang)
export AR=${AR_PATH} CC=${CLANG_PATH} ${BUILD_COMMAND}
export AR=${AR_PATH} CC=${CLANG_PATH} ${BINDGEN_COMMAND}
- Start the app
trunk serve --open
Once a wallet capable of authentication is available for Dash Platform, this app should integrate a "connect wallet" button so the generated data contract can be directly registered on Dash Platform from dashpay.io.
Contributions are welcome! Please submit a pull request or open an issue if you encounter any problems or have suggestions for improvement.
This project is licensed under the MIT License.