git cloneyarn install && yarn watch:hot- open browser and access:
http://localhost:3000/laksa/isConnected - or you can
curlin your bash command
$bash curl http://localhost:3000/laksa/isConnected
true#if return ture, your local node server is connected to Zilliqaor like this
$bash curl curl http://localhost:3000/laksa/getBalance\?address\=9bfec715a6bd658fcb62b0f8cc9bfa2ade71434a
{"balance":0,"nonce":0} # return the balance of requested addressThere are 2 places you need to edit.
/src/services/restful/laksa.js/src/router/restful.js
If you are familiar with laksa, you can see laksa.js is pretty simple
exportconstisConnected=async()=>{constresult=awaitlaksa.isConnected()returnresult}exportconstgetBalance=asyncreq=>{const{ query }=reqconstresult=awaitlaksa.zil.getBalance({address: query.address})returnresult}// try to add thisexportconstgetNetworkId=async()=>{constresult=awaitlaksa.zil.getNetworkId()returnresult}Then , in the resful.js
constrouterTable=[{method: 'get',name: '/isConnected',exec: laksa.isConnected},{method: 'get',name: '/getBalance',exec: laksa.getBalance},// add this{method: 'get',name: '/getNetworkId',exec: laksa.getNetworkId}]Save both files, and the server will build rebuild itself
then you can see if the restful API works:
$bash curl http://localhost:3000/laksa/getNetworkId
TestNet # if the api works, it will return the result