Reputation: 35
can someone help me when it comes in deploying a rest server, because when I added or edit my participants and assets on my business model and I use composer create archive -t dir -n . and deploy it with composer-rest-server my http://localhost:3000/explorer does not update the things i change in my business model it is still the same as before I make change of it. thank you for those who will can help me..
Upvotes: 2
Views: 800
Reputation: 6335
this doc explains how to update a network definition with a new bna and it shows you how to change the version number:
https://hyperledger.github.io/composer/latest/business-network/upgrading-bna
Your problem is the version number which you more than likely left unchanged.
Once you manage to update your network definition don't forget to regenerate the REST service.
Your Rest service probably runs on the default port 3000. Kill the process using something like :
sudo kill $(sudo lsof -t -i:3000)
where 3000 is the port number it runs on, then run the composer-rest-server command again. It will see the new definition and it will recreate the endpoints correctly.
You can update your network definition using the playground if you prefer as well, you can upload your bna that way and update it using the UI which makes it easier, if you run a development setup.
Upvotes: 2
Reputation: 5570
When you start the Composer Rest Server you see the first thing it does is to "Discover" the network and build the endpoints. It does this only when you start the rest server. So if you change your model and upgrade the network you will need to stop the rest server and start it again for it to do a new discovery and build the new endpoints. (Also need to refresh the page in the Browser if you are using the Explorer through a browser window.)
Upvotes: 1
Reputation: 11
Any time you change your model or .js
files, remember to go into your package.json
and update the version number. Then deploy the new .bna
file. (This file will have the new version number.)
Upvotes: 1
Reputation: 21
you have to install the network again after updating your BNA file.
follow these steps:-
1) install the network again
2) start the network
3) ping the network with your card
then start the composer rest server
Upvotes: 0