How to route messages between a Meteor dapp and a Fedora hosted API built on Laravel

191
April 04, 2019, at 7:50 PM

I'm trying to set up an API that will take Ethereum tx/message objects to authenticate. I've managed to build a provider for the dapp that can interact with web3 and the deployed blockchain. However, I'm unsure how to set up a Laravel API to route the data through there. It must get sent out to the API through the dapp, where the user would be authenticated to then sign the message.

Route::middleware('api')->get('/api/users', function (Request $request) {
    return \App\Users::all();
});

This is set up to return the list of users, presumably by their wallets. I don't know how to make post or get requests through Meteor, all I have is:

    $.ajax({
      type: "POST",
      url: '/session/storeValue',
      data: data,
      success: function() {
        console.log("Valueadded");
      }
    })

What I hope to achieve:

  //When the accounts function is called by the dapp
  getAccounts: function(callback){
    //Do something to get the user request
      callback(null, accounts) //Callback the accounts array
  },
  //When a message is to be signed
  signPersonalMessage: function (message, callback) {
    //Somehow send message data to API
    //Get the response back
      callback(null,signedData.toString('hex')) //Callback the response
  },
Rent Charter Buses Company
READ ALSO
how to fix inserting product id to wishlist_tbl [on hold]

how to fix inserting product id to wishlist_tbl [on hold]

i want to get product id to insert in wishlist_tbl

168
Display a text message if the field is not found and not if found

Display a text message if the field is not found and not if found

I try to display a message like" Sorry no information here" if a field is not found and if field is found, no message appearI use the ACF plugin for displaying field on front end in a user profil

158
How to get the correct id after INNER JOINING two tables which both have an id

How to get the correct id after INNER JOINING two tables which both have an id

I am developing a movies app and have a small issues that I need help to resolve

148
How to fetch data from a table from php myadmin in php page

How to fetch data from a table from php myadmin in php page

I'm setting up one table in my page where it will show all data from phpmy admin but its only showing first row or sometimes 0 what is way to call selected table in pagei'm new in php

179