# gossamer devnet setup
on each instance, clone gossamer and checkout your desired branch. then:
```
make gossamer
./bin/gossamer init --force
```
**important**: depending on the number of nodes you want in the devnet, you'll need to modify the gssmr genesis-spec.json file to reflect this. by default, there are 9 authorities. if you just want 3,for examples, then remove all the authorities in `chain/gssmr/genesis-spec.json` under both `Babe` and `Grandpa` except for the first 3.
your authorities will look as follows:
```
"Babe": {
"Authorities": [
[
"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
1
],
[
"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
1
],
[
"5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y",
1
]
]
},
"Grandpa": {
"Authorities": [
[
"5DFNv4Txc4b88qHqQ6GG4D646QcT4fN3jjS2G3r1PyZkfDut",
1
],
[
"5FRbF5E5xpBxaCdjuVkCAtoLgvvoL6wJoE7kAVTUdZBwpgi7",
1
],
[
"5DYo8CvjQcBQFdehVhansDiZCPebpgqvNC8PQPi6K9cL9giT",
1
]
]
},
```
on the "lead" node, which will build block 1, use the `--babe-lead` flag:
```
nohup ./bin/gossamer --key alice --babe-lead &> node.log &
```
wait until the node prints out its libp2p address, and use this as the bootnode for the other nodes.
on other nodes:
```
nohup ./bin/gossamer --key bob --bootnodes /ip4/3.140.185.21/tcp/7001/p2p/12D3KooWFYuPzB7hCqVWvqKD4Eh2HqqFEcppQrbs9zMY3c2FwScA &> node.log &
```
```
nohup ./bin/gossamer --key charlie --bootnodes /ip4/3.140.185.21/tcp/7001/p2p/12D3KooWFYuPzB7hCqVWvqKD4Eh2HqqFEcppQrbs9zMY3c2FwScA &> node.log &
```
note: after you obtain the libp2p address of alice, it will never change unless you purge the basepath (`~/.gossamer`). so, on subsequent restarts, you can start all the nodes at basically the same time.
note: if you are running the devnet all on one machine, you need to specify the basepath and port for each node (and make them different!) eg.
```
./bin/gossamer --key alice --port 7009 --basepath /tmp/alice
```
note: you can use the `--publish-metrics` flag for prometheus metrics: then, `curl http://localhost:9876/metrics`
to restart the devnet with some changes, firstly kill the previous nodes that are running. then:
```
git checkout <your-branch>
```
or
```
git pull origin <your-branch>
```
then, same steps as the before to re-initalize the devnet:
```
make gossamer
./bin/gossamer init --force
```