> For the complete documentation index, see [llms.txt](https://docs.meycoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meycoin.com/platform/meycoin-server.md).

# MeyCoin Server

## Using Docker

The easiest way to run a local MeyCoin server is using Docker. An up-to-date Docker image is always available on Docker Hub.

```
$ docker run -p 7845:7845 meycoin/node
```

You can pass arguments to the server like this:

```bash
$ docker run -p 7845:7845 meycoin/node meycoinsvr --testmode
```

To supply your own config file, use:

```bash
$ docker run -p 7845:7845 -v $(pwd)/config.toml:/meycoin/config.toml meycoin/node meycoinsvr --config /meycoin/config.toml
```

## Building from source

*Prerequisites*

* Go1.12.5+ - <https://golang.org/dl>
* CMake 3.0.0 or higher - <https://cmake.org>
* Optional: Protobuffer - <https://github.com/google/protobuf>

### Linux

1.Install dependencies

```bash
sudo apt update
sudo apt upgrade

sudo apt install build-essential libssl-dev m4 -y
```

2.Install CMake

```bash
wget https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3.tar.gz
tar -zxvf cmake-3.17.3.tar.gz
cd cmake-3.17.3
sudo ./bootstrap
sudo make
sudo make install
cmake --version
```

3.Install Go

```bash
wget https://golang.org/dl/go1.15.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.15.linux-amd64.tar.gz

nano ~/.profile

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GOPATH}/src/github.com/meeypioneer/meycoin/libtool/lib

source ~/.profile
```

4.Install MeyCoin Server

```bash
go get -d github.com/meeypioneer/meycoin
cd ${GOPATH}/src/github.com/meeypioneer/meycoin
git submodule init && git submodule update
make
```

### MacOS

1.If you haven’t already, install [homebrew](https://brew.sh/).

2.Install dependencies

```bash
brew install go
brew install cmake  # optional
brew install protobuf  # optional

nano ~/.zshrc

export GOPATH=$HOME/go
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"

source ~/.zshrc
```

3.Set environment

```bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GOPATH}/src/github.com/meeypioneer/meycoin/libtool/lib
```

4.Install MeyCoin Server

```bash
go get -d github.com/meeypioneer/meycoin
cd ${GOPATH}/src/github.com/meeypioneer/meycoin
git submodule init && git submodule update
make
```

## Run Server

```bash
./bin/meycoinsvr
```
