Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
mlibre committed Mar 20, 2024
1 parent 8e33285 commit fb75e84
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
6 changes: 3 additions & 3 deletions assets/keys/miner.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAqEUnAHh9P6SjBfuKtkd9IJNCOfNpB4wM1OqmdCVRXfw=\n-----END PUBLIC KEY-----\n",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIOw+1roRNIW5aATSvyjM/7f4Z7IdaVV8LrWfsicwsYN4\n-----END PRIVATE KEY-----\n",
"publicKeyString": "MCowBQYDK2VwAyEAqEUnAHh9P6SjBfuKtkd9IJNCOfNpB4wM1OqmdCVRXfw=\n"
"publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAqHmwUDgam2URP9fSmpdx0NyhPyFHskiiYTV+lKJhc9E=\n-----END PUBLIC KEY-----\n",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIPUF/bIOHKKM19IHRuQfyumKFyEpC1cZSge0lrqW+4D3\n-----END PRIVATE KEY-----\n",
"publicKeyString": "MCowBQYDK2VwAyEAqHmwUDgam2URP9fSmpdx0NyhPyFHskiiYTV+lKJhc9E=\n"
}
6 changes: 3 additions & 3 deletions assets/keys/user.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAM5Lp4d2SamIPHcY7vk5MM5wiEfv28NT5DkIA+0ZQbiU=\n-----END PUBLIC KEY-----\n",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIH+wUcGin04Wn3Fd0xJc7iw3lXpG5Ty+9W0UzJ6NASoV\n-----END PRIVATE KEY-----\n",
"publicKeyString": "MCowBQYDK2VwAyEAM5Lp4d2SamIPHcY7vk5MM5wiEfv28NT5DkIA+0ZQbiU=\n"
"publicKey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAzR6OYp/YYx53SgKEes7x5Wf61s+VQm7rQr51jK+DYwE=\n-----END PUBLIC KEY-----\n",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYDK2VwBCIEIFQzUVxXBDQx0Tz1HSEhemYStFr+SoHSX3zt+vC0XO5w\n-----END PRIVATE KEY-----\n",
"publicKeyString": "MCowBQYDK2VwAyEAzR6OYp/YYx53SgKEes7x5Wf61s+VQm7rQr51jK+DYwE=\n"
}
27 changes: 25 additions & 2 deletions library/db-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,38 @@
// will be also in git CustomElementRegistry, so commit 4 has 4 blocks in iteratee. each file a block. and a state file that kep the state until block 4


const simpleGit = require( "simple-git" );
const { execSync } = require( "child_process" );

class GitDatabase
{
constructor ( repoPath )
{
this.git = simpleGit( repoPath ).clean( simpleGit.CleanOptions.FORCE );
// const options = {
// baseDir: repoPath,
// binary: "git",
// maxConcurrentProcesses: 6,
// maxConcurrentGitProcesses: 1,
// timeout: 60000,
// verbose: true
// };
// this.git = simpleGit( options );
// this.git.clean( simpleGit.CleanOptions.FORCE )
this.initGitRepo( repoPath );
}

initGitRepo ( folderPath )
{
try
{
const output = execSync( "git init .", { cwd: folderPath, stdio: "inherit" });
console.log( "Git repository initialized ", output );
}
catch ( error )
{
console.error( `Failed to initialize Git repository in ${folderPath}:`, error );
}
}

async commit ( blockNumber )
{
await this.git.add( "." );
Expand Down

0 comments on commit fb75e84

Please sign in to comment.