Darwin Quickstart

This guide provides a step-by-step guide for quickly interacting with the Darwin AI blockchain platform.
Prerequisites
Prepare Your EVM-Compatible Wallet: Ensure your wallet supports EVM standards and can interact with Ethereum-based smart contracts. We recommend using MetaMask.
Add Darwin Chain Network:
Visit the Darwin Chain website.
Scroll down -> click the Add Darwin Chain button.
Acquire $DNA Tokens:
Visit the Darwin Faucet at
https://darwin-faucet.example.comYou can participate in staking and transactions to obtain initial $DNA tokens.
Quickstart
Step 1: Create and Submit a Stake Transaction
Use the ether.js to connect to the contract and call the stakeDNA function:
Step 2: Sign and Submit AI Transactions with EIP-712
This step details how to securely structure, sign, and submit an AI transaction using the EIP-712 standard with ethers.js.
Define the domain and the types:
Define the conversation in a structured format, with each entry specifying the role and the corresponding input, encapsulating the interaction sequence:
Sign the transaction:
Submit the signed transaction to the Relayer:
Step 3: Retrieve Streaming AI Results from the Query Mixer
Retrieve the AI-generated results from the Query Mixer using your unique requestId :
When requesting streaming data, the server keeps the connection open, sending real-time updates as AI nodes process them. Each data packet contains a portion of the AI's response, allowing the client to process or display the information incrementally.
Last updated