Ethereum Unity3D Boilerplate Questions

I do note receive the same error. Please double check the fields in your MoralisSetup Controller. Look to see that both Server Uri and RPC Node Uri are set from the values on your Moralis Server.
**

**

If this values are set, does the same error happen if you run it in the IDE? If so please copy the text of the exception and post it.

Regards,

David

TQ, missing the Rpc node, all working now

1 Like

where do I find this Rpc Node URI? I have Server URL and AppID, but where is this from?

1 Like

In the Admin Panel of you Moralis Server click on Speedy Nodes:

Then click on the “Endpoints” button of the target chain. Choose the URI of the endpoint you want to send Web3 requests to.

Regards,

David

Okay I understand this is not a change to any of the core features, just an update to the Examples.

ERROR - ethereum-unity-boilerplate - WEBGL: Websocket.instance.ws.onopen

Hello we are getting an error when we try to test the current sample

Invoking error handler due to

ReferenceError: Runtime is not defined
at WebSocket.instance.ws.onopen (https://d147qom55yq2an.cloudfront.net/Build/Build2022.framework.js.br:3:58138)

PD: I have not made any changes to the code, I just put the parameters of my moralis server and compiled the game.

We are using

2 Likes

Unity version: 2021.2.4f1
Build platform: WebGL

versions

1 Like

Rest of Details for this issue

1 Like

Thank you for letting me know. Looks like a few people are seeing the same with that Unity version.

On the github repo Issue #48 has been opened to track this.

What is the Unity Version who you is using?

1 Like

2020.3.26.

The issue with 2021.x.x appears to be related to the jslib that WalletConnect is using. I have been trying some adjustments to see if I can fix it. I just do not want to break it for the current Unity version.

Hi !
I’m on v1.0.5 and unity 2020.3.23
This is my WalletConnectHandler method (having changed anything):

public async void WalletConnectHandler(WCSessionData data)
    {
        Debug.Log("Wallet connection received");
        // Extract wallet address from the Wallet Connect Session data object.
        string 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!");
        }

        Debug.Log($"Sending sign request for {address} ...");

        string signMessage = $"Moralis Authentication\n\nId: {appId}:{serverTime}";
        string response = await walletConnect.Session.EthPersonalSign(address, signMessage);

        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.
        MoralisUser user = await MoralisInterface.LogInAsync(authData);

        if (user != null)
        {
            Debug.Log($"User {user.username} logged in successfully. ");
        }
        else
        {
            Debug.Log("User login failed.");
        }

        HideWalletSelection();
    }

here is the full log screenshot :

1 Like

After you do a login in attempt are there any errors in the Log on your Moralis server?

This is a part of the error log on the server side

okay - what is the version of you moralis server in admin panel?

I think is 0.0.345.

weird, that is latest …
The cloud function is working, I just did a login

Try restarting your Moralis server.

Just tried and it doesnt change anything, still getting the same error.

1 Like

Okay. I cannot reproduce.

Please grab a TEXT copy of the server error from this morning. I will send it to someone on the server team.

okay…

This is the error log since i restarted the server, if that’s of any help

1 Like