| ... | ... | @@ -25,10 +25,14 @@ For spawning the other actors we the `AbstractConfiguration` class offers the fo |
|
|
|
* `spawnWallet(String name, boolean createGUI)` is used to create a new wallet with the first parameter being the name of the wallet node and the second parameter denoting, if the wallet should use a GUI.
|
|
|
|
* `spawnWallets(int n, boolean createGUI)` resembles the previous `main()` method the most, as it spawns n wallets and automatically assigns a name and creates a GUI as requested.
|
|
|
|
|
|
|
|
The last two methods are blocking until all wallets have received their initial amount of 100 FUCs. To create a wallet without blocking the configuration, you can use the `createWallet` method.
|
|
|
|
|
|
|
|
By default your configuration will be listed by the class name in the configuration selection menu. To change this, you can use the `@ConfigurationName` annotation. An example is given by the `DefaultConfiguration` and the `MassWalletConfiguration` classes.
|
|
|
|
|
|
|
|
*Note: The following might change in the next hours and days*
|
|
|
|
To issue a wallet to start a transaction with another wallet (i.e. to transfer money), you have to get a hand on an `ActorRef` for the wallet. These are stored in the `activeActors` property. To pick a random node, there is the `getRandomWallet` method, that does exactly what it says to do.
|
|
|
|
To issue a wallet to start a transaction with another wallet (i.e. to transfer money), you have to get a hand on an `ActorRef` for the involved wallets. These are stored in the `activeActors` property. To pick a random node, there is the `getRandomWallet` method, that does exactly what it says to do.
|
|
|
|
Now you can send an `ActionWalletSendMoney` to the initiator of the transaction, that gets the name of the receiver (You can obtain this by calling `receiver.path().name()`, if the receiving ActorRef is `receiver`) and the amount, the node should transfer.
|
|
|
|
|
|
|
|
*Note:* The configuration actor gets the name "Configuration" assigned on initialization. Thus your application will fail, if you want to create a new Actor with the same name.
|
|
|
|
|
|
|
|
After the selection of a configuration on system startup the following steps happen:
|
|
|
|
|
| ... | ... | |
| ... | ... | |