Advertisement
Guest User

Raspi rvi release-0.4.0 config

a guest
Jul 23rd, 2015
4,217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 6.95 KB | None | 0 0
  1. %% -*- erlang -*-
  2.  
  3. %% Copyright (C) 2014, Jaguar Land Rover
  4. %%
  5. %% This program is licensed under the terms and conditions of the
  6. %% Mozilla Public License, version 2.0.  The full text of the
  7. %% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
  8. %%
  9. %% Configuration file for the (in-vehicle) IVI used by the hvac_demo
  10. %%
  11. %% See ../hvac_demo/README.md for details on the demo.
  12. %%
  13. %% See ../CONFIGURE.md for a details on the configuration process
  14. %% itself.
  15. %%
  16. [
  17.  %% All erlang apps needed to fire up a node. Do not touch.
  18.  {apps,
  19.   [kernel,
  20.    stdlib,
  21.    sasl,
  22.    {setup, load},
  23.    syntax_tools,
  24.    lager,
  25.    crypto,
  26.    public_key,
  27.    exo,
  28.    compiler,
  29.    ssl,
  30.    asn1,
  31.    %% RVI-specific apps.
  32.  
  33.    %% Do not touch unless you are replacing apps with your own
  34.    %% version.  If you are replacing an app with a non-Erlang version,
  35.    %% it still has to be loaded in order to resolve.
  36.    %% If, for example, you want to deploy your own scheduler
  37.    %% outside Erlang, replace
  38.    %%
  39.    %%     schedule,
  40.    %% with
  41.    %%     { schedule, load },
  42.    %%
  43.    rvi,
  44.    rvi_common,
  45.    service_discovery,
  46.    service_edge,
  47.    authorize,
  48.    schedule,
  49.    dlink_tcp,
  50.    bt,
  51.    dlink_bt,
  52.    proto_bert,
  53.    proto_json ]},
  54.  
  55.  %%
  56.  %% Custom environment settings
  57.  %% for all apps running on the node.
  58.  %%
  59.  {env,
  60.   [
  61.    %% Lager is the main logging mechanism.
  62.    %% See https://github.com/basho/lager for details.
  63.    %%
  64.    {lager,
  65.     [ { handlers,
  66.     %% Change this to debug, info, notice, warning, or error in
  67.     %% order to lower the console chatter.
  68.     [ {lager_console_backend, debug} ]
  69.       }
  70.     ]
  71.    },
  72.      
  73.    %% All RVI configuration is done here.
  74.    %% Please note that the rvi_node.sh launch script
  75.    %% can still override the port range and static nodes
  76.    %% through its command line parameters.
  77.    %%
  78.    {rvi,
  79.     [
  80.  
  81.      %% Specify the node address that data_link uses to listen to
  82.      %% incoming traffic from other rvi nodes.
  83.      %%
  84.      %% This is the address that is announced to
  85.      %% other rvi nodes during service discovery and should be
  86.      %% forwarded through firewalls and port forwarding to to the port
  87.      %% specified by the configuration entry rvi -> components ->
  88.      %% data_link -> bert_rpc_server (see below).
  89.      %%
  90.      %% If this node is sitting behind a firewall and cannot
  91.      %% receive incomign connections on any address, its
  92.      %% node_address should be set to "0.0.0.0:0" to inform
  93.      %% the remote node that it should not attempt to
  94.      %% connect back to self.
  95.      { node_address, "127.0.0.1:8807" },  
  96.  
  97.      %% Specify the prefix of all services that this rvi node is hosting.
  98.      %%
  99.      %% All local services regsitering with service edge will be prefixed with
  100.      %% the string below when they are announced to remote rvi nodes
  101.      %% that connect to this node (using the address specified
  102.      %% by node_address above).
  103.      %%
  104.      %% If a locally connected service registers itself as
  105.      %% "hvac/fan_speed", and the node_service_prefix is
  106.      %% "jlr.com/vin/1234/", this node will announce the service
  107.      %% "jlr.com/vin/1234/hvac/fan_speed" as being available
  108.      %% to remotely connected rvi nodes.
  109.      %%
  110.      %% Two rvi nodes should never have the same node_service_prefix
  111.      %% value unless all services add a system-wide unique name
  112.      %% to it.
  113.      %%
  114.      { node_service_prefix, "jlr.com/bt/stoffe"},
  115.  
  116.      
  117.      { routing_rules,
  118.        [
  119.     %% Make sure to have a default if you don't want your message
  120.     %% to error out immediately. With a default the message will
  121.     %% be queued until it times out, waiting for a remote node
  122.     %% to connect and announce that it can handle the targeted service.
  123.     { "",
  124.       [
  125.        { proto_json_rpc, dlink_tcp_rpc}
  126.       ]
  127.     }
  128.       ]
  129.      },
  130.     { components,
  131.       [
  132.     %% A note about JSON-RPC calls vs gen_server calls:
  133.     %%
  134.     %% All locally connected services communicate with Service Edge
  135.     %% through JSON-RPC, as specified below.
  136.     %%
  137.     %% Communication between the RVi components, however, can be
  138.     %% either JSON-RPC or gen_server calls.
  139.     %%
  140.     %% JSON-RPC calls provide compatability with replacement components
  141.     %% written in languages other than Erlang.
  142.     %%
  143.     %% Gen_server calls provide native erlang inter-process calls that
  144.     %% are about 4x faster than JSON-RPC when transmitting large data volumes.
  145.     %%
  146.     %% If one or more of the components below are replaced with external
  147.     %% components, use JSON-RPC by specifying url and exo_http_opts
  148.     %% for all components.
  149.     %%
  150.     %% If you are running an all-native erlang system, use gen_server calls
  151.     %% by configuring gen_server.
  152.     %%
  153.     %% If you specify both gen_server and url/exo_http_opts, the gen_server
  154.     %% communicaiton path will be used for inter component communication.
  155.     %%
  156.     %% Please note that communication between two RVI nodes are
  157.     %% not affected by this since data_link_bert_rpc will use
  158.     %% BERT-RPC to communicate ( using the address/port specified
  159.     %% by bert_rpc_server).
  160.     %%
  161.  
  162.     {service_edge,
  163.       [
  164.         %% Service_edge_rpc component is used as a gen_server
  165.         { service_edge_rpc, gen_server,
  166.         [
  167.           %% JSON-RPC address will be translated to
  168.           %% an URL looking like this:
  169.           %% http://127.0.0.1:8801
  170.           %%
  171.           %% This URL is used both for communication with
  172.           %% locally connected services and for intra-component
  173.           %% communication in case the access method for
  174.           %% service_edge_rpc is specified as json_rpc.
  175.           { json_rpc_address, { "127.0.0.1", 8801 } },
  176.  
  177.           %% Websocket is used for websocket access, preferably
  178.           %% through the rvi.js package available for Javascript
  179.           %% apps in browsers and crosswalk who wants to interface
  180.           %% RVI.
  181.           { websocket, [ { port, 8808}]}
  182.         ]
  183.         }
  184.       ]
  185.     },
  186.     { service_discovery,
  187.       [ { service_discovery_rpc, gen_server,
  188.           [
  189.            { json_rpc_address, { "127.0.0.1", 8802 }}
  190.           ]
  191.         }
  192.       ]
  193.     },
  194.     { schedule,
  195.       [ { schedule_rpc, json_rpc,
  196.           [
  197.            { json_rpc_address, { "127.0.0.1", 8803 }}
  198.           ]
  199.         }
  200.       ]
  201.     },
  202.     { authorize,
  203.       [ { authorize_rpc, gen_server,
  204.           [
  205.         { json_rpc_address, { "127.0.0.1", 8804 } }
  206.           ]
  207.         }
  208.       ]
  209.     },
  210.     { protocol,
  211.       [ { proto_json_rpc, gen_server,
  212.           [
  213.         { json_rpc_address, { "127.0.0.1", 8805 } }
  214.           ]
  215.         }
  216.       ]
  217.     },
  218.     { data_link,
  219.       [
  220.         { dlink_tcp_rpc, gen_server,
  221.           [
  222.         { json_rpc_address, { "127.0.0.1", 8806 } },
  223.         %% Bert_rpc server specifies the port we should
  224.         %% listen to for incoming connections
  225.         %% from other rvi nodes.
  226.         %% A specific NIC address can also be specified
  227.         %% through the {ip, "192.168.0.1" } tuple.
  228.         { server_opts, [ { port, 8807 }]}
  229.         %% { persistent_connections, [ "38.129.64.13:8807" ]}
  230.           ]
  231.         },
  232.         { dlink_bt_rpc, gen_server,
  233.           [
  234.  
  235.         { server_opts, [ { channel, 1 }]}
  236.           ]
  237.         }
  238.  
  239.       ]
  240.     }
  241.       ]
  242.     }
  243.    ]}
  244. ]}
  245. ].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement