> For the complete documentation index, see [llms.txt](https://docs.v2.like.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.v2.like.co/developer/likecoin-chain-api/setup-local-test-node.md).

# Setup local test node

{% hint style="warning" %}
The documentation is designed for Liker Land and LikeCoin v2. For information on [3ook.com](https://3ook.com/) and LikeCoin v3, please visit [docs.3ook.com](https://docs.3ook.com) and [dao.like.co](https://dao.like.co/).
{% endhint %}

1. Clone the [likecoin-chain](https://github.com/likecoin/likecoin-chain) git repository using the latest tag. As of now latest version is `v3.0.0`, please check the mainnet repository to confirm version.

```
git clone https://github.com/likecoin/likecoin-chain \
--branch v3.0.0 --single-branch \
likecoin-chain && cd likecoin-chain
```

2\. (optional) Build the chain Docker image

```
make build-docker
```

3\. Setup the needed files and folders

```
cp docker-compose.yml.template docker-compose.yml
cp .env.template .env
mkdir -p .liked
```

4\. Add a key for local use, please record the **mnemonic** shown

```
export YOUR_KEY_NAME=<type your key name here>
export CHAIN_ID=<type your chain ID here>
docker-compose run --rm liked-command \
    keys add $YOUR_KEY_NAME
```

5\. Init the testnet

```
docker-compose run --rm liked-command \
    init testnet --chain-id $CHAIN_ID
```

6\. Set all denom in `genesis.json` to nanolike

```
docker-compose run --rm liked-service \
    sed -i 's/"stake"/"nanolike"/g' /likechain/.liked/config/genesis.json
```

7\. Init the testnet accounts

```
docker-compose run --rm liked-command \
    add-genesis-account $YOUR_KEY_NAME 2000000000000000000nanolike

docker-compose run --rm liked-command \
    gentx $YOUR_KEY_NAME 1000000000000000000nanolike --chain-id $CHAIN_ID

docker-compose run --rm liked-command \
    collect-gentxs
```

8\. Modify `docker-compose.yml` and `./.liked/config/app.toml` if you need lcd / grpc services

```
#docker-compose.yml
	    ports:
            - 1317:1317
            - 9090:9090
            - 26656:26656
            - 127.0.0.1:26657:26657
```

```
# app.toml
[api]

# Enable defines if the API server should be enabled.
enable = true
```

9\. Start running the node

```
docker-compose up -d
```


---

# 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.v2.like.co/developer/likecoin-chain-api/setup-local-test-node.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.
