Skip to content

Commit 273cf02

Browse files
Base structure created
0 parents  commit 273cf02

File tree

7 files changed

+1018
-0
lines changed

7 files changed

+1018
-0
lines changed

.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
RPC_HOST=127.0.0.1
2+
RPC_PORT=9702
3+
RPC_USER=multichainrpc
4+
RPC_PASSWORD=8R1EDnup9w6asWxVqTX1VNXrghTM2EwfSXCvGxwDmLJv
5+
6+
CHAIN_NAME=chain1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
vendor
3+
oldindex.php

Config.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
use CodeArchitect\Framework\Private\MultiChainClient;
4+
5+
require 'vendor/autoload.php';
6+
class Config
7+
{
8+
9+
public function __construct()
10+
{
11+
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
12+
$dotenv->load();
13+
$dotenv->required(['RPC_HOST', 'RPC_PORT', 'RPC_USER', 'RPC_PASSWORD']);
14+
}
15+
16+
public function instance(): MultiChainClient
17+
{
18+
// return new MultiChainClient( $this->RPC_host, $this->RPC_port, $this->RPC_user, $this->RPC_password);
19+
return new MultiChainClient( $_ENV['RPC_HOST'], $_ENV['RPC_PORT'], $_ENV['RPC_USER'], $_ENV['RPC_PASSWORD']);
20+
}
21+
22+
public function getChainName()
23+
{
24+
return $_ENV["CHAIN_NAME"];
25+
}
26+
}

composer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "indranil/code-architect",
3+
"description": "Multichain blockchain helper library",
4+
"require": {
5+
"vlucas/phpdotenv": "^5.5",
6+
"symfony/var-dumper": "^6.3"
7+
},
8+
"autoload": {
9+
"psr-4": {
10+
"CodeArchitect\\Framework\\": "core/"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)