# Start blockchain node on Ubuntu

## Start Node by axmd-install.sh Script <a href="#start-node-by-axmd-initsh-script" id="start-node-by-axmd-initsh-script"></a>

You can start the axm node using the `axmd-install.sh` automation script. This script performs the following steps:

* Downloads the latest version of the prebuilt `axm-node` binaries.
* Downloads the prebuilt version of `cosmovisor`.
* Downloads `cosmovisor.service` and copies it to `/etc/systemd/system/`.
* Initializes the node with the provided name.
* Sets up the directory structure and initializes node configuration files with recommended values.
* Downloads the genesis file and places it into `$DAEMON_HOME/config/genesis.json`.
* Downloads the latest binary blocks and places them into `$DAEMON_HOME/data/`.

Download the script from GitHub releases, change its permissions, and run:

```sh
curl -L -o axmd-install.sh https://github.com/axiome-pro/axm-node/releases/download/v1.0.3/axmd-install-1.0.3.sh
chmod 755 axmd-install.sh
./axmd-install.sh -m <moniker> -h <daemon-home> -r <enable rest>
```

Script parameters:

* `-m` - moniker name (i.e., your node name).
* `-h` - daemon home (where to place daemon config and data files). Also sets the `$DAEMON_HOME` variable for `cosmovisor`. Defaults to `~/.axmd/`.
* `-r` - specify to enable blockchain app legacy REST endpoints.

After running this script, you can check $DAEMON\_HOME and correct your config files as needed (for config parameters, look in Cosmos SDK and Comet BFT docs).

Now you can start the node by running the cosmovisor service:

```sh
systemctl start cosmovisor 
```

P.S. You can safely remove `$DAEMON_HOME/data/blocks-latest.tar.gz` after start.

## Start node from scratch <a href="#start-node-from-scratch" id="start-node-from-scratch"></a>

First, you need to obtain binaries using one of two possibilities: get prebuilt binaries from our releases or build binaries from source codes. When binaries are ready, you can start the node using the genesis file (which takes longer), or download binary blocks and start from them.

### Get prebuilt binaries <a href="#get-prebuilt-binaries" id="get-prebuilt-binaries"></a>

Go to the [Releases](https://github.com/axiome-pro/axm-node/releases/) section of GitHub

Download appropriate file and move to `/usr/local/bin`

```sh
curl -L -o axmd https://github.com/axiome-pro/axm-node/releases/download/v1.0.1/axmd-linux-amd64-1.0.1
chmod 755 axmd
mv axmd /usr/local/bin
```

### Build from sources <a href="#build-from-sources" id="build-from-sources"></a>

Make sure you have Docker installed.

Download this repo and check out v1.0.0 version with

```sh
git clone https://github.com/axiome-pro/axm-node.git -b v1.0.1 
```

Build the application with make

```sh
make build-all
```

Copy a built binary from the builds directory to somewhere your OS could find it (i.e. some directory in a `$PATH`)

```sh
cp build/linux_amd64/axmd /usr/local/bin/axmd
```

### Starting node from genesis file <a href="#starting-node-from-genesis-file" id="starting-node-from-genesis-file"></a>

Initialize your node with

```sh
axmd init [moniker] where [moniker] is a name you like.
```

Replace a just created genesis file (`$HOME/.axmd/config/genesis.json` by default) with one downloaded from <https://github.com/axiome-pro/axm-node/releases/download/v1.0.0/genesis.json>

Validate genesis file sha256 checksum (`efa132483274106bfbf425db2912218ed3219a6065491d73dc79abeba076be30`)

In the node configuration file (`$HOME/.axmd/config/config.toml` by default) set peers, seeds and consensus parameters:

```toml
persitent_peers = ""
seeds = "eaxmple@eaxmple.com"
timeout_propose = "3s"
timeout_propose_delta = "500ms"
timeout_prevote = "1s"
timeout_prevote_delta = "500ms"
timeout_precommit = "1s"
timeout_precommit_delta = "500ms"
timeout_commit = "5s"
```

Start node with

```sh
axmd start
```

The node will download and replay blocks, it may take a while.

### Additional: starting node with binary block data (for faster syncing) <a href="#additional-starting-node-with-binary-block-data-for-faster-syncing" id="additional-starting-node-with-binary-block-data-for-faster-syncing"></a>

Download latest binary blocks archive from our CDN to empty `$HOME/data/` directory and extract it

```shell
curl -L -o latest.tar.gz https://axiome.fra1.cdn.digitaloceanspaces.com/blocks/blocks-latest.tar.bz2
tar -xzf latest.tar.gz
```

then you can run `axmd` as usual

> Blocks for 1.0.3: <https://axiome.fra1.cdn.digitaloceanspaces.com/axmd/blocks20240412.tar.gz>
>
> Blocks for 1.0.2: <https://axiome.fra1.cdn.digitaloceanspaces.com/axmd/blocks20240404.tar.gz>
>
> Blocks for 1.0.1: <https://axiome.fra1.cdn.digitaloceanspaces.com/blocks/blocks-latest.tar.bz2>


---

# 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.axiomeinfo.org/developer-documentation/start-blockchain-node-on-ubuntu.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.
