Skip to content

Commit a5cb379

Browse files
committed
Edits for peer creation and testing
1 parent 619281a commit a5cb379

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

convex-cli/src/main/java/convex/cli/peer/PeerCreate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
@Command(name="create",
3737
aliases={"cr"},
38-
description="Creates a keypair, new account and a funding stake: to run a local peer.")
38+
description="Creates a peer ready to join a Convex network.")
3939
public class PeerCreate extends APeerCommand {
4040

4141
private static final Logger log = LoggerFactory.getLogger(PeerCreate.class);
@@ -50,7 +50,7 @@ public class PeerCreate extends APeerCommand {
5050
private String keystorePublicKey;
5151

5252
@Option(names={"--port"},
53-
description="Port number of nearest peer to connect too.")
53+
description="Port number of remote peer to connect too.")
5454
private int port = 0;
5555

5656
@Option(names={"--host"},

convex-peer/src/test/java/convex/peer/JoinNetworkTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.junit.jupiter.api.Test;
1414

1515
import convex.api.Convex;
16-
import convex.core.Coin;
1716
import convex.core.Constants;
1817
import convex.core.Result;
1918
import convex.core.crypto.AKeyPair;
@@ -39,13 +38,15 @@ public void testJoinNetwork() throws IOException, InterruptedException, Executio
3938
AKeyPair kp=AKeyPair.generate();
4039
AccountKey peerKey=kp.getAccountKey();
4140

42-
long STAKE=Constants.MINIMUM_EFFECTIVE_STAKE*10;
41+
// We plan to stake twice the minimum amount
42+
long STAKE=Constants.MINIMUM_EFFECTIVE_STAKE*2;
43+
4344
synchronized(network.SERVER) {
4445
Convex heroConvex=network.CONVEX;
4546

46-
// Create new peer controller account
47+
// Create new peer controller account, ensure it has enough coins to stake
4748
Address controller=heroConvex.createAccountSync(kp.getAccountKey());
48-
Result trans=heroConvex.transferSync(controller,Coin.DIAMOND);
49+
Result trans=heroConvex.transferSync(controller,STAKE*2);
4950
assertFalse(trans.isError());
5051

5152
// create test user account

0 commit comments

Comments
 (0)