Skip to content

Instantly share code, notes, and snippets.

@yamada-guro-baru
Last active December 27, 2020 16:49
Show Gist options
  • Save yamada-guro-baru/e26d33a8e61926a9d2ec7cdde059f59c to your computer and use it in GitHub Desktop.
Save yamada-guro-baru/e26d33a8e61926a9d2ec7cdde059f59c to your computer and use it in GitHub Desktop.
$ cd ~
$ wget https://github.com/monacoinproject/monacoin/releases/download/monacoin-0.17.1/monacoin-0.17.1-x86_64-linux-gnu.tar.gz
$ tar -zxvf monacoin-0.17.1-x86_64-linux-gnu.tar.gz
$ sudo cp monacoin-0.17.1/bin/monacoind /usr/bin/
$ sudo cp monacoin-0.17.1/bin/monacoin-cli /usr/bin/
$ mkdir .monacoin
$ vi .monacoin/monacoin.conf
=====monacoin.conf=====
server=1
txindex=0
cookie="rpcuser:rpcpass"
=====monacoin.conf=====
$ monacoind -daemon
$ sudo apt install git clang cmake cargo curl
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ source ~/.cargo/env
$ git clone https://github.com/romanz/electrs.git
$ cd electrs
$ cargo build --release
$ mkdir ~/electrs_data
cargo run --release -- -vvv --timestamp --network mainnet --jsonrpc-import --daemon-dir /home/<yourhomedirectory>/.monacoin --daemon-rpc-addr ::1:9402 --db-dir /home/<yourhomedirectory>/electrs_data
Ctrl+c
$ sudo vi /etc/systemd/system/electrs.service
=====electrs.service=====
[Unit]
Description=Electrs
[Service]
WorkingDirectory=/home/<yourhomedirectory>/electrs
ExecStart=/home/<yourhomedirectory>/electrs/target/release/electrs --jsonrpc-import --daemon-dir /home/<yourhomedirectory>/.monacoin --daemon-rpc-addr ::1:9402 --db-dir /home/<yourhomedirectory>/electrs_data
User=<yourhomedirectory>
Type=simple
KillMode=process
TimeoutSec=60
Restart=always
RestartSec=60
[Install]
WantedBy=multi-user.target
=====electrs.service=====
$ sudo systemctl daemon-reload
$ sudo systemctl start electrs
# If you want to use SSL, see it.
https://github.com/romanz/electrs/blob/master/doc/usage.md#ssl-connection
# and attach option ``--electrum-rpc-addr "0.0.0.0:50001"``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment