Self-hosting your Moralis server

I know we have to manually fix the typescript errors. Switching to Moralis V2 will generate more issues for us.

In Moralis document, it says that:

“Note that with the current implementation the generated cloud functions might show you some Typescript errors. This can happen when we make updates to the api that are not reflected yet in the NodeJs SDK. These can be ignored or fixed manually, please let us know when this happens. We are working on a better experience to keep these definitions in sync.”

Do you think switching to Moralis V2 will reduce number of typescript errors?

moralis v2 is written in typescript from what I know, I don’t know if it will not create other issues for you

Thank you,

It’s all sorted out now. I had to include the snippet below in my package.json, though the main issue was from an incorrectly set environment variable.

  "engines": {
    "node": "16.16.0",
    "npm": "8.11.0",
    "yarn": "1.22.19"
  }
1 Like

Can someone please let me know how to find the values for these two:

const MONGO_HOST = ‘xx’;
const MONGO_PORT = ‘xx’;

In what context? You have a mongo db database or you want to connect to the database of your Moralis server?

MONGO_HOST = ‘xx’
MONGO_PORT = ‘xx’
I want these two values as shown in the pic below

https://v1docs.moralis.io/moralis-dapp/database/direct_access

I still don’t understand where to find, it would really be kind if you share a screenshot that shows where to find those values

in admin interface for your server, the there is a tab specific to database where you can find those values

I am totally new here and I was following the video on how to make a server, and I have absolutely no idea what is happening where and so I am unable to understand where is the server or where to find. It would be helpful with the screenshot please

Please help me @cryptokid

Do you have a server now?

There isn’t an option for server here

you can skip that step in this case, that step was used in case that you wanted to transfer some data from an existing server to your self hosted server

This helped me - thanks so much.

I’m trying to use MongoDB Compass to connect to the DB on Moralis Server. ( it was successful few months ago). I have checked the whitelist IP, and try to use account/password authen.

Howerver, I cannot connect. It says “connection to… is closed”. What should I do?

What is your Moralis server URL? If you haven’t changed your server whitelisted IPs, your public IP address may have changed, you can search “whats my ip” in any search engine to check.

Your Compass URI should be in the format of:

mongodb://ipaddress:portnumber

You don’t need an account/password.

This is my Moralis URL: https://atl5nkrrpg3m.usemoralis.com:2053/server

Yes, I have checked my IP address and added it to the white list

that list of IPs it looks like it was updated last time ~5 days ago

did you update something more recently?

Indeed, I added but didn’t click “Save Config”. Silly me :slight_smile: Thanks guys

1 Like