# Activation

## Get Activation Block

Get the block height the contract activates at.

{% hint style="info" %}
Requires `@stacks/network` and `@stacks/transactions`
{% endhint %}

```
// returns the activation block height

const NETWORK = new StacksMainnet(); // set network from @stacks/network

export async function getActivationBlock() {
  const resultCv = await callReadOnlyFunction({
    contractAddress: 'SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27',
    contractName: 'miamicoin-core-v1',
    functionName: 'get-activation-block',
    functionArgs: [],
    network: NETWORK, 
    senderAddress: contractAddress, // can be any valid STX address
  });
  const result = cvToJSON(resultCv);
  return result.value.value; // activation block height
}
```

## Get Registered Users

Get the total number of registered users that have sent one of the following:

* register user tx (`register-user`)
* mining tx (`mine-tokens` or `mine-many`)
* stacking tx (`stack-tokens`)

{% hint style="info" %}
Requires `@stacks/network` and `@stacks/transactions`
{% endhint %}

```
// returns the current number of registered users

const NETWORK = new StacksMainnet(); // set network from @stacks/network

export async function getRegisteredUsersNonce() {
  const resultCv = await callReadOnlyFunction({
    contractAddress: 'SP466FNC0P7JWTNM2R9T199QRZN1MYEDTAR0KP27',
    contractName: 'miamicoin-core-v1',
    functionName: 'get-registered-users-nonce',
    functionArgs: [],
    network: NETWORK,
    senderAddress: contractAddress, // can be any valid STX address
  });
  const result = cvToJSON(resultCv);
  return result.value; // total registered users
}
```


---

# 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://docs.citycoins.co/developer-resources/code-examples/activation.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.
