Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$ 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/wakiyamap/electrs.git
$ cd electrs
$ cargo build --release
$ mkdir ~/electrs_data
$ 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"``
$ vi /etc/nginx/nginx.conf
stream {
upstream electrs {
server 127.0.0.1:50001;
}
server {
listen 50002 ssl;
proxy_pass electrs;
ssl_certificate /path/to/example.crt;
ssl_certificate_key /path/to/example.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 4h;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment