-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DripDropz/wallet_auth
Wallet authentication support
- Loading branch information
Showing
6,507 changed files
with
1,839,064 additions
and
319 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,13 @@ | |
- Clone repo `git clone [email protected]:DripDropz/RewardEngine.git` | ||
- Switch to repo dir `cd $HOME/Desktop/RewardEngine` | ||
- Copy `.env.example` as `.env` (then make necessary changes to `.env` file) | ||
- Run `make buid` to build & start the containers | ||
- Run `make build` to build & start the containers | ||
- Application should be running locally at `http://localhost:8200` | ||
|
||
### Available Make Commands (Local Development) | ||
* `frontend-build` Rebuild frontend | ||
* `frontend-watch` Runs `npm run dev` (vite watch/hot-reload mode) inside _rewardengine-web_ container | ||
* `frontend-upgrade` Upgrades npm packages inside _rewardengine-web_ container | ||
* `up` Restart all docker containers | ||
* `down` Shutdown all docker containers | ||
* `build` Rebuilds all docker containers | ||
|
@@ -26,6 +29,7 @@ | |
* `status` View the status of all running containers | ||
* `logs` View the logs out of all running containers | ||
* `logs-web` View the logs out of `rewardengine-web` container only | ||
* `logs-cardano-sidecar` View the logs out of `rewardengine-cardano-sidecar` container only | ||
* `shell` Drop into an interactive shell inside _rewardengine-web_ container | ||
* `stats` View the resource usage of all running containers | ||
* `artisan` Execute Laravel `artisan` command inside _rewardengine-web_ container (e.g. usage: `make artisan COMMAND="make:model MyModel -m"`) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
application/app/Console/Commands/SyncHydraDoomGlobalStatsCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Jobs\HydraDoomEventParserJob; | ||
use App\Models\EventData; | ||
use App\Traits\LogExceptionTrait; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Http; | ||
use Illuminate\Support\Str; | ||
use Throwable; | ||
|
||
class SyncHydraDoomGlobalStatsCommand extends Command | ||
{ | ||
use LogExceptionTrait; | ||
|
||
private const PROJECT_ID = 1; | ||
private const API_ENDPOINT = 'https://api.us-east-1.hydra-doom.sundae.fi/global_stats'; | ||
|
||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'app:sync-hydra-doom-global-stats-command'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Ingests hydra doom global stats'; | ||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle(): void | ||
{ | ||
try { | ||
|
||
$response = Http::timeout(30) | ||
->connectTimeout(30) | ||
->get(static::API_ENDPOINT) | ||
->throw(); | ||
|
||
if ($response->successful()) { | ||
|
||
$eventData = EventData::create([ | ||
'project_id' => static::PROJECT_ID, | ||
'event_id' => Str::uuid()->toString(), | ||
'timestamp' => time(), | ||
'data' => [ | ||
'type' => 'global', | ||
'stats' => $response->json(), | ||
], | ||
]); | ||
|
||
dispatch(new HydraDoomEventParserJob($eventData)); | ||
|
||
} | ||
|
||
} catch (Throwable $exception) { | ||
|
||
$message = 'Failed to ingests hydra doom global stats'; | ||
|
||
$this->logException($message, $exception); | ||
|
||
$this->error(sprintf('%s: %s', $message, $exception->getMessage())); | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.