update network-core-sdk-mtls-example doc
This commit is contained in:
1
.env.example
Normal file
1
.env.example
Normal file
@@ -0,0 +1 @@
|
|||||||
|
PRIVATE_KEY=0xYOUR_PRIVATE_KEY
|
||||||
10
README.md
10
README.md
@@ -16,7 +16,12 @@ npm install
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Configure
|
## Configure
|
||||||
Create a `.env` file in the project root:
|
Copy `.env.example` to `.env` in the project root:
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
Then set your private key:
|
||||||
```
|
```
|
||||||
PRIVATE_KEY=0xYOUR_PRIVATE_KEY
|
PRIVATE_KEY=0xYOUR_PRIVATE_KEY
|
||||||
```
|
```
|
||||||
@@ -28,13 +33,14 @@ const mTLS = {
|
|||||||
clientKey: "YourClientKeyString",
|
clientKey: "YourClientKeyString",
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
Security note: keep the client key private and stored securely; never commit it or share it publicly.
|
||||||
|
|
||||||
## Customize
|
## Customize
|
||||||
Edit these sections in `index.js`:
|
Edit these sections in `index.js`:
|
||||||
- `address`: your wallet address
|
- `address`: your wallet address
|
||||||
- `chainId` and `baseSepoliaRpcUrl`: switch to Base mainnet if needed
|
|
||||||
- `requests`: request params for your mTLS endpoint
|
- `requests`: request params for your mTLS endpoint
|
||||||
- `responseResolves`: JSON parse paths for the response fields you want to attest
|
- `responseResolves`: JSON parse paths for the response fields you want to attest
|
||||||
|
- `chainId` and `baseSepoliaRpcUrl`: switch to Base mainnet if needed
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
- Keep your `.env` out of version control.
|
- Keep your `.env` out of version control.
|
||||||
|
|||||||
Reference in New Issue
Block a user