Browse Source

factomd.conf copy

root 2 years ago
parent
commit
502670d2b2
6 changed files with 116 additions and 12 deletions
  1. 5 0
      entrypoint2.sh
  2. 5 1
      entrypoint2.sh~
  3. 0 0
      factomd.conf.EXAMPLE
  4. 71 0
      factomd.conf_uploaded
  5. 15 4
      run.sh
  6. 20 7
      run.sh~

+ 5 - 0
entrypoint2.sh

@@ -5,6 +5,11 @@ do
     sleep 1
 done
 
+if [ ! -f /root/.factom/private/factomd.conf ]; then
+	echo "factomd.conf not found!"
+	sleep 1
+fi
+
 #iptables -A DOCKER-USER  -s 81.187.177.85  -i eth0 -p tcp -m tcp -j ACCEPT
 #iptables -A DOCKER-USER ! -s 54.171.68.124/32  -i eth0 -p tcp -m tcp --dport 8090 -j REJECT --reject-with icmp-port-unreachable
 #iptables -A DOCKER-USER ! -s 54.171.68.124/32  -i eth0 -p tcp -m tcp --dport 2222 -j REJECT --reject-with icmp-port-unreachable

+ 5 - 1
entrypoint2.sh~

@@ -1,5 +1,9 @@
 #!/bin/bash
-sleep 5
+
+until pids=$(pidof dockerd)
+do   
+    sleep 1
+done
 
 #iptables -A DOCKER-USER  -s 81.187.177.85  -i eth0 -p tcp -m tcp -j ACCEPT
 #iptables -A DOCKER-USER ! -s 54.171.68.124/32  -i eth0 -p tcp -m tcp --dport 8090 -j REJECT --reject-with icmp-port-unreachable

factomd.conf → factomd.conf.EXAMPLE


+ 71 - 0
factomd.conf_uploaded

@@ -0,0 +1,71 @@
+; ------------------------------------------------------------------------------
+; App settings
+; ------------------------------------------------------------------------------
+[app]
+;PortNumber                            = 8088
+;HomeDir                               = ""
+; --------------- ControlPanel disabled | readonly | readwrite
+ControlPanelSetting                   = readonly
+ControlPanelPort                      = 8090
+; --------------- DBType: LDB | Bolt | Map
+;DBType                                = "LDB"
+;LdbPath                               = "database/ldb"
+;BoltDBPath                            = "database/bolt"
+;DataStorePath                         = "data/export"
+;DirectoryBlockInSeconds               = 6
+;ExportData                            = false
+;ExportDataSubpath                     = "database/export/"
+;FastBoot                              = true
+;FastBootLocation                      = ""
+; --------------- Network: MAIN | TEST | LOCAL
+;Network                               = MAIN
+;PeersFile            = "peers.json"
+;MainNetworkPort      = 8108
+;MainSeedURL          = "https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/mainseed.txt"
+;MainSpecialPeers     = ""
+;TestNetworkPort      = 8109
+;TestSeedURL          = "https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/testseed.txt"
+;TestSpecialPeers     = ""
+LocalNetworkPort     = 8110
+; Using the seeds url for the community testnet
+;LocalSeedURL         = "https://raw.githubusercontent.com/FactomProject/communitytestnet/master/seeds/testnetseeds.txt"
+;LocalSpecialPeers    = ""
+CustomNetworkPort     = 8110
+CustomSeedURL         = "https://raw.githubusercontent.com/FactomProject/communitytestnet/master/seeds/testnetseeds.txt"
+CustomSpecialPeers    = ""
+; --------------- NodeMode: FULL | SERVER ----------------
+;NodeMode                                = FULL
+;ExchangeRateChainId                     = 111111118d918a8be684e0dac725493a75862ef96d2d3f43f84b26969329bf03
+;ExchangeRateAuthorityPublicKeyMainNet   = daf5815c2de603dbfa3e1e64f88a5cf06083307cf40da4a9b539c41832135b4a
+;ExchangeRateAuthorityPublicKeyTestNet   = 1d75de249c2fc0384fb6701b30dc86b39dc72e5a47ba4f79ef250d39e21e7a4f
+; Private key all zeroes:
+;ExchangeRateAuthorityPublicKeyLocalNet  = 3b6a27bcceb6a42d62a3a8d02a6f0d73653215771de243a63ac048a18b59da29
+
+; These define if the RPC and Control Panel connection to factomd should be encrypted, and if it is, what files
+; are the secret key and the public certificate.  factom-cli and factom-walletd uses the certificate specified here if TLS is enabled.
+; To use default files and paths leave /full/path/to/... in place.
+;FactomdTlsEnabled                     = false
+;FactomdTlsPrivateKey                  = "/full/path/to/factomdAPIpriv.key"
+;FactomdTlsPublicCert                  = "/full/path/to/factomdAPIpub.cert"
+
+; These are the username and password that factomd requires for the RPC API and the Control Panel
+; This file is also used by factom-cli and factom-walletd to determine what login to use
+;FactomdRpcUser                        = ""
+;FactomdRpcPass                        = ""
+
+; Specifying when to change ACKs for switching leader servers
+;ChangeAcksHeight                      = 0
+
+
+; Community Testnet Bootstrap information
+network = CUSTOM
+CustomBootstrapIdentity               = 8888882f5002ff95fce15d20ecb7e18ae6cc4d5849b372985d856b56e492ae0f
+CustomBootstrapKey                    = 58cfccaa48a101742845df3cecde6a9f38037030842d34d0eaa76867904705ae
+ExchangeRateAuthorityPublicKey        = 58cfccaa48a101742845df3cecde6a9f38037030842d34d0eaa76867904705ae
+DirectoryBlockInSeconds               = 600
+
+
+; --- Node Identity Information (Keep this line please) ---
+IdentityChainID                       = 888888eb4e64f8c92db4c81636998e34af13c29d020780b60645ffe00fc70dc4
+LocalServerPrivKey                    = bab9ec111d6850fbbf8ba6f0d31d604221bac9849daea6c38b1c2cad8a376d48
+LocalServerPublicKey                  = 35826ff8d6109a52e438dffab7303e3d3e0bda785353c60d3dfcfe5cac94d3df

+ 15 - 4
run.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+set -e
+
 if [ -z "$TESTNODEIP" ]; then
    printf "\nTestNet Node IP has not been set.  Please enter IP Address: "
    read ip
@@ -13,6 +15,13 @@ if [ -z "$TESTNODEIP" ]; then
 fi
 
 
+if [ "$(docker ps -a | grep testnet_swarm)" ]; then
+   echo "Stopping testnet"
+   docker stop testnet_swarm
+   sleep 1
+   docker rmi testnet_swarm
+fi
+
 docker build -t testnet_swarm .
 
 if [ ! "$(docker volume ls | grep factom_database_testnet)" ]; then
@@ -21,14 +30,16 @@ if [ ! "$(docker volume ls | grep factom_database_testnet)" ]; then
    docker volume create factom_keys_testnet 
 fi
 
-[ "$(docker ps -a | grep testnet_swarm)" ] && docker stop testnet_swarm
 
 docker run -itd --rm --privileged --cap-add=NET_RAW --cap-add=NET_ADMIN -v "factom_database_testnet:/root/.factom/m2" -v "factom_keys_testnet:/root/.factom/private" --net public --ip $TESTNODEIP --name testnet_swarm testnet_swarm
 
-if [ ! -f factomd.conf ]; then
-   docker cp factomd.conf /var/lib/docker/volumes/factom_keys/_data/.
-   mv factomd.conf factomd.conf_copied
+if [ -f factomd.conf ]; then
+   echo "factomd found.  Copying"
+   docker exec testnet_swarm mkdir -p /root/.factom/private/_data
+   docker cp factomd.conf testnet_swarm:/root/.factom/private/_data/.
+   mv factomd.conf factomd.conf_uploaded
 fi
 
 echo "Control Panel: $TESTNODEIP:8090"
+read -p "Press enter to connect BASH to container"
 docker exec -it testnet_swarm /bin/bash

+ 20 - 7
run.sh~

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+set -e
+
 if [ -z "$TESTNODEIP" ]; then
    printf "\nTestNet Node IP has not been set.  Please enter IP Address: "
    read ip
@@ -13,19 +15,30 @@ if [ -z "$TESTNODEIP" ]; then
 fi
 
 
+if [ "$(docker ps -a | grep testnet_swarm)" ]; then
+   echo "Stopping testnet"
+   docker stop testnet_swarm
+   sleep 1
+   docker rmi testnet_swarm
+fi
+
 docker build -t testnet_swarm .
 
 if [ ! "$(docker volume ls | grep factom_database_testnet)" ]; then
+   echo "testnet volumes not found. Creating"
    docker volume create factom_database_testnet
    docker volume create factom_keys_testnet 
 fi
 
 
-docker stop testnet_swarm
-docker run -itd --rm --privileged --cap-add=NET_RAW --cap-add=NET_ADMIN -v "factom_database:/root/.factom/m2" -v "factom_keys:/root/.factom/private" --net public --ip $TESTNODEIP --name testnet_swarm testnet_swarm
-if [ ! -f factomd.conf ]; then
-   docker cp factomd.conf /var/lib/docker/volumes/factom_keys/_data/.
-   mv factomd.conf factomd.conf_copied
+docker run -itd --rm --privileged --cap-add=NET_RAW --cap-add=NET_ADMIN -v "factom_database_testnet:/root/.factom/m2" -v "factom_keys_testnet:/root/.factom/private" --net public --ip $TESTNODEIP --name testnet_swarm testnet_swarm
+
+if [ -f factomd.conf ]; then
+   echo "factomd found.  Copying"
+   docker exec testnet_swarm mkdir -p /root/.factom/private/_data
+   docker cp factomd.conf testnet_swarm:/root/.factom/private/_data/.
+   mv factomd.conf factomd.conf_uploaded
 fi
-docker exec -it testnet_swarm /bin/bash
-echo "Control Panel: $TESTNODEIP:8090"
+
+echo "Control Panel: $TESTNODEIP:8090"
+docker exec -it testnet_swarm /bin/bash