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.0or later installed - GoQuorum version
21.4.2or 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
isMPStotruein theconfigitem 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
enableMultiplePrivateStatestotruein the Tessera configuration file. The default isfalse.cautionGoQuorum can't start if
isMPSistruein the GoQuorum configuration andenableMultiplePrivateStatesisfalsein the Tessera configuration.GoQuorum runs as a non-MPS-enabled node if
isMPSisfalseandenableMultiplePrivateStatesistrue.Configure
residentGroupsin the Tessera configuration file.Run GoQuorum with the
--multitenancycommand line option.geth [OPTIONS] --multitenancy --plugins file:///<path>/<to>/plugins.jsonIn the command,
plugins.jsonis the plugin settings file that contains the JSON-RPC Security plugin definition.For example, if you use quorum-security-plugin-enterprise,
plugins.jsonlooks 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 OrganizationownsJ_K1andJ_K2, and its tenancy is onNode1.G OrganizationownsG_K1andG_K2, and its tenancy is onNode1.D OrganizationownsD_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 Investmenthas access toJtenancy using any self-managed Ethereum accounts.J Settlementhas access toJtenancy using node-managed Ethereum accountJ_ACC1and a self-managedWallet1.
G Organization:G Investmenthas access toGtenancy using any self-managed Ethereum accounts.G Settlementhas access toGtenancy using node-managed Ethereum accountG_ACC1and 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.