# Install Node 2023

Node basic steps

{% file src="/files/EXRMt9jfE7OTW30JkqZ6" %}

<pre><code>// Some code
cd /usr/local

sudo su
wget https://go.dev/dl/go1.19.linux-amd64.tar.gz
tar -zxvf go1.19.linux-amd64.tar.gz
cp go /usr/local/go -R #Only if not in the path
apt-get update
apt-get install git make gcc
apt install –reinstall build-essential
IF ERROR
step 1) pico /etc/apt/sources.list
step 2) apt-get update

<strong>git clone https://github.com/treschain/TRESCLI
</strong>cd TRESCLI
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
source ~/.bashrc
go version
make geth
cd /usr/local/TRESCLI/build/bin cp -r geth /usr/local/bin/
cd /usr/local
mkdir node

git clone https://github.com/treschain/Blockchain
cd Blockchain/Configuration/Genesis/Mainet
cp -r treslechesmainnet.json /usr/local/node

cd /usr/local/node

geth init treslechesmainnet.json
geth --networkid 6066 --datadir data --identity "External Miner" --bootnodes enode://333de758402827269778b4a96f675b3d207ddb4b7fdb2a60d505d7d10d5eac564a0aa2b6cded48bbbaf7328092b81eef293c182a04e302b4b0dd01285a324b60@147.182.143.50:0?discport=30301  --port 30306 --miner.threads 1 --miner.etherbase=0x000000000000000000000000000000000000dEaD --syncmode full --http --http.vhosts "*" --http.corsdomain "*" --http.port 8548 --cache 8192  --ws.port 8549 --http.api debug,net,eth,web3,txpool --ws.api "eth,net,web3,network,debug,txpool" --gcmode "archive" --authrpc.port 8550  console

type node.AdminInfo copy enode and send to node group
CTRL + D and exit the console.

sudo nano  /etc/init.d/geth
copy the following into the geth.

</code></pre>

You need to edit the ipaddress from here to match your node.

<pre><code>/usr/local/bin/geth --networkid 6066 --datadir /usr/local/node/data --identity "Main Node" --bootnodes "enode://333de758402827269778b4a96f675b3d207ddb4b7fdb2a60d505d7d10d5eac564a0aa2b6cded48bbbaf7328092b81eef293c182a04e302b4b0dd01285a324b60@147.182.143.50:0?discport=30301" --port 30303 --miner.threads 1 --miner.etherbase=0x000000000000000000000000000000000000dEaD --ipcdisable --syncmode full --http --http.vhosts "*" --http.corsdomain "*" --http.port 8545 --nodiscover --nat extip:<a data-footnote-ref href="#user-content-fn-1">147.182.143.50</a> --http.api admin,eth,net,miner,engine,txpool,web3,debug --http.addr 127.0.0.1 --ws --ws.addr <a data-footnote-ref href="#user-content-fn-1">147.182.143.50</a> --ws.port 8549 --ws.api eth,net,web3,network,debug,txpool  --ws.origins "*" --authrpc.port 8551 --authrpc.addr <a data-footnote-ref href="#user-content-fn-2">147.182.143.50</a> --rpc.gascap 80000000 --rpc.txfeecap 2 --graphql --graphql.corsdomain "*" --graphql.vhosts "*" --gpo.blocks 10 --cache 8192 --verbosity "0" --gcmode "archive" &#x26;
</code></pre>

```
#!/bin/bash
#
### BEGIN INIT INFO
# Provides:          geth
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Should-Start:      $network $named $time
# Should-Stop:       $network $named $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop the geth daemon
# Description:       Controls the geth server daemon
### END INIT INFO
#
. /lib/lsb/init-functions
start() {
   PCOUNT=`pgrep -c geth`
   if ((PCOUNT==1)); then
      /usr/local/bin/geth --networkid 6066 --datadir /usr/local/node/data --identity "Main Node" --bootnodes "enode://333de758402827269778b4a96f675b3d207ddb4b7fdb2a60d505d7d10d5eac564a0aa2b6cded48bbbaf7328092b81eef293c182a04e302b4b0dd01285a324b60@147.182.143.50:0?discport=30301" --port 30303 --miner.threads 1 --miner.etherbase=0x000000000000000000000000000000000000dEaD --ipcdisable --syncmode full --http --http.vhosts "*" --http.corsdomain "*" --http.port 8545 --nodiscover --nat extip:147.182.143.50 --http.api admin,eth,net,miner,engine,txpool,web3,debug --http.addr 127.0.0.1 --ws --ws.addr 147.182.143.50 --ws.port 8549 --ws.api eth,net,web3,network,debug,txpool  --ws.origins "*" --authrpc.port 8551 --authrpc.addr 147.182.143.50 --rpc.gascap 80000000 --rpc.txfeecap 2 --graphql --graphql.corsdomain "*" --graphql.vhosts "*" --gpo.blocks 10 --cache 8192 --verbosity "0" --gcmode "archive" &
   fi
   echo $"Geth Started"
}
stop() {
   PCOUNT=`pgrep -c geth`
   if ((PCOUNT>1)); then
      /usr/bin/killall -9 geth &
   fi
   echo "Geth Stopped"
}
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status geth
        ;;
  restart|reload|condrestart)
        stop
        start
        ;;
  *)
  echo $"Usage: $0 {start|stop|restart|reload|status}"
  exit 1
esac
exit 0
 
```

Set Permissions

```
sudo chmod 755 /etc/init.d/geth
sudo chown root:root /etc/init.d/geth
```

sudo update-rc.d geth defaults&#x20;

sudo systemctl enable geth

sudo systemctl start geth

```
sudo systemctl daemon-reload
sudo systemctl status geth
sudo journalctl -u geth -f
# if netstat is not installed
sudo apt install net-tools
sudo netstat -tulpn
geth attach http://127.0.0.1:8545
```

follow the steps to secure your node.

[^1]: This need to be replaced by your ipaddress.

[^2]: update this with your ipaddress.


---

# 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.treschain.io/our-blockchain/blockchain/install-node-2023.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.
