We have a use case in which we have to deploy and start a node at runtime on button click from a web page. The same way as it working in CORDA's demo bench. Can someone please point out to an example or an explanation for achieving this?
Asked
Active
Viewed 695 times
1
-
i am facing a similar use case, can you give me some information on how you ended up achieving this? – fay Oct 19 '20 at 13:26
1 Answers
2
A node is essentially a folder containing two things:
- A
node.conf
file - A
corda.jar
file
There are other things it may need (certificates if not in dev mode) or want (corda-webserver
if you want it to offer an API, a plugins folder with CorDapps that you want it to load), but the two items above are sufficient.
When you run deployNodes
locally, it creates a set of node folders containing these things. "Running a node" is equivalent to running java -jar corda.jar
on a corda.jar
file in a folder where a valid node.conf
file is also present.
If you can collect the parameters for a valid node.conf
file via a front-end or auto-generate them, then all you need to do on the server is:
- Create a new folder
- Generate a
node.conf
file and save it to the folder - Copy a
corda.jar
file to that folder - Start a
corda.jar
process in that folder

Joel
- 22,762
- 5
- 26
- 41
-
Thanks for that explanation.. can you please point out an example of this?..does the demo bench implement it in the same way? – got2817 dev Oct 23 '17 at 05:21
-
Yes, DemoBench does something similar. You can see the source code here: https://github.com/corda/corda/tree/release-V1/tools/demobench. If you start a node in the DemoBench, it will show the location of the node's logs in the start-up window. If you go to this folder, you'll see that each node is simply a collection of the files described above, along with some other files. The only difference is that all nodes share a corda.jar, instead of having their own. – Joel Oct 23 '17 at 08:32