These are preliminary instructions with limited testing. It is possible that some instructions are incomplete for some platforms. Please let us know via Discord if you encounter any issues and we will endeavor to both assist you with your installation and update these instructions.
This guide will install a metaverse map service on your Windows machine.
git clone --recurse-submodules https://github.com/MetaversalCorp/MSF_Map_Svc.git
cd MSF_Map_Svc
npm install
Execute the following:
npm run build:win:mysql
Execute the following:
npm run build:win:mssql
We can now create your metaverse map service.
cd dist
npm install
At this point, your metaverse map service needs to support HTTPS. To configure an SSL certificate, you need a public, trusted SSL certificate. You can either create one or use an existing SSL Certificate.
This example uses win-acme with Let’s Encrypt.
C:\win-acme
win-acme folder:renew.ps1
renew.ps1:$serviceName = "MSF_Map_Svc"
Write-Output "Restarting service: $serviceName"
if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) {
Restart-Service -Name $serviceName -Force
Write-Output "Service restarted successfully."
} else {
Write-Output "Service not found: $serviceName"
exit 1
}
wacs.exe
[http] Serve verification files from memory
If option 2 is not available, Command Prompt was not started as Administrator.
C:\MSF_Map_Svc\dist\ssl
renew.ps1
Selecting No will use the SYSTEM account.
"MVSF": {
// ... other values
"LAN": {
// ... other values
"port": "<LAN_PORT>",
"SSL": {
"bUseSSL": true,
"key": "key.pem",
"cert": "cert.pem"
}
}
}
"MVSF": {
// ... other values
"WAN": {
// ... other values
"host": "mydomain.com",
"port": "<WAN_PORT>"
}
}
"MVSF": {
// ... other values
"key": "<Select your own secure password>",
"sCompanyId": "<Your RP1 CompanyId from the RP1 dev portal https://dev.rp1.com>"
}
Set the database connection properties:
"SQL": {
// ... other values
"config": {
// ... other values
"host": "sql.mydomain.com"
"port": "3306"
"user": "username"
"password": "password"
"database": "my_database_name"
}
}
Set the database installation properties:
"SQL": {
// ... other values
"install": {
// ... other values
"db_name": "<my_database_name>",
"login_name": "domain\\username", // Specifies the name of the login to grant execute rights
"pathname": "C:\\db" // Make sure you use double backslash
}
// ... other values
"config": {
// ... other values
"connectionString": "Driver=SQL Server;Server=sql.mydomain.com;Database=my_database_name;Trusted_Connection=Yes;",
"_alt_connectionString": "Driver=SQL Server;Server=la2-ntweb0.mv.local;Database=map_db;User Id=map_user;Password={PW};"
}
}
}
Your map service must have a login preconfigured on SQL Server before continuing.
If you haven't already configured a login on SQL Server, you can create one using one of these methods:CREATE LOGIN [{Login_Name}] WITH PASSWORD = '{Login_Password}' CREATE LOGIN [{Login_Name}] FROM WINDOWSWhen you're creating logins that are mapped from a Windows domain account, you must use the logon name in the format
<domainName>\\<login_name>.For more information on creating logins:
https://learn.microsoft.com/en-us/sql/t-sql/statements/create-login-transact-sql?view=sql-server-ver17
You are done configuring your settings. You can save and close your editor.
This will install the server files.
npm run install:svc
This will install the sample scene and media files associated with it.
npm run install:sample
You should have a proper installation and configuration of your server. You can test it by running the following command:
npm run dev
If you get the following output, your server is ready to go.
SQL Server READY
Server running on port 2000
You have completed the installation of your server into the dist folder. You can now rename/move the dist folder to your desired location.
You will most likely want to install your server as a Windows Service.
npm install node-windows
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service ({
name: 'Metaverse Map Service',
description: 'Provides capabilities for reading and editing metaverse spatial fabrics.',
script: '.\\server.js'
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on ('install',function() {
svc.start();
});
svc.install ();
node service.js
Find the service in the Windows Services Manager and set the Log On As appropriately.
If you want to remove the service, follow these instructions:
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service ({
name: 'Metaverse Map Service',
description: 'Provides capabilities for reading and editing metaverse spatial fabrics.',
script: '.\\server.js'
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on ('uninstall',function() {
console.log('Uninstall complete.');
console.log('The service exists: ',svc.exists);
});
svc.install ();
npm service-uninstall.js
If you've already delete the files just run
sc delete mvs_rp1_map.exe
And reboot