Iām having problems with the self hosted parse server. Iāve installed the following onto my server as follows via ssh:
yarn add parse-server --ignore-engines
yarn dev:db-start
yarn start
cd /var/www/html/DnA/parse-server-migration
yarn build
yarn start
yarn dev:db-start
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl start mongod
yarn add parse-dashboard --ignore-engines
yarn add moralis --ignore-engines
Then When I start this happens:
yarn start -- --appId *********************************** --masterKey ************************************ --serverURL https://127.0.0.1:1337/server
yarn run v1.22.19
warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.
$ node build/index.js --appId pRLSWTZ8RUMngGVmgWmI8IzaUXFgUsX8Z1wZ6leJ --masterKey iDIgWXWAXK49KOIuKexjmwQzofjYyUeEj33s72K5we7GpNCDeUKNakNfCbgkDEqO --serverURL https://127.0.0.1:1337/server
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
warn: DeprecationWarning: The Parse Server option 'directAccess' default will change to 'true' in a future version. Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one.
warn: DeprecationWarning: The Parse Server option 'enforcePrivateUsers' default will change to 'true' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
info: Parse LiveQuery Server started running
Moralis Server is running on port 1337 and stream webhook url https://d59f-167-71-97-138.ngrok.io/streams-webhook
MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
at Timeout._onTimeout (/var/www/html/DnA/parse-server-migration/node_modules/mongodb/lib/sdam/topology.js:291:38)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7) {
reason: TopologyDescription {
type: 'Unknown',
servers: Map(1) { 'localhost:27017' => [ServerDescription] },
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {}
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
My Unity code that Iām running with MoralisWeb3ApiSdk (the old-school one yes), AppManager.cs contains only the slight changes you guys said to make:
public async void WalletConnectHandler(WCSessionData data)
{
Debug.Log("Wallet connection received");
// Extract wallet address from the Wallet Connect Session data object.
address = data.accounts[0].ToLower();
string appId = MoralisInterface.GetClient().ApplicationId;
long serverTime = 0;
// Retrieve server time from Moralis Server for message signature
Dictionary<string, object> serverTimeResponse = await MoralisInterface.GetClient().Cloud.RunAsync<Dictionary<string, object>>("getServerTime", new Dictionary<string, object>());
//if (serverTimeResponse == null || !serverTimeResponse.ContainsKey("dateTime") ||
// !long.TryParse(serverTimeResponse["dateTime"].ToString(), out serverTime))
//{
// Debug.Log("Failed to retrieve server time from Moralis Server!");
//}
if (serverTimeResponse != null)
{
Debug.LogError("Failed to retrieve server time from Moralis Server!");
}
if (!MoralisInterface.IsLoggedIn())
{
Debug.Log($"Sending sign request for {address} ...");
IDictionary<string, object> requestMessageParams = new Dictionary<string, object>();
requestMessageParams.Add("address", address);
requestMessageParams.Add("chain", "Eth");
requestMessageParams.Add("network", "evm");
Dictionary<string, object> authMessage = await MoralisInterface.GetClient().Cloud.RunAsync<Dictionary<string, object>>("requestMessage", requestMessageParams);
string signMessage = authMessage["message"].ToString();
//string signMessage = $"Moralis Authentication\n\nId: {appId}:{serverTime}";
string response = await walletConnect.Session.EthPersonalSign(address, signMessage);
Debug.Log(response);
Debug.Log($"Signature {response} for {address} was returned.");
// Create moralis auth data from message signing response.
Dictionary<string, object> authData = new Dictionary<string, object> { { "id", address }, { "signature", response }, { "data", signMessage } };
Debug.Log("Logging in user.");
// Attempt to login user.
var user = await MoralisInterface.LogInAsync(authData);
if (user != null)
{
Debug.Log($"{address} logged in successfully. ");
infoLabel.text = $"{address}\nlogged in successfully!";
}
else
{
Debug.Log("User login failed.");
infoLabel.text = "Login failed";
}
}
UserLoggedInHandler();
}
public void WalletConnectSessionEstablished(WalletConnectUnitySession session)
{
InitializeWeb3();
}
private void InitializeWeb3()
{
MoralisInterface.SetupWeb3();
}
#endregion
Even with those above changes I donāt see how the null value is dealt with but hopefully you can enlighten me.
And Iāll include Screenshots of the WebGL running online, dev build along with errors:
Now, Iām REALLY hoping someone can help me, as Iāve really put A LOT of time into this, and the way the Crypto world is going, Iām about ready to jump out a window (or just drop everything and opt for Facebook/Meta login for everything
) But yeah seriously, PLEASE HELP!!!
I am able to scan the QR, my wallet sees and signs it (metamask), the browser recognizes this and says āPlease Signā¦ā so itās NEARLY THERE!!! But then, crash, Cross-Origin blah blah Errorā¦
Dave Cote