Self-hosting your Moralis server

Thanks for reply. for now we have lot’s of user in our DB include other infos (like avatar img). If we use auth/sign-message, the current user got a new object not origin one(the avatar image is not in this userId). we want change all front-end device(web and mobile) to call auth/sign-message api. not use react-moralis package authenticate method.

you mean that you have some users saved in the database from the past and you migrated them to current database from an old moralis server database?

yes, we want to migrate old database to our database and host parse server

did you already do that migration?
does that _auth_data_moralisEth come from that migration?

in that case, can you change it to _auth_data_moralis in that migration?

we just migrate out test sever and found that issues. I tried to change authData from dashboard, but I think it got error.
and moralisEth is from old database

yes, you can not change it from the dashboard interface, it will try to validate the data at that time and it will fail because the signature was generated long time ago

you could try to connect directly to mongo db and change it that way

or you could look in the pase server code and change that string there to make it work with moralisEth instead of moralis

not sure how to work when I change moralis to moralisEth ?
I got some error when I post a new user.

// Authenticate
  const user = await serverRequest.post<ParseUser>({
    endpoint: `/users`,
    params: {
      authData: {
        moralisEth: authData,
      },
    },
    useMasterKey: true,
  });

the error :
error MoralisError [Moralis SDK Core Error]: [C0006] Request failed, Bad Request(400): message must be present, message must contain only ASCII characters
also I found the authData is undefined when backend post a new user.

here is may repo : https://github.com/AdemKao/moralisv2-migrate-demo

not in frontend, in backend you can look where that moraliEth and moralis is used

I think the error is from backend, the verifyMessage function in authService.ts

don’t try to change the front end code, only in backend you could try to change that constant string name from moraliEth to moralis

from moralisEth to moralis? not from moralis to moralisEth?
but react-moralis package is use moralisEth to auth I think.

I don’t think that it matters what is in front end, I’m not sure now what to what you should change, you could try both options to see if one of them works for you

if none of them works then you can connect directly to mongo db and change there the data that was imported to match the new format

Hi,@cryptokid. Thanks for reply.
I migrate successfully today. user could logIn in same objectId using both ‘react-moralis autenticate function’ and ‘signMessage api’ .
I think signMessage api’ backend need to change authData’s Id to wallet address.
Thanks.

1 Like

Hi, due to some personal issues I am resuming work on this now. The code backup is available in the github repo (so cloud code is available there). Could you please elaborate on the “settings” that you are referring? The data in the tables is dummy so I don’t need it. Thank you so much.

for example if you had any other settings set, like sendgrid template, and if you had cloud code

1 Like

Hi, I was able to create a self host local server and connect my client app to it but the authentication is not working. I created my project using ethereum-boilerplate from earlier this year. Could you please guide where and what needs to be changed. Thank you.

you can take a look at these examples about how authentication can be done with auth api on a self hosted parse server:

1 Like

Hi Team, in the video tutorial for Heroku there was no payment method but now they seem to ask for it to create the app. Is this something they have changed?
Also, could you please provide reference tutorial/guides for below:
a. deploy/undeploy dApp on the self host server
b. creating jobs in cloud function and scheduling them

Thank you so much for all the help

Heroku has now removed their free tier. You can try another provider that offers free limits or allowance to get started, check out this page if you haven’t.

What do you mean by this? You can host your frontend with a provider like Netlify or Vercel.

There is a page for cloud code here. If you set up parse-dashboard, you can try scheduling jobs from that interface.

Thank you for responding to each question.

I followed the steps creating the dashboard but getting below error, could you please help.

error: undefined {“address”:"::",“code”:“EADDRINUSE”,“errno”:-4091,“port”:1337,“syscall”:“listen”}