Sign inSign up

internetofus/interaction-protocol-engine

By internetofus

•Updated over 3 years ago

The component to guarante that interactions between WeNet users follow the norms.

Image
0

2.3K

internetofus/interaction-protocol-engine repository overview

⁠Interaction protocol engine

⁠Introduction

The interaction protocol engine component is the one responsible for guaranteeing interactions between WeNet users to follow the norms.

The interaction between users is modelled as an exchange of messages. When a user sends a message through the API, the message is sent to the norm interpreter of the user. This interpreter needs to first verify that the message does not violate any of the norms, this includes the community norms, the task norms, the sender’s individual norms, as well as the context-dependent norms that are attached to this message. If the message violates any of those norms, an error message is sent back to the user. However, if the message obeys the norms, then the norm interpreter needs to decide what to do next, usually translated into sending messages to other peers. This decision follows from the community, individual and context-dependent norms, and takes the user’s profile (both public and private) into account as needed. If the message is sent to the interpreter of another user. As in the previous case, the norm interpreter of this new user needs to first verify that the message does not violate any of the community norms. This re-checking upon receipt ensures that the sender’s norm engine has not been manipulated to cheat. If the message violates any of the community norms, then it may either be discarded or if the community norms require sanctioning, then the appropriate sanctions should be executed. However, if the action obeys the community norms, then the norm interpreter needs to decide what to do next, which is usually translated into sending messages to other peers and/or sending messages to its user. This decision takes into consideration the community norms, the context-dependent norms that are attached to the message, the individual private norms of the human whose interpreter has received this message, as well as their local profile (both private and public). This ensures that the interpreter abides by human’s private norms without leaking any of their private norms and profile.

There are norms on the individual (user level), the task level, and the community level. An individual’s norm might be “Suppress incoming messages at night” (and this will be applied for the user who sets this norm only). A task norm might be “Don’t ask my ex” (so that would be applied for a specific task only). A community norm might be “If you don’t volunteer, you cannot ask for help” and it would be enforced on everyone. Given the above, this means that norms will be attached to users, tasks and communities.

⁠Docker variables

  • API_HOST to define the default host where API will be bind. By default is 0.0.0.0.
  • API_PORT to define the default port where API will be bind. By default is 8080.
  • DB_HOST to define the default mongo database server hostname. By default is localhost.
  • DB_PORT to define the default mongo database server port. By default is 27017.
  • DB_NAME to define the default mongo database name. By default is wenetInteractionProtocolEngineDB.
  • DB_USER_NAME to define the default mongo database user name. By default is wenetInteractionProtocolEngine.
  • DB_USER_PASSWORD to define the default mongo database user password. By default is password.
  • WENET_PROFILE_MANAGER_API to define the path to the profile manager component to use. By default is https://wenet.u-hopper.com/prod/profile_manager⁠.
  • WENET_TASK_MANAGER_API to define the path to the task manager component to use. By default is https://wenet.u-hopper.com/prod/task_manager⁠.
  • WENET_SERVICE_API to define the path to the service component to use. By default is https://wenet.u-hopper.com/prod/service⁠.
  • WENET_INCENTIVE_SERVER_API to define the path to the incentive server component to use. By default is https://wenet.u-hopper.com/prod/incentive_server⁠.
  • WENET_SOCIAL_CONTEXT_BUILDER_API to define the path to the social context builder component to use. By default is https://wenet.u-hopper.com/prod/social_context_builder⁠.
  • WENET_PERSONAL_CONTEXT_BUILDER_API to define the path to the personal context builder component to use. By default is https://wenet.u-hopper.com/prod/personal_context_builder⁠.
  • COMP_AUTH_KEY to define the authentication key that the component has to use to interact with the other WeNet components.
  • CACHE_TIMEOUT to define the time in seconds that a value can be on the cache. By default is 300.
  • CACHE_SIZE to define the maximum number of entries that can be on the cache. By default is 10000.

When the container is started, it stores the log mesages at /usr/wenet/interaction-protocol-engine/var/log/interaction-protocol-engine.log. This file is limited to 10 MB and rolled using the pattern interaction-protocol-engine.log.X (where X is a number between 1 and 99).

⁠Interaction with other WeNet components

⁠Task manager⁠
  • Get task status associated to the message to process (GET {{task_manager_api}}/tasks/{{taskId}})
  • Update the task every time a transaction message is process (PUT {{task_manager_api}}/tasks/{{taskId}})
⁠Service⁠
  • Get all the users of an application to rank them and ask for help when a task is created (GET {{service_api}}/app/{{appId}}/users)
  • Get application information associated to the message to process (GET {{service_api}}/app/{{appId}})
⁠WeNet application
  • Inform about the result of any task transaction message (POST {{messageCallbackUrl}}/)
  • Inform about an incentive (POST {{messageCallbackUrl}}/)
⁠Social context builder
  • Inform every time a new user accept to provide help. (POST {{social_context_builder_api}}/social/preferences/{{userId}}/{{taskId}})
  • When an user offer as volunteer add to the text of the notification the explanation why the user is selected. (GET {{social_context_builder_api}}/social/explanations/{{userID}}/{{taskID}})
⁠Incentive server
  • Inform every time a task transaction success and change the state. (POST {{incentive_server_api}}/Tasks/TaskStatus/})
⁠Personal context builder
  • Inform about the locations of a set of users. (POST {{personal_context_builder_api}}/locations)
  • Get the closest users into a location. (GET {{personal_context_builder_api}}/closest)

Tag summary

Content type

Image

Digest

sha256:fdd92e2d9…

Size

249.3 MB

Last updated

over 3 years ago

docker pull internetofus/interaction-protocol-engine