Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.0.1 alpha.43 #40

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.1-alpha.43](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.42...v0.0.1-alpha.43) (2024-09-20)


### Features

* temp disable ssl on content server driver while ssl bug figured out ([1b55a5c](https://github.com/DIG-Network/dig-chia-sdk/commit/1b55a5c7b38bf83afee529c727b0f040d69e30ae))

### [0.0.1-alpha.42](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.41...v0.0.1-alpha.42) (2024-09-19)

### [0.0.1-alpha.41](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.40...v0.0.1-alpha.41) (2024-09-19)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dignetwork/dig-sdk",
"version": "0.0.1-alpha.42",
"version": "0.0.1-alpha.43",
"description": "",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down
16 changes: 8 additions & 8 deletions src/DigNetwork/ContentServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ContentServer {
// Method to get the content of a specified key from the peer, with optional challenge query
public async getKey(key: string, rootHash: string, challengeHex?: string): Promise<string> {
// Construct the base URL
let url = `https://${this.ipAddress}/chia.${this.storeId}.${rootHash}/${key}`;
let url = `http://${this.ipAddress}/chia.${this.storeId}.${rootHash}/${key}`;

// If a challenge is provided, append it as a query parameter
if (challengeHex) {
Expand All @@ -52,33 +52,33 @@ export class ContentServer {

// Method to get the .well-known information
public async getWellKnown(): Promise<any> {
const url = `https://${this.ipAddress}/.well-known`;
const url = `http://${this.ipAddress}/.well-known`;
return this.fetchJson(url);
}

// Method to get the list of known stores
public async getKnownStores(): Promise<any> {
const url = `https://${this.ipAddress}/.well-known/stores`;
const url = `http://${this.ipAddress}/.well-known/stores`;
return this.fetchJson(url);
}

// Method to get the index of all stores
public async getStoresIndex(): Promise<any> {
const url = `https://${this.ipAddress}/`;
const url = `http://${this.ipAddress}/`;
return this.fetchJson(url);
}

// Method to get the index of keys in a store
public async getKeysIndex(): Promise<any> {
const url = `https://${this.ipAddress}/${this.storeId}`;
const url = `http://${this.ipAddress}/${this.storeId}`;
return this.fetchJson(url);
}

// Method to check if a specific key exists (HEAD request)
public async headKey(
key: string
): Promise<{ success: boolean; headers?: http.IncomingHttpHeaders }> {
const url = `https://${this.ipAddress}/${this.storeId}/${key}`;
const url = `http://${this.ipAddress}/${this.storeId}/${key}`;
return this.head(url);
}

Expand All @@ -87,7 +87,7 @@ export class ContentServer {
success: boolean;
headers?: http.IncomingHttpHeaders;
}> {
let url = `https://${this.ipAddress}/${this.storeId}`;
let url = `http://${this.ipAddress}/${this.storeId}`;

if (options?.hasRootHash) {
url += `?hasRootHash=${options.hasRootHash}`;
Expand All @@ -98,7 +98,7 @@ export class ContentServer {

public streamKey(key: string): Promise<Readable> {
return new Promise((resolve, reject) => {
const url = `https://${this.ipAddress}/${this.storeId}/${key}`;
const url = `http://${this.ipAddress}/${this.storeId}/${key}`;
const urlObj = new URL(url);

const requestOptions = {
Expand Down
Loading