Running Multiple Nodes on the Same Server
It's possible to run multiple Secret Nodes on the same Secret-compatible server, and it is fairly easy to do so.
Important Notes
There are 2 important things that must be done for each node:
A unique system file is necessary for each node
A unique
sgx_secrets
path is necessary for each nodeAll Secret Nodes should have their own user to simplify
It's easiest to do this with
auto-register
, but it's possible manual as wellEach node must be registered
Setup
This process assumes you already have a full node running. If you do not, proceed by Setting Up a Full Node, then returning.
1. Create a User
This isn't necessary, but will help with keeping nodes organized. From here on, the assumption is the username is secret
, but it can be anything of your choosing.
2. Verify secretd Access
This will make it so you don't need to install secretd
multiple times, and therefore, can upgrade all nodes at the same time.
3. Begin Setting up a Node
On the new user, execute steps 1 and 2 of Setting Up a Full Node. You should now have a .secretd
directory on the new user, and the correct genesis file.
4. Register the Node
The variables SCRT_ENCLAVE_DIR
and SCRT_SGX_STORAGE
are going to need to be custom for each user/node. These variables are NOT the same as the ones in step 3 of setting up a full node.
5. Change Ports
In order for these nodes to work in tandem, they cannot use the same ports. I recommend this tool to help automate changing them.
Which will then create a command that looks like this:
6. Create Service File
Note that this service file has two environment variables that are set, as well as a --home
directory. These will be unique to your user.
7. Continue Setting Up a Full Node
From here, you can return to step 9 of setting up a full node. Note that the service file name is different. The following is what the system file commands would look like.
Last updated