-
Notifications
You must be signed in to change notification settings - Fork 267
Install RskJ Using Azure
Following the instructions below you will install and run a RSK node in Azure connected to RSK MainNet (by default). Then you can:
- On Azure, create a resource.
- Search for RSK, choose the node's version and click Create.
-
You will see 4 steps after deploying the node:
- Basics: complete this step with your information. Choose a name for the node, user name, password, subscription and resource group.
-
Size: select your VM options. Check recommended minimum requirements.
-
Settings: configure optional features.
-
Summary: review the summary of what you have set and press Create.
Wait for Azure to finish the deployment.
-
Initialize RSK node configuration file settings (you can do it while switching network).
- Get a
privateKey
with the GenNodeKeyId following this guide. - Connect your computer to the node using bash.
- Edit configuration file using
vi
:
sudo service rsk stop cd /etc/rsk sudo vi <NETWORK>.conf
Replace
<NETWORK>
with the network you are using. If you have not switched it, by default it is MainNet. Navigate topeer.privateKey
in the config file and pressi
to enable insert mode. Paste theprivateKey
you got running GenNodeKeyId. Then pressESC
to exit insertion and:wq
to write changes and quitvi
.- Restart RSK service:
sudo service rsk start
- Get a
That's all! You have your own node running on an Azure Service.
If you want to switch your node to MainNet, TestNet, or RegTest mode:
- For RegTest:
sudo service rsk stop
cd /etc/rsk
sudo rm -f node.conf
sudo ln -s regtest.conf node.conf
sudo service rsk start
- For TestNet:
sudo service rsk stop
cd /etc/rsk
sudo rm -f node.conf
sudo ln -s testnet.conf node.conf
sudo service rsk start
- For MainNet
sudo service rsk stop
cd /etc/rsk
sudo rm -f node.conf
sudo ln -s mainnet.conf node.conf
sudo service rsk start
Running these instructions in bash, you are:
- Stopping RSK service in Azure,
- Moving to RSK configuration folder (
cd
). - Removing
node.conf
, that is a symbolic link to the configuration you're using (rm
deletes it). - Linking
node.conf
with the configuration file you decide (ls
with the-s
option, it makes symbolic (or soft) links). The node is configured to read directly from thenode.conf
link. - Restarting the service.
- Enable 4444 port. That is the default RSK port for RPC calls.
Navigate to the virtual machine where you are runing RSK. Go to networking configuration.
Add an inbound port rule with the following options:
❗ Important: this is a basic configuration that enables any call. Any other options can be added. At least you must maintain the destination to 4444.
You should get something like this:
-
Edit configuration file
sudo service rsk stop
cd /etc/rsk
sudo vi <NETWORK>.conf
Replace <NETWORK>
with the network you are using. If you have not switched, by default it's MainNet.
Press i
to enable insert mode. Edit the following values:
rpc.address = "0.0.0.0"
-
rpc.host = ["AZURE_SERVICE_VM_IP"]
. You can also addlocalhost
and/or your node'sDNS
.
Then press ESC
to exit insertion and :wq
to write changes and quit vi
.
Restart RSK service.
sudo service rsk start
If needed, change
cors
value.
- Test your connection
curl -s -X POST -H "Content-Type:application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber", "params":[],"id":666}' http://<YOUR_IP>:4444
Should return something like:
{"jsonrpc":"2.0","id":666,"result":"0x70d03"}
In a terminal run:
ssh user@server
To get user and server navigate to RSK virtual machine and go to the Overview window. Open Connect option in the top left corner.
Copy and paste the text in Ḷogin using VM local account in the console
We hope our Troubleshooting section can help you!