You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# SmartGitAnchor
2
2
3
3
## Overview
4
-
`SmartGitAnchor` is a Node.js package designed for the automated computation and secure transmission of file hashes. It is ideal for integrating into CI/CD pipelines, where ensuring the integrity of files in a repository is crucial. The package generates SHA-256 hashesfor files and sends these hashes to a specified API endpoint.
4
+
`SmartGitAnchor` is a Node.js package designed for automated computation and secure transmission of file hashes, with a particular focus on blockchain technologies like `Tezos` and `Ethereum`. It's ideal for CI/CD pipelines, especially in blockchain development projects, where verifying the integrity of files against a `Merkle tree` generated hash root is crucial. The package generates SHA-256 hashes, a standard in blockchain hash functions, for files and securely transmits these to a specified API endpoint.
5
5
6
6
## How It Works
7
7
This package works by scanning all files within a specified directory, computing their SHA-256 hashes, and then sending these hashes in a JSON payload to a designated secure API endpoint. It leverages environment variables for configuration, ensuring flexibility and ease of integration into various workflows.
@@ -13,17 +13,14 @@ This package works by scanning all files within a specified directory, computing
13
13
- A GitHub repository where the package will be implemented
14
14
- A secure API endpoint that will receive the file hashes (see [Secure API Endpoint Setup](#secure-api-endpoint-setup))
15
15
16
-
###Installation
16
+
## Installation and Setup (GitHub Actions Workflow)
17
17
Install `SmartGitAnchor` via npm with the following command:
18
18
19
19
```bash
20
20
npm install @smart-chain-fr/SmartGitAnchor
21
21
```
22
22
23
-
## GitHub Actions Workflow Setup
24
-
The following steps will guide you through the process of setting up a GitHub Actions workflow that will automatically compute and send file hashes to an API endpoint.
25
-
26
-
### Step 1: Create a GitHub Actions Workflow
23
+
### Create a GitHub Actions Workflow
27
24
28
25
To utilize SmartGitAnchor within your GitHub Actions workflow, follow these steps to set up the .github/workflows YAML file in your project. this is an example of a workflow that will compute and send file hashes to an API endpoint when a push event occurs:
set the following secrets in your GitHub repository:
55
52
@@ -58,7 +55,7 @@ set the following secrets in your GitHub repository:
58
55
- `FILES_PATH`: The path to the directory containing the files whose hashes will be computed
59
56
- `CALLBACK_URL`(optional): The URL callback that will be used to send the response from the API endpoint
60
57
61
-
### Step 3: Usage
58
+
### Workflow Explanation
62
59
63
60
Once the workflow is set up, the hashes of the files in the specified directory will be computed and sent to the API endpoint. The API endpoint will then respond with a JSON payload containing the hashes of the files. If a callback URL is specified, the response from the API endpoint will be sent to the callback URL.
64
61
@@ -68,21 +65,27 @@ Secure API, part of the [Bloom](https://3loom.io/) suite, that allows you to rec
68
65
69
66
## Command Line Interface (CLI) Usage
70
67
68
+
### installation
69
+
70
+
```bash
71
+
npm install @smart-chain-fr/smartgitanchor -g
72
+
```
73
+
71
74
### Usage
72
75
73
76
```bash
74
77
smartgitanchor [options]
75
78
```
76
79
options:
77
80
- `--callbackUrl`: The URL callback that will be used to send the response from the API endpoint
78
-
- `--secureApi`: The URL of the API endpoint that will receive the file hashes (required)
81
+
- `--apiUrl`: The URL of the API endpoint that will receive the file hashes (required)
79
82
- `--apiKey`: The API key that will be used to authenticate the request to the API endpoint (required)
80
83
- `--filesPath`: The path to the directory containing the files whose hashes will be computed (required)
Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "@smart-chain-fr/smartgitanchor",
3
-
"version": "1.1.2",
4
-
"description": "SmartGitAnchor is a versatile Node.js package designed for computing and securely transmitting file hashes.",
3
+
"version": "1.1.3",
4
+
"description": "SmartGitAnchor is a versatile Node.js package designed for computing and securely transmitting file hashes. It is used to anchor files on the Tezos or Ethereum blockchains.",
0 commit comments