use of io.nem.symbol.sdk.infrastructure.vertx.RepositoryFactoryVertxImpl in project nem2-sdk-java by nemtech.
the class RepositoryFactoryConfigurationExamplesIntegrationTest method bootAppUsingLegacyHardcodedCurrencies.
@Test
void bootAppUsingLegacyHardcodedCurrencies() throws ExecutionException, InterruptedException {
// Option 3) Client app boot time relaying on some of the rest configuration.
// User uses the
// legacy hardcoded sdk currencies
RepositoryFactoryConfiguration configuration = new RepositoryFactoryConfiguration("http://localhost:3000");
configuration.withNetworkCurrencies(new NetworkCurrencies(Currency.CAT_CURRENCY, Currency.CAT_HARVEST));
try (RepositoryFactory repositoryFactory = new RepositoryFactoryVertxImpl(configuration)) {
appDoSomeStuff(repositoryFactory);
}
}
use of io.nem.symbol.sdk.infrastructure.vertx.RepositoryFactoryVertxImpl in project nem2-sdk-java by nemtech.
the class RepositoryFactoryConfigurationExamplesIntegrationTest method bootAppFullyOffline.
@Test
void bootAppFullyOffline() throws ExecutionException, InterruptedException {
// Option 1) Client app boot time. The clients defines the configuration to work
// offline.
RepositoryFactoryConfiguration configuration = new RepositoryFactoryConfiguration("http://localhost:3000");
configuration.withNetworkType(NetworkType.MAIN_NET);
configuration.withGenerationHash("abc");
Currency currency = new CurrencyBuilder(NamespaceId.createFromName("my.custom.currency"), 6).build();
Currency harvest = new CurrencyBuilder(NamespaceId.createFromName("my.custom.harvest"), 3).build();
configuration.withNetworkCurrencies(new NetworkCurrencies(currency, harvest));
try (RepositoryFactory repositoryFactory = new RepositoryFactoryVertxImpl(configuration)) {
appDoSomeStuff(repositoryFactory);
}
}
Aggregations