MCPcopy Index your code
hub / github.com/chain/Core / setup

Method setup

docs/core/examples/java/TransactionBasics.java:174–215  ·  view source on GitHub ↗
(Client client, Client otherCoreClient)

Source from the content-addressed store, hash-verified

172 }
173
174 public static void setup(Client client, Client otherCoreClient) throws Exception {
175 MockHsm.Key aliceKey = MockHsm.Key.create(client);
176 HsmSigner.addKey(aliceKey, MockHsm.getSignerClient(client));
177
178 MockHsm.Key bobKey = MockHsm.Key.create(otherCoreClient);
179 HsmSigner.addKey(bobKey, MockHsm.getSignerClient(otherCoreClient));
180
181 new Asset.Builder()
182 .setAlias("gold")
183 .addRootXpub(aliceKey.xpub)
184 .setQuorum(1)
185 .create(client);
186
187 new Asset.Builder()
188 .setAlias("silver")
189 .addRootXpub(aliceKey.xpub)
190 .setQuorum(1)
191 .create(client);
192
193 new Account.Builder()
194 .setAlias("alice")
195 .addRootXpub(aliceKey.xpub)
196 .setQuorum(1)
197 .create(client);
198
199 new Account.Builder()
200 .setAlias("bob")
201 .addRootXpub(bobKey.xpub)
202 .setQuorum(1)
203 .create(otherCoreClient);
204
205 Transaction.submit(client, HsmSigner.sign(new Transaction.Builder()
206 .addAction(new Transaction.Action.Issue()
207 .setAssetAlias("silver")
208 .setAmount(1000)
209 ).addAction(new Transaction.Action.ControlWithAccount()
210 .setAccountAlias("alice")
211 .setAssetAlias("silver")
212 .setAmount(1000)
213 ).build(client)
214 ));
215 }
216}

Callers 1

mainMethod · 0.95

Calls 13

addKeyMethod · 0.95
getSignerClientMethod · 0.95
submitMethod · 0.95
signMethod · 0.95
addActionMethod · 0.80
createMethod · 0.65
setQuorumMethod · 0.45
addRootXpubMethod · 0.45
setAliasMethod · 0.45
buildMethod · 0.45
setAmountMethod · 0.45
setAssetAliasMethod · 0.45

Tested by

no test coverage detected