-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworker-install.sh
68 lines (50 loc) · 2.08 KB
/
worker-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Install Geth
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
# Create systemd unit file for Geth
echo "[Unit]
Description=Ethereum go client
[Service]
Type=simple
ExecStart=/usr/bin/geth --goerli --syncmode light
[Install]
WantedBy=default.target" > geth.service
sudo mv geth.service /etc/systemd/system/
sudo systemctl enable geth.service
sudo systemctl start geth.service
echo "You can view the Geth output by running: journalctl -u geth.service -f"
echo "Please enter a password for your new Ethereum account:"
sudo geth attach ipc:///root/.ethereum/goerli/geth.ipc --exec "personal.newAccount(); console.log(eth.accounts[0]);"
echo "Fund this account with Görli testnet ETH: https://goerli-faucet.slock.it/"
# Install Nucypher dependencies
sudo apt-get install libffi-dev
sudo apt-get install python3-dev
sudo apt-get install python3-virtualenv
sudo apt install python3-pip
pip3 install virtualenv
# NOTE: may need to restart session here, then run:
# source /opt/nucypher/nucypher-venv/bin/activate
sudo mkdir /opt/nucypher
# Create virtual environment
sudo /home/ubuntu/.local/bin/virtualenv /opt/nucypher/nucypher-venv
source /opt/nucypher/nucypher-venv/bin/activate
# Install nucypher while inside virtual environment
sudo pip3 install -U nucypher
# Initialize Ursula
sudo nucypher ursula init --provider ipc:///root/.ethereum/goerli/geth.ipc --poa --staker-address 0x87c0915e34e89628d33ce98588a400c1c0fa4f41
# Setup systemd service to run Ursula
echo "[Unit]
Description=\"Run 'Ursula', a NuCypher Staking Node.\"
[Service]
User=root
Type=simple
Environment=\"NUCYPHER_KEYRING_PASSWORD=<KEYRING-PASSWORD>\"
Environment=\"NUCYPHER_WORKER_ETH_PASSWORD=<GETH-ETH-PASSWORD>\"
ExecStart=/usr/local/bin/nucypher ursula run --teacher discover.nucypher.network:9151 --config-file /home/ubuntu/.local/share/nucypher/ursula.json
[Install]
WantedBy=multi-user.target" > ursula.service
sudo mv ursula.service /etc/systemd/system/
sudo systemctl enable ursula.service
sudo systemctl start ursula.service