本文整理汇总了Java中com.bitsofproof.supernode.api.BCSAPI类的典型用法代码示例。如果您正苦于以下问题:Java BCSAPI类的具体用法?Java BCSAPI怎么用?Java BCSAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BCSAPI类属于com.bitsofproof.supernode.api包,在下文中一共展示了BCSAPI类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTransaction
import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
public void updateTransaction (BCSAPI api, PendingTransaction transaction) throws BCSAPIException, ValidationException
{
transaction.setSignedBy (getSignedBy (transaction.getTransaction ()));
if ( transaction.getSignedBy ().size () > 0 )
{
pendingTransactions.put (transaction.getId (), transaction);
try
{
transaction.getTransaction ().computeHash ();
log.info ("Updated " + transaction.getId () + " to " + transaction.getTransaction ().getHash ());
if ( getSignedBy (transaction.getTransaction ()).size () >= 2 )
{
api.sendTransaction (transaction.getTransaction ());
log.info ("Successfully sent " + transaction.getTransaction ().getHash ());
log.info ("transaction: " + transaction.getTransaction ().toWireDump ());
pendingTransactions.remove (transaction.getId ());
}
}
catch ( BCSAPIException e )
{
log.info ("Transaction rejected " + transaction.getTransaction ().getHash ());
throw e;
}
}
}
示例2: BopShopResource
import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
public BopShopResource (BCSAPI api, Vault vault, ExtendedKey master, int customerId, String password) throws ValidationException
{
this.master = master;
this.vault = vault;
this.api = api;
client = HttpClientBuilder.create ().build ();
this.customerId = customerId;
this.password = password;
log.info ("Vault address is " + vault.getVaultAddress ());
}
示例3: run
import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
@Override
public void run (Btc1kConfiguration configuration, Environment environment) throws Exception
{
BCSAPI api = supernodeBundle.getBCSAPI ();
Vault vault = configuration.getVaultFactory ().createVault ();
environment.lifecycle ().manage (new Btc1kService (api, vault));
environment.jersey ().register (new BopShopResource (
supernodeBundle.getBCSAPI (),
vault,
configuration.getBopShopKey (),
configuration.getCustomerId (),
configuration.getPassphrase ()
).processCleared ());
}
示例4: sync
import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
@Override
public void sync (BCSAPI api) throws BCSAPIException
{
reset ();
api.scanUTXOForAddresses (getAddresses (), new TransactionListener ()
{
@Override
public boolean process (Transaction t)
{
return updateWithTransaction (t);
}
});
}
示例5: syncHistory
import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
@Override
public void syncHistory (BCSAPI api) throws BCSAPIException
{
reset ();
api.scanTransactionsForAddresses (getAddresses (), getCreated (), new TransactionListener ()
{
@Override
public boolean process (Transaction t)
{
return updateWithTransaction (t);
}
});
}
示例6: TransactionsResource
import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
public TransactionsResource (Vault vault, BCSAPI api)
{
this.vault = vault;
this.api = api;
}
示例7: Btc1kService
import com.bitsofproof.supernode.api.BCSAPI; //导入依赖的package包/类
private Btc1kService (BCSAPI api, Vault vault)
{
this.api = api;
this.vault = vault;
}