-
Notifications
You must be signed in to change notification settings - Fork 20
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 #909 from golemfactory/grisha87/clean-arch
Refactoring toward clean architecture
- Loading branch information
Showing
113 changed files
with
4,992 additions
and
3,848 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { GolemNetwork } from "@golem-sdk/golem-js"; | ||
import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; | ||
|
||
(async () => { | ||
const glm = new GolemNetwork({ | ||
logger: pinoPrettyLogger({ | ||
level: "debug", | ||
}), | ||
}); | ||
|
||
try { | ||
await glm.connect(); | ||
|
||
const lease = await glm.oneOf({ | ||
demand: { | ||
imageTag: "golem/alpine:latest", | ||
minCpuCores: 4, | ||
minMemGib: 8, | ||
minStorageGib: 16, | ||
}, | ||
market: { | ||
rentHours: 12, | ||
pricing: { | ||
maxStartPrice: 1, | ||
maxCpuPerHourPrice: 1, | ||
maxEnvPerHourPrice: 1, | ||
}, | ||
}, | ||
payment: { | ||
driver: "erc20", | ||
network: "holesky", | ||
}, | ||
}); | ||
|
||
const exe = await lease.getExeUnit(); | ||
|
||
const result = await exe.run("echo 'Hello World!'"); | ||
console.log(result.stdout); | ||
|
||
// Wait for the lease to be fully terminated and settled | ||
await lease.finalize(); | ||
} catch (err) { | ||
console.error("Failed to run the example", err); | ||
} | ||
|
||
await glm.disconnect(); | ||
})().catch(console.error); |
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
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
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
Oops, something went wrong.