Installation¶
The Deep Trust Network SDK is available as an npm package that provides smart contracts for integrating AI functionality into your blockchain applications.
Prerequisites¶
Before installing the DTN SDK, ensure you have:
- Node.js (version 16 or higher)
- npm or yarn package manager
- A Solidity development environment (Hardhat, Truffle, or Foundry)
Installing the SDK¶
Install the DTN SDK using npm:
Or using yarn:
What Gets Installed¶
The installation provides access to the following core contracts:
Core Contracts¶
with-dtn-ai.sol
- Base contract that provides AI functionality to your smart contractswith-dtn-ai-upgradeable.sol
- Upgradeable version of the base contract for upgradeable contractsidtn-ai.sol
- Interface definitions for AI interactions and data structuresdtn-defaults.sol
- Default configurations and helper functions for common use cases
Dependencies¶
The SDK automatically installs required dependencies:
- OpenZeppelin contracts for security and standard implementations
- SafeERC20 for secure token transfers
Verification¶
To verify the installation, you can import the contracts in your Solidity files:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@deeptrust/contracts/with-dtn-ai.sol";
import "@deeptrust/contracts/dtn-defaults.sol";
contract MyContract is WithDtnAi {
// Your implementation here
}
Next Steps¶
After installation, you can:
- Read the Quick Start guide to create your first AI-powered contract
- Learn about Core Concepts to understand how DTN works
- Explore Examples to see practical implementations
Troubleshooting¶
Common Issues¶
Import errors: Ensure you're using the correct import path with the @deeptrust/contracts
prefix.
Version conflicts: If you encounter dependency conflicts, try using a specific version:
Hardhat/Truffle configuration: Make sure your development framework is configured to resolve npm packages correctly.
Getting Help¶
If you encounter issues during installation:
- Check the GitHub repository for known issues
- Review the API documentation for contract details
- Join the community discussions for support