Web of Needs Bot Skeleton
December 12, 2019 ยท View on GitHub
This skeleton contains a bot that creates a Service Atom that one can connect to. For each atom that has been created on the configured node(s), the bot sends a message with the atomUri of the created Atom to everyone that is connected to the Service Atom.
The Bot Skeleton is a Spring Boot Application.
Running the bot
Prerequisites
- Openjdk 8 - the method described here does not work with the Oracle 8 JDK!
- Maven framework set up
- Use this repository as a template (green button in github GUI), fork it, or clone it.
On the command line
cd bot-skeleton
export WON_NODE_URI="https://hackathonnode.matchat.org/won"
mvn clean package
java -jar target/bot.jar
Now go to What's new to find your bot, connect and create an atom to see the bot in action.
In Intellij Idea
- Create a run configuration for the class
won.bot.skeleton.SkeletonBotApp - Add the environment variables
WON_NODE_URIpointing to your node uri (e.g.https://hackathonnode.matchat.org/wonwithout quotes)
to your run configuration.
- Run your configuration
If you get a message indicating your keysize is restricted on startup (JCE unlimited strength encryption policy is not enabled, WoN applications will not work. Please consult the setup guide.), refer to Enabling Unlimited Strength Jurisdiction Policy to increase the allowed key size.
Optional Parameters for both Run Configurations:
WON_KEYSTORE_DIRpath to folder wherebot-keys.jksandowner-trusted-certs.jksare stored (needs write access and folder must exist)
Start coding
Once the skeleton bot is running, you can use it as a base for implementing your own application.
- Add/edit config files in
src/main/resources - Follow the Mini HowTos.
For an introduction to the Web of Needs Bot framework, have a look at the Bot Readme.