update network-core-sdk-mtls-example

This commit is contained in:
fksyuan 2025-12-23 20:39:06 +08:00
parent 9f2ea84960
commit abf15d5164
2 changed files with 36 additions and 11 deletions

25
.gitignore vendored Normal file
View File

@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env

View File

@ -2,7 +2,7 @@
## About Primus Network-Core-SDK
When integrating data verification solutions into your **backend** server, you can utilize the [**Primus Network Core SDK**](https://docs.primuslabs.xyz/primus-network/build-with-primus/for-backend/simpleexample). For integrating Primus network capabilities with DApps for end users, please refer to the [DApp Integration](https://docs.primuslabs.xyz/primus-network/build-with-primus/for-developers/example) guide.
When integrating data verification solutions into your **backend** server, you can utilize the [**Primus Network Core SDK**](https://docs.primuslabs.xyz/primus-network/build-with-primus/for-backend/simpleexample).
The Network-Core-SDK allows you to verify data through API endpoint responses. An authorized token or other credential is required to request private data if the data source server requires permissioned access. Note that in the backend integration situation, the developer usually proves their off-chain data in their built application, and the Primus extension is **not** required. Typical scenarios include proof of reserves, in which a configured web page periodically proves that the stablecoin issuer holds sufficient collateral across off-chain platforms.
@ -29,16 +29,6 @@ const mTLS = {
};
```
## Run
```bash
node index.js
```
You should see logs for:
- submit task result
- attest result
- task result
## Customize
Edit these sections in `index.js`:
- `address`: your wallet address
@ -49,3 +39,13 @@ Edit these sections in `index.js`:
## Notes
- Keep your `.env` out of version control.
- The example uses a public RPC; for reliability, use your own provider endpoint.
## Run
```bash
node index.js
```
You should see logs for:
- submit task result
- attest result
- task result