Skip to content

Commit

Permalink
adding note of block zero for mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed May 18, 2018
1 parent 2824f1e commit b8318e0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BUILD
Expand Up @@ -4,7 +4,7 @@ java_binary(
name = "SnowBlossomNode",
main_class = "snowblossom.SnowBlossomNode",
jvm_flags = [
"-Xmx1G",
"-Xmx1600M",
],
runtime_deps = [
":snowblossomlib",
Expand Down
42 changes: 42 additions & 0 deletions src/LogSetup.java
@@ -0,0 +1,42 @@
package snowblossom;

import java.util.logging.Logger;
import java.util.logging.LogManager;
import java.util.logging.Level;
import java.util.Enumeration;
import java.util.logging.Handler;

public class LogSetup
{
public static void setup(Config config)
{

LogManager.getLogManager().getLogger(Logger.GLOBAL_LOGGER_NAME).setLevel(Level.WARNING);
LogManager.getLogManager().getLogger("").setLevel(Level.WARNING);

listLoggers();
}

public static void listLoggers()
{

Enumeration<String> e = LogManager.getLogManager().getLoggerNames();
while(e.hasMoreElements())
{
String s =e.nextElement();

System.out.println("Logger: " + s);
Logger m = LogManager.getLogManager().getLogger(s);
if (m != null)
{
Logger p = m.getParent();
if (p != null) System.out.println(" p: " + p.getName());
for(Handler h : m.getHandlers())
{
System.out.println(" " + h.getClass().getName());
}
}
}
}

}
4 changes: 4 additions & 0 deletions src/NetworkParamsProd.java
Expand Up @@ -52,4 +52,8 @@ public List<String> getSeedNodes()
}
@Override
public int getDefaultPort() { return 2338; }

// Fill in hash of bitcoin block 523850 when it occurs, in hex replacing the zeros to start mainnet
@Override
public ByteString getBlockZeroRemark() { return ByteString.copyFrom(new String("000000").getBytes()); }
}
5 changes: 5 additions & 0 deletions src/SnowBlossomNode.java
Expand Up @@ -52,6 +52,8 @@ public SnowBlossomNode(Config config)
{
this.config = config;

LogSetup.setup(config);

config.require("db_type");

setupParams();
Expand All @@ -63,6 +65,9 @@ public SnowBlossomNode(Config config)

startServices();


LogSetup.listLoggers();

}

public void stop()
Expand Down

0 comments on commit b8318e0

Please sign in to comment.