Skip to content

Commit

Permalink
update fn setup
Browse files Browse the repository at this point in the history
* docs pointed to diem and links were broken
* seed_addrs was broken or_default + extend is not ideal
* Upstream from config + ValidatorFullNode from onchain results in no
  config

Closes: #8055
  • Loading branch information
davidiw authored and bors-libra committed Mar 31, 2021
1 parent f188b31 commit 92f6cce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 6 additions & 4 deletions developers.diem.com/docs/node/config-deploy-fn.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ You can configure a public FullNode in two ways: using the Diem Core source code
* Copy `config/src/config/test_data/public_full_node.yaml` to your current working directory.
* Download [genesis](https://testnet.libra.org/genesis.blob) and [waypoint](https://testnet.libra.org/waypoint.txt) files for testnet.
* Download [genesis](https://testnet.diem.com/genesis.blob) and [waypoint](https://testnet.diem.com/waypoint.txt) files for testnet.
* Update the public_full_node.yaml file in your current working directory by:
* Specifying the directory where you want testnet to store its database next to `base:data_dir`; for example, `./data`.
* Copying and pasting the contents of the waypoint file linked in step 2 next to `waypoint` field.
* Copying and pasting the contents of the waypoint file to the `waypoint` field.
* Adding the path where your Genesis file is located to `genesis_file_location`.
Expand All @@ -55,6 +55,8 @@ You can configure a public FullNode in two ways: using the Diem Core source code
- "/dns4/fn.testnet.diem.com/tcp/6182/ln-noise-ik/d29d01bed8ab6c30921b327823f7e92c63f8371456fb110256e8c0e8911f4938/ln-handshake/0"
```
* Disable on-chain discovery for the `discovery_method: "none"` (this is not required but it will limit log spew)
* Reading through the config and making any other desired changes. You can see what configurations the `public_full_node.yaml` file should have by checking the following file as an example: `docker/compose/public_full_node/public_full_node.yaml`
4. Run the libra-node using `cargo run -p diem-node -- -f ./public_full_node.yaml`
Expand All @@ -68,8 +70,8 @@ You can also use Docker to configure and run your PublicFullNode.
1. Install Docker and Docker-Compose.
2. Create a directory for your public FullNode composition.
3. Download the public FullNode [docker compose](https://github.com/diem/diem/tree/main/docker/compose/public_full_node/docker-compose.yaml) and [libra](https://github.com/diem/diem/tree/main/docker/compose/public_full_node/public_full_node.yaml) configuration files into the directory created in step 2.
4. Download [genesis](https://testnet.libra.org/genesis.blob) and [waypoint](https://testnet.libra.org/waypoint.txt) files for testnet into that directory.
3. Download the public FullNode [docker compose](https://github.com/diem/diem/tree/main/docker/compose/public_full_node/docker-compose.yaml) and [diem](https://github.com/diem/diem/tree/main/docker/compose/public_full_node/public_full_node.yaml) configuration files into this directory.
4. Download [genesis](https://testnet.diem.com/genesis.blob) and [waypoint](https://testnet.diem.com/waypoint.txt) files for testnet into that directory.
5. Run docker-compose: `docker-compose up`.
Expand Down
12 changes: 9 additions & 3 deletions network/builder/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,17 @@ impl NetworkBuilder {
.seed_addrs
.iter()
.map(|(peer_id, addrs)| {
(peer_id, Peer::from_addrs(PeerRole::Upstream, addrs.clone()))
(
peer_id,
Peer::from_addrs(PeerRole::ValidatorFullNode, addrs.clone()),
)
})
.for_each(|(peer_id, peer)| {
let seed = seeds.entry(*peer_id).or_default();
seed.extend(peer).unwrap();
seeds
.entry(*peer_id)
// Sad clone due to Rust not realizing these are two distinct paths
.and_modify(|seed| seed.extend(peer.clone()).unwrap())
.or_insert(peer);
});

network_builder.add_connectivity_manager(
Expand Down

0 comments on commit 92f6cce

Please sign in to comment.