# Create Community

## Creating a Community with an Installed Membership Plugin

The Membership plugin serves as a governance mechanism, allowing a defined portion of members to approve proposals for them to be ratified. It specifies a minimum number of approvals required and designates the addresses permitted to cast votes.

To set up a DAO that incorporates the Membership plugin, you need to first initialize the Membership plugin client and then employ it in the process of creating your DAO.

```javascript
import {
  Client,
  CreateDaoParams,
  DaoCreationSteps,
  MultisigClient,
  MultisigPluginInstallParams,
} from "@aragon/sdk-client";
import { GasFeeEstimation } from "@aragon/sdk-client-common";
import { context } from "../index";

// Instantiate a client from the Aragon OSx SDK context.
const client: Client = new Client(context);

// Addresses which will be allowed to vote in the Multisig plugin.
const members: string[] = [
  "0x1234567890123456789012345678901234567890",
  "0x2345678901234567890123456789012345678901",
  "0x3456789012345678901234567890123456789012",
  "0x4567890123456789012345678901234567890123",
];

const multisigPluginIntallParams: MultisigPluginInstallParams = {
  votingSettings: {
    minApprovals: 1,
    onlyListed: true,
  },
  members,
};

// Encodes the parameters of the Multisig plugin. These will get used in the installation plugin for the DAO.
const multisigPluginInstallItem = MultisigClient.encoding
  .getPluginInstallItem(multisigPluginIntallParams, "goerli");

// Pin metadata to IPFS, returns IPFS CID string.
const metadataUri: string = await client.methods.pinMetadata({
  name: "My DAO",
  description: "This is a description",
  avatar: "", // image url
  links: [{
    name: "Web site",
    url: "https://...",
  }],
});

const createParams: CreateDaoParams = {
  metadataUri,
  ensSubdomain: "my-org", // my-org.dao.eth
  plugins: [multisigPluginInstallItem],
};

// Estimate gas for the transaction.
const estimatedGas: GasFeeEstimation = await client.estimation.createDao(
  createParams,
);
console.log({ avg: estimatedGas.average, max: estimatedGas.max });

// Creates a DAO with a Multisig plugin installed.
const steps = client.methods.createDao(createParams);
for await (const step of steps) {
  try {
    switch (step.key) {
      case DaoCreationSteps.CREATING:
        console.log({ txHash: step.txHash });
        break;
      case DaoCreationSteps.DONE:
        console.log({
          daoAddress: step.address,
          pluginAddresses: step.pluginAddresses,
        });
        break;
    }
  } catch (err) {
    console.error(err);
  }
}
```

Returns:

```json
{
  txHash: "0xb1c14a49...3e8620b0f5832d61c"
}
{
  daoAddress: "0xb1c14a49...3e8620b0f5832d61c",
  pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"]
}
```


---

# Agent Instructions: 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:

```
GET https://lemonade.gitbook.io/welcome-to-lemonade/community/wallet-membership/create-community.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
