Bladeren bron

dchat: add scripts to autorun a localnet deployment. useful for debugging net code.

darkfi 1 jaar geleden
bovenliggende
commit
6419c759eb

+ 6 - 0
example/dchat/dchatd/README.md

@@ -68,4 +68,10 @@ Or use multitail for colored output:
 multitail -c /tmp/alice.log
 ```
 
+# Example Localnet
 
+```
+./example/seed.sh
+./example/node1.sh
+./example/node2.sh
+```

+ 3 - 0
example/dchat/dchatd/example/node1.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+cargo run -- --config example/node2.toml
+

+ 12 - 0
example/dchat/dchatd/example/node1.toml

@@ -0,0 +1,12 @@
+rpc_listen="tcp://127.0.0.1:10302"
+verbose = 2
+
+[net]
+hostlist = "example/node1.tsv"
+inbound = ["tcp://127.0.0.1:10202"]
+external_addrs = ["tcp://127.0.0.1:10202"]
+seeds = ["tcp://127.0.0.1:10200"]
+outbound_connections = 5
+magic_bytes = [127, 64, 12, 201]
+localnet = true
+

+ 3 - 0
example/dchat/dchatd/example/node2.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+cargo run -- --config example/node1.toml
+

+ 13 - 0
example/dchat/dchatd/example/node2.toml

@@ -0,0 +1,13 @@
+rpc_listen="tcp://127.0.0.1:10301"
+verbose = 2
+
+[net]
+hostlist = "example/node2.tsv"
+inbound = ["tcp://127.0.0.1:10201"]
+#auto_advertise = true
+external_addrs=["tcp://127.0.0.1:10201"]
+seeds = ["tcp://127.0.0.1:10200"]
+outbound_connections = 5
+magic_bytes = [127, 64, 12, 201]
+localnet = true
+

+ 3 - 0
example/dchat/dchatd/example/seed.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+cargo run -- --config example/seed.toml
+

+ 12 - 0
example/dchat/dchatd/example/seed.toml

@@ -0,0 +1,12 @@
+rpc_listen="tcp://127.0.0.1:10300"
+verbose = 2
+
+[net]
+hostlist = "example/seed.tsv"
+inbound=["tcp://127.0.0.1:10200"]
+external_addrs=["tcp://127.0.0.1:10200"]
+seeds=[]
+outbound_connections = 5
+magic_bytes=[127, 64, 12, 201]
+localnet = true
+