@beclab/olaresid
v0.1.7
Published
DID Contract SDK with CLI tool
Maintainers
Readme
OlaresID SDK & CLI
Introduction
olaresid is an SDK library and CLI tool for interacting with Olares ID contracts.
Quick Start
As a CLI Tool
npm install -g @beclab/olaresid
# Query Olares ID information on testnet
did-cli info example.olares.com
# Query Olares ID information on mainnet
did-cli info example.olares.com --network mainnet
# Support Olares ID Format
did-cli info [email protected]For detailed CLI usage, see CLI.md.
As an SDK
npm install @beclab/olaresidRefer to the examples directory.
For Tag System usage, see TAG.md.
Frontend Usage (Browser Environment)
When using @beclab/olaresid in frontend applications (React, Vue, etc.), you need to configure polyfills and bundler settings due to:
- WASM Support: The package includes Trust Wallet Core WASM module
- Node.js Polyfills: Browser environments need
bufferpolyfill - CommonJS Format: The package is in CommonJS format
Webpack has better support for CommonJS packages and WASM modules. We strongly recommend using Webpack for bundling.
Contribution Guide
Contributions are welcome! Before submitting a PR, you can test your changes locally in the following ways:
Environment Setup
# Clone the repository and install dependencies
git clone https://github.com/beclab/did-system.git
cd did-system/packages/olaresid
npm installTesting Method 1: Debug via CLI
After modifying the code, you can test your changes through the CLI tool:
# Compile the code
npm run build
# Link the local version globally
npm link
# Test CLI functionality
did-cli info tw7613781.olares.com
did-cli info pengpeng8.olares.com --network mainnetTesting Method 2: Debug via Example Code
You can also test by running example code in the examples directory:
# Compile the code
npm run build
# Run examples
npx ts-node ./examples/index.ts
# Or run other examples
npx ts-node ./examples/legacy.tsAfter testing, feel free to submit a Pull Request!
Network Configuration
Sepolia Testnet (Default)
- RPC: https://sepolia.optimism.io
- DID Contract: 0xe2D7c3a9013960E04d4E9F5F9B63fff37eEd97A8
- Root Resolver: 0xeF727cb066Fee98F88Db84555830063b4A24ddfc
- Root Resolver2: 0xcbC02aa08c77a374eC0D5A0403E108b7573d96e8
- ABI Type: 0x7386fCBae6Ad4CCE1499d9153D99bc950B589718
Mainnet
- RPC: https://optimism-rpc.publicnode.com
- DID Contract: 0x5DA4Fa8E567d86e52Ef8Da860de1be8f54cae97D
- Root Resolver: 0xE2EABA0979277A90511F8873ae1e8cA26B54E740
- Root Resolver2: 0x7e7961aB771cA942CE4DB6e79579e016a33Dc95B
- ABI Type: 0x9ae3F16bD99294Af1784beB1a0A5C84bf2636365
