You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
955 B
Bash

2 years ago
#!/bin/sh
export RPC_CREDS="${2}"
export DAEMON_ADDRESS="${3}"
export WALLET_FILE=/data/wallet
2 years ago
# Define the network we plan to operate our wallet in
if [[ "${1}" == "stagenet" ]]; then
export NETWORK=--stagenet
export PORT=38081
elif [[ "${1}" == "testnet" ]]; then
export NETWORK=--testnet
export PORT=28081
else
export NETWORK=
export PORT=18089
fi
# Create new wallet if it doesn't exist
if [[ ! -d ${WALLET_FILE} ]]; then
2 years ago
monero-wallet-cli ${NETWORK} \
--generate-new-wallet ${WALLET_FILE} \
2 years ago
--daemon-address ${DAEMON_ADDRESS} \
--trusted-daemon \
--use-english-language-names \
--mnemonic-language English
fi
# Run RPC wallet
monero-wallet-rpc ${NETWORK} \
--daemon-address ${DAEMON_ADDRESS} \
--wallet-file ${WALLET_FILE} \
2 years ago
--password "" \
--rpc-login ${RPC_CREDS} \
--rpc-bind-port 8000 \
--rpc-bind-ip 0.0.0.0 \
--confirm-external-bind \
--log-file ${WALLET_FILE}-rpc.log \
2 years ago
--trusted-daemon