> For the complete documentation index, see [llms.txt](https://docs.infrablockchain.net/infrablockchain-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infrablockchain.net/infrablockchain-docs/infrablockchain/tutorials/service-chains/infra-did-parachain/add-services.md).

# Add Service Endpoint

### Before you begin

Before you begin, Make sure you have the following:

* [Creating InfraDID](/infrablockchain-docs/infrablockchain/tutorials/service-chains/infra-did-parachain/create-infra-did.md)

### Adding Service Endpoints to InfraDID

To make a list of service endpoints available for a specific DID and store it on the chain, making it public for others to inspect the Document of a specific DID, follow these steps:

1. Visit the [InfraBlockchain Explorer](https://portal.infrablockspace.net) and follow the steps below.

* Go to `Developer` - `Extrinsic` and select the `addServices` extrinsic of the `didModule` palette.

  Configure it as shown below and trigger the extrinsic:

  ![add-services](/files/lIzp78s2cC3R615SpPvy)

### Removing Service Endpoints from InfraDID

To remove service endpoints from InfraDID, follow these steps:

1. Visit the [InfraBlockchain Explorer](https://portal.infrablockspace.net) and follow the steps below.

* Go to `Developer` - `Extrinsic` and select the `removeServices` extrinsic of the `didModule` palette.

  Configure it as shown below and trigger the extrinsic:

  ![remove-services](/files/fwhfLLAOW27LxDIgbilt)

### Adding and Removing Service Endpoints from InfraDID Using the `infra-did-js` Library

To add and remove service endpoints from InfraDID using the `infra-did-js` library:

1. Install the [`infra-did-js`](https://github.com/InfraBlockchain/infra-did-js) library.

   ```shell
   yarn add infra-did-js
   ```
2. Write code to set up the basic configuration code for accessing InfraDID chain, as shown below:

   ```typescript
   import  {InfraSS58, CRYPTO_INFO} from 'infra-did-js';

   const txfeePaterAccountKeyPair = await InfraSS58.getKeyPairFromUri('//Alice', 'sr25519');
   const confBlockchainNetwork = {
     networkId: 'space',
     address: 'ws://localhost:9944',
     // seed or keyPair required
     txfeePayerAccountKeyPair,
     // or txfeePayerAccountSeed: 'TX_FEE_PAYER_ACCOUNT_SEED'
   };
   const conf = {
     ...confBlockchainNetwork,
     did: 'did:infra:space:5CRV5zBdAhBALnXiBSWZWjca3rSREBg87GJ6UY9i2A7y1rCs',
     // seed or keyPair required
     seed: 'DID_SEED',
     // keyPair: keyPair,
     controllerDID: 'did:infra:space:5HdJprb8NhaJsGASLBKGQ1bkKkvaZDaK1FxTbJRXNShFuqgY'
     controllerSeed: 'DID_CONTROLLER_SEED',
     // or controllerKeyPair: controllerKeyPair
   };
   const infraApi = await InfraSS58.createAsync(conf);
   ```
3. Write code to add service endpoints to InfraDID:

   ```typescript
   // Add Service Endpoint
   /*
   addServiceEndpoint(
     originsTexts: string[],
     endpointType?: ServiceEndpointType,
     endpointIdText?: string,
   )
   */
   await infraApi.didModule.addServiceEndpoint(SOME_SERVICE_ENDPOINT_URLS);
   ```
4. Alternatively, write code to remove service endpoints from InfraDID:

   ```typescript
   // Remove Service Endpoint
   /*
   removeServiceEndpoint(
     endpointIdText?: string
   )
   */
   await infraApi.didModule.removeServiceEndpoint();
   ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.infrablockchain.net/infrablockchain-docs/infrablockchain/tutorials/service-chains/infra-did-parachain/add-services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
