github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/docs/v2/framework/service-network.md (about)

     1  ---
     2  title: Service Network
     3  keywords: network
     4  tags: [network]
     5  sidebar: home_sidebar
     6  permalink: /service-network
     7  summary: The micro network service is a multi-cloud service networking solution
     8  ---
     9  
    10  The micro network service is a multi-cloud service networking solution which works across public and private environments.
    11  
    12  <img src="images/network.svg" />
    13  
    14  ## Overview
    15  
    16  The micro network provides multi-cloud capability and builds a large scale flat network over which all services can communicate with each other. 
    17  It makes use of our proxy, router, tunnel and network packages in go-micro to produce global routing across any environment. 
    18  
    19  The network generates a routing table based on the local service registry and shares this amongst nodes. It builds in a router and proxy so 
    20  any request made to any network node can be routed across the global network. It prioritises local routing first and can range up to 3 
    21  hops in a chain if needed.
    22  
    23  ## Run Network
    24  
    25  Start the network seed node (Runs on port :8085)
    26  
    27  ```shell
    28  micro network
    29  ```
    30  
    31  Start the next nodes in a different environment connecting to the first (assuming its running at 10.0.0.1:8085)
    32  
    33  ```shell
    34  micro network --nodes=10.0.0.1:8085
    35  ```
    36  
    37  ## Network Services
    38  
    39  You may now list the nodes, routes, services and graph
    40  
    41  ```
    42  # list the nodes
    43  micro network nodes
    44  
    45  # list the routes
    46  micro network routes
    47  
    48  # list the services
    49  micro network services
    50  
    51  # print the graph
    52  micro network graph
    53  ```
    54  
    55  Any request now made through the network will be proxied to a service on the other side.
    56  
    57  Set your proxy to use the network
    58  ```
    59  MICRO_PROXY=go.micro.network go run main.go
    60  ```
    61  
    62  Your service will direct all traffic through the network. 
    63  
    64  
    65  ## Authentication
    66  
    67  Specify a network token to limit access to the network.
    68  
    69  ```
    70  MICRO_NETWORK_TOKEN=foobar micro network
    71  ```
    72  
    73  Nodes must provide a valid and matching token to join the network. The default token is "go.micro.tunnel" which allows 
    74  any node to join and communicate between them.
    75