コード例 #1
0
def load_validator_config(first_config, config_dir):
    default_validator_config = load_default_validator_config()
    conf_file = os.path.join(config_dir, 'validator.toml')

    toml_config = load_toml_validator_config(conf_file)

    return merge_validator_config(
        configs=[first_config, toml_config, default_validator_config])
コード例 #2
0
ファイル: cli.py プロジェクト: jjason/sawtooth-core
def load_validator_config(first_config, config_dir):
    default_validator_config = load_default_validator_config()
    conf_file = os.path.join(config_dir, 'validator.toml')

    toml_config = load_toml_validator_config(conf_file)

    return merge_validator_config(
        configs=[first_config, toml_config, default_validator_config])
コード例 #3
0
ファイル: tests.py プロジェクト: feihujiang/sawtooth-core
 def test_validator_config_defaults(self):
     """Tests the default validator configuration when no other configs.
     The defaults should be as follows:
         - bind_network = "tcp://127.0.0.1:8800"
         - bind_component = "tcp://127.0.0.1:4004"
         - peering = "static"
         - endpoint = None
     """
     config = load_default_validator_config()
     self.assertEquals(config.bind_network, "tcp://127.0.0.1:8800")
     self.assertEquals(config.bind_component, "tcp://127.0.0.1:4004")
     self.assertEquals(config.endpoint, None)
     self.assertEquals(config.peering, "static")
コード例 #4
0
ファイル: tests.py プロジェクト: suparnadhar/SuparnaGit
 def test_validator_config_defaults(self):
     """Tests the default validator configuration when no other configs.
     The defaults should be as follows:
         - bind_network = "tcp://127.0.0.1:8800"
         - bind_component = "tcp://127.0.0.1:4004"
         - peering = "static"
         - endpoint = None
     """
     config = load_default_validator_config()
     self.assertEquals(config.bind_network, "tcp://127.0.0.1:8800")
     self.assertEquals(config.bind_component, "tcp://127.0.0.1:4004")
     self.assertEquals(config.endpoint, None)
     self.assertEquals(config.peering, "static")