Using multi-tenancy via multiple private states
Use multi-tenancy via multiple private states (MPS) to allow multiple tenants to use the same GoQuorum node, with each tenant having its own private state(s).
Configure multi-tenancy via multiple private states
Prerequisites
- Tessera version
21.4.0
or later installed - GoQuorum version
21.4.2
or later installed
If running an earlier GoQuorum or Tessera version, upgrade your existing nodes to enable MPS and multi-tenancy using the migration guide.
Steps
Set
isMPS
totrue
in theconfig
item of the GoQuorum genesis file.MPS configuration{
"config": {
...
"isMPS": true
},
...
}noteThere can be a mix of MPS-enabled and non-MPS-enabled nodes in a network.
Configure the JSON-RPC security plugin. This requires configuring an authorization server. View examples of configuring the plugin to work with different OAuth2 authorization servers.
Set
enableMultiplePrivateStates
totrue
in the Tessera configuration file. The default isfalse
.cautionGoQuorum can't start if
isMPS
istrue
in the GoQuorum configuration andenableMultiplePrivateStates
isfalse
in the Tessera configuration.GoQuorum runs as a non-MPS-enabled node if
isMPS
isfalse
andenableMultiplePrivateStates
istrue
.Configure
residentGroups
in the Tessera configuration file.Run GoQuorum with the
--multitenancy
command line option.geth [OPTIONS] --multitenancy --plugins file:///<path>/<to>/plugins.json
In the command,
plugins.json
is the plugin settings file that contains the JSON-RPC Security plugin definition.For example, if you use quorum-security-plugin-enterprise,
plugins.json
looks like the following:plugins.json{
"providers": {
"security": {
"name": "quorum-security-plugin-enterprise",
"version": "0.1.1",
"config": "/path/to/config.json"
}
}
}
Configure custom scopes
A network operator must configure scope values for each user in an authorization server, for each tenant.
Example
This example network contains four nodes. Multi-tenant Node1
is shared between tenant J
and G
(isMPS=true
) and single-tenant Node2
is used by tenant D
alone (isMPS=false
).
A node consists of a GoQuorum client and Tessera private transaction manager. We name privacy manager key pairs for easy referencing, for example: J_K1
or G_K1
. In reality, their values are the pubic keys used in the privateFor
and privateFrom
fields.
Tenants are assigned to multi-tenant nodes as follows:
J Organization
ownsJ_K1
andJ_K2
, and its tenancy is onNode1
.G Organization
ownsG_K1
andG_K2
, and its tenancy is onNode1
.D Organization
ownsD_K1
, and its tenancy is onNode2
.
In practice, J Organization
and G Organization
may decide to allocate keys to their departments, therefore the security model may be as follows:
J Organization
:J Investment
has access toJ
tenancy using any self-managed Ethereum accounts.J Settlement
has access toJ
tenancy using node-managed Ethereum accountJ_ACC1
and a self-managedWallet1
.
G Organization
:G Investment
has access toG
tenancy using any self-managed Ethereum accounts.G Settlement
has access toG
tenancy using node-managed Ethereum accountG_ACC1
and self-managedWallet2
.
Each authorization server has its own configuration steps and client onboarding process. A network operator's responsibility is to implement this security model in the authorization server by defining custom scopes and granting them to target clients.
A custom scope representing J Investment
is:
psi://J?self.eoa=0x0
A custom scope representing G Settlement
is:
psi://G?node.eoa=G_ACC1&self.eoa=Wallet2
Clients must also be granted scopes which specify access to the JSON-RPC APIs:
rpc://eth_*
Refer to the JSON-RPC security plugin documentation for more information.
Add a new tenant to multi-tenant node
Use the following steps to add a new tenant to a multi-tenant node:
The network administrator executes Tessera keygen to generate a new key.
Update the Tessera configuration file to include the new key in a resident group.
Restart Tessera to load the new key. Startup fails if the new key is generated but not added to a resident group.
Make updates to the authorization server to provide the new tenant access to the private state defined in the resident groups configuration.
API methods
Use the eth_getMPS
JSON-RPC API method to get the private state the user is operating on.