mirror of
https://repo.getmonero.org/AnonDev/xmrmemes.git
synced 2025-01-04 20:30:55 -05:00
37 lines
1.3 KiB
PHP
37 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use MoneroIntegrations\MoneroPhp\walletRPC;
|
|
|
|
class AddressSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
try {
|
|
$walletRPC = new walletRPC('127.0.0.1', config('app.xmr_network_port')); // Change to match your wallet (monero-wallet-rpc) IP address and port; 18083 is the customary port for mainnet, 28083 for testnet, 38083 for stagenet
|
|
$create_wallet = $walletRPC->create_wallet(config('app.xmr_wallet_name'), ''); // Creates a new wallet named memes with no passphrase. Comment this line and edit the next line to use your own wallet
|
|
} catch (\Exception $e) {
|
|
dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
$open_wallet = $walletRPC->open_wallet(config('app.xmr_wallet_name'), '');
|
|
for ($i=0; $i < 100; $i++) {
|
|
$create_address = $walletRPC->create_address(0, 'Example');
|
|
}
|
|
$get_address = $walletRPC->get_address();
|
|
\DB::table('addresses')->insertOrIgnore($get_address['addresses']);
|
|
$walletRPC->close_wallet();
|
|
} catch (\Exception $e) {
|
|
dump($e->getMessage());
|
|
}
|
|
}
|
|
}
|