From 8a802bc5f340cefcb72c5c76fbfce463e2fba934 Mon Sep 17 00:00:00 2001 From: Phillip Jensen Date: Fri, 28 Jun 2024 15:29:04 +0200 Subject: [PATCH 1/8] WIP --- next.config.mjs | 9 +- src/components/Footer.jsx | 149 ++-- src/components/Layout.jsx | 17 +- src/components/Navigation.jsx | 29 +- src/markdoc/search.mjs | 28 +- src/navigation/docs.ja.js | 707 ++++++++++++++++ .../creators/common/providers-filesystem.md | 0 .../common/requestor-provider-interaction.md | 0 .../creators/dapps/creating-golem-dapps.md | 0 .../dapps/docker-containers-vs-golem-vms.md | 0 .../docs/creators/dapps/hello-world-dapp.md | 0 .../{ => en}/docs/creators/dapps/index.md | 0 .../creators/dapps/managing-multiple-dapps.md | 0 .../docs/creators/dapps/run-a-dapp.md | 0 src/pages/{ => en}/docs/creators/index.md | 0 .../javascript/examples/accessing-internet.md | 0 .../javascript/examples/composing-tasks.md | 0 .../javascript/examples/executing-tasks.md | 0 .../creators/javascript/examples/index.md | 0 .../examples/selecting-providers.md | 0 .../examples/switching-to-mainnet.md | 0 .../javascript/examples/transferring-data.md | 0 .../javascript/examples/using-app-keys.md | 0 .../examples/working-with-events.md | 0 .../examples/working-with-images.md | 0 .../examples/working-with-results.md | 0 .../javascript/guides/accessing-internet.md | 0 .../javascript/guides/error-handling.md | 0 .../javascript/guides/golem-images-faq.md | 0 .../javascript/guides/golem-images.md | 0 .../javascript/guides/golem-sdk-cli.md | 0 .../docs/creators/javascript/guides/index.md | 0 .../javascript/guides/retrievable-tasks.md | 0 .../javascript/guides/switching-to-mainnet.md | 0 .../creators/javascript/guides/task-model.md | 0 .../docs/creators/javascript/index.md | 0 .../quickstarts/golem-in-a-browser.md | 0 .../creators/javascript/quickstarts/index.md | 0 .../javascript/quickstarts/quickstart.md | 0 .../quickstarts/retrievable-task.md | 0 .../react/api-reference-overview.md | 0 .../javascript/react/getting-started.md | 0 .../docs/creators/javascript/react/index.md | 0 .../creators/javascript/react/use-executor.md | 0 .../javascript/react/use-handle-invoice.md | 0 .../creators/javascript/react/use-invoices.md | 0 .../creators/javascript/react/use-task.md | 0 .../creators/javascript/react/use-yagna.md | 0 .../javascript/react/yagna-provider.md | 0 .../tutorials/accessing-internet.md | 0 .../tutorials/building-custom-image.md | 0 .../creators/javascript/tutorials/index.md | 0 .../tutorials/quickstart-explained.md | 0 .../tutorials/rest-api-with-express.md | 0 .../tutorials/running-in-browser.md | 0 .../tutorials/running-parallel-tasks.md | 0 .../tutorials/testing-golem-image.md | 0 .../examples/tools/self-hosted-vm-images.md | 0 .../python/guides/application-fundamentals.md | 0 .../docs/creators/python/guides/debugging.md | 0 .../python/guides/golem-images-faq.md | 0 .../creators/python/guides/golem-images.md | 0 .../docs/creators/python/guides/index.md | 0 .../creators/python/guides/service-model.md | 0 .../python/guides/switching-to-mainnet.md | 0 .../docs/creators/python/guides/task-model.md | 0 .../docs/creators/python/guides/vpn.md | 0 .../{ => en}/docs/creators/python/index.md | 0 .../quickstarts/run-first-task-on-golem.md | 0 .../python/tutorials/building-custom-image.md | 0 .../docs/creators/python/tutorials/index.md | 0 .../service-example-0-hello-world.md | 0 .../service-example-1-simple-service.md | 0 .../service-example-2-vpn-ssh-terminal.md | 0 ...service-example-3-vpn-simple-http-proxy.md | 0 ...service-example-4-custom-usage-counters.md | 0 .../tutorials/service-example-5-webapp.md | 0 .../service-example-6-external-api-request.md | 0 .../python/tutorials/task-example-0-hello.md | 0 .../tutorials/task-example-1-cracker.md | 0 .../tutorials/task-example-2-hashcat.md | 0 .../python/tutorials/testing-golem-image.md | 0 .../ray/basic-ray-tasks-usage-tutorial.md | 0 .../docs/creators/ray/cluster-yaml.md | 0 .../conversion-to-ray-on-golem-tutorial.md | 0 src/pages/{ => en}/docs/creators/ray/index.md | 0 .../{ => en}/docs/creators/ray/mainnet.md | 0 .../{ => en}/docs/creators/ray/outbound.md | 0 .../{ => en}/docs/creators/ray/quickstart.md | 0 .../{ => en}/docs/creators/ray/ray-cli.md | 0 .../docs/creators/ray/ray-on-golem-cli.md | 0 .../docs/creators/ray/setup-tutorial.md | 0 ...upported-versions-and-other-limitations.md | 0 .../docs/creators/ray/troubleshooting.md | 0 .../docs/creators/tools/goth/index.md | 0 .../docs/creators/tools/goth/running-goth.md | 0 .../goth/running-goths-interactive-mode.md | 0 ...converting-docker-image-to-golem-format.md | 0 .../tools/gvmkit/gvmkit-build-installation.md | 0 .../docs/creators/tools/gvmkit/index.md | 0 .../tools/gvmkit/publishing-custom-images.md | 0 .../tools/yagna/golem-wallet-backup.md | 0 .../docs/creators/tools/yagna/index.md | 0 .../tools/yagna/managing-golem-wallet.md | 0 .../tools/yagna/requestor-uninstallation.md | 0 .../tools/yagna/restoring-golem-wallet.md | 0 .../yagna-installation-for-requestors.md | 0 .../tools/yagna/yagna-mostly-used-commands.md | 0 src/pages/{ => en}/docs/degenhack/index.md | 0 .../docs/degenhack/mainnet-version.md | 0 .../docs/golem-js/reference/.nojekyll | 0 .../docs/golem-js/reference/README.md | 0 .../classes/activity_activity.Activity.md | 0 .../classes/activity_results.Result.md | 0 .../agreement_service.AgreementCandidate.md | 0 .../error_golem_error.GolemAbortError.md | 0 .../error_golem_error.GolemConfigError.md | 0 .../classes/error_golem_error.GolemError.md | 0 .../error_golem_error.GolemInternalError.md | 0 .../error_golem_error.GolemModuleError.md | 0 .../error_golem_error.GolemPlatformError.md | 0 .../error_golem_error.GolemTimeoutError.md | 0 .../error_golem_error.GolemUserError.md | 0 .../classes/events_events.ActivityCreated.md | 0 .../events_events.ActivityDestroyed.md | 0 .../events_events.ActivityStateChanged.md | 0 .../events_events.AgreementConfirmed.md | 0 .../classes/events_events.AgreementCreated.md | 0 .../events_events.AgreementRejected.md | 0 .../events_events.AgreementTerminated.md | 0 .../events_events.AllocationCreated.md | 0 .../classes/events_events.BaseEvent.md | 0 .../classes/events_events.CollectFailed.md | 0 .../events_events.ComputationFailed.md | 0 .../events_events.ComputationFinished.md | 0 .../events_events.ComputationStarted.md | 0 .../events_events.DebitNoteAccepted.md | 0 .../events_events.DebitNoteReceived.md | 0 .../classes/events_events.DemandFailed.md | 0 .../classes/events_events.DemandSubscribed.md | 0 .../events_events.DemandUnsubscribed.md | 0 .../classes/events_events.InvoiceReceived.md | 0 .../classes/events_events.PackageCreated.md | 0 .../classes/events_events.PaymentAccepted.md | 0 .../classes/events_events.PaymentFailed.md | 0 .../events_events.ProposalConfirmed.md | 0 .../classes/events_events.ProposalFailed.md | 0 .../classes/events_events.ProposalReceived.md | 0 .../classes/events_events.ProposalRejected.md | 0 .../events_events.ProposalResponded.md | 0 .../classes/events_events.ScriptExecuted.md | 0 .../classes/events_events.ScriptSent.md | 0 .../classes/events_events.TaskFinished.md | 0 .../classes/events_events.TaskRedone.md | 0 .../classes/events_events.TaskRejected.md | 0 .../classes/events_events.TaskStarted.md | 0 .../classes/executor_executor.TaskExecutor.md | 0 ...olem_network_golem_network.GolemNetwork.md | 0 .../golem-js/reference/classes/job_job.Job.md | 0 .../classes/market_error.GolemMarketError.md | 0 .../classes/market_proposal.Proposal.md | 0 .../market_proposals_batch.ProposalsBatch.md | 0 .../network_error.GolemNetworkError.md | 0 .../classes/network_node.NetworkNode.md | 0 .../classes/package_package.Package.md | 0 ...yment_InvoiceProcessor.InvoiceProcessor.md | 0 ...payment_process.AgreementPaymentProcess.md | 0 .../payment_error.GolemPaymentError.md | 0 .../classes/payment_payments.Payments.md | 0 .../classes/script_command.DownloadData.md | 0 .../classes/script_command.Terminate.md | 0 .../classes/script_command.UploadData.md | 0 .../storage_gftp.GftpStorageProvider.md | 0 .../storage_null.NullStorageProvider.md | 0 ...browser.WebSocketBrowserStorageProvider.md | 0 .../reference/classes/task_batch.Batch.md | 0 .../classes/task_error.GolemWorkError.md | 0 .../classes/task_process.RemoteProcess.md | 0 .../reference/classes/task_task.Task.md | 0 .../classes/task_work.WorkContext.md | 0 .../utils_yagna_activity.RequestorApi.md | 0 .../classes/utils_yagna_gsb.RequestorApi.md | 0 .../utils_yagna_identity.RequestorApi.md | 0 .../classes/utils_yagna_yagna.Yagna.md | 0 .../docs/golem-js/reference/default-values.md | 0 .../activity_activity.ActivityStateEnum.md | 0 .../enums/market_error.MarketErrorCode.md | 0 .../enums/network_error.NetworkErrorCode.md | 0 .../enums/payment_error.PaymentErrorCode.md | 0 .../enums/task_error.WorkErrorCode.md | 0 .../reference/enums/task_task.TaskState.md | 0 .../activity_activity.ActivityOptions.md | 0 .../activity_activity.ExeScriptRequest.md | 0 .../interfaces/activity_results.ResultData.md | 0 .../activity_results.RuntimeEventKind.md | 0 .../activity_results.StreamingBatchEvent.md | 0 .../agreement_agreement.ProviderInfo.md | 0 .../agreement_service.AgreementDTO.md | 0 ...reement_service.AgreementServiceOptions.md | 0 .../executor_events.TaskExecutorEventsDict.md | 0 .../interfaces/job_job.JobEventsDict.md | 0 .../interfaces/market_demand.DemandDetails.md | 0 .../interfaces/market_demand.DemandOptions.md | 0 .../market_proposal.ProposalDetails.md | 0 .../market_service.MarketOptions.md | 0 .../interfaces/network_network.NetworkInfo.md | 0 .../package_package.PackageDetails.md | 0 .../payment_config.BasePaymentOptions.md | 0 .../payment_debit_note.DebitNoteDTO.md | 0 .../interfaces/payment_invoice.InvoiceDTO.md | 0 .../payment_payments.PaymentOptions.md | 0 .../payment_service.PaymentOptions.md | 0 .../storage_provider.StorageProvider.md | 0 ...browser.WebSocketStorageProviderOptions.md | 0 .../task_service.TaskServiceOptions.md | 0 .../interfaces/task_work.CommandOptions.md | 0 .../interfaces/task_work.WorkOptions.md | 0 .../interfaces/utils_logger_logger.Logger.md | 0 .../utils_yagna_identity.IdentityModel.md | 0 .../docs/golem-js/reference/modules.md | 0 .../reference/modules/activity_activity.md | 0 .../reference/modules/activity_results.md | 0 .../reference/modules/agreement_agreement.md | 0 .../reference/modules/agreement_service.md | 0 .../reference/modules/agreement_strategy.md | 0 .../reference/modules/error_golem_error.md | 0 .../reference/modules/events_events.md | 0 .../reference/modules/executor_events.md | 0 .../reference/modules/executor_executor.md | 0 .../modules/golem_network_golem_network.md | 0 .../golem-js/reference/modules/job_job.md | 0 .../reference/modules/market_builder.md | 0 .../reference/modules/market_demand.md | 0 .../reference/modules/market_error.md | 0 .../reference/modules/market_helpers.md | 0 .../reference/modules/market_proposal.md | 0 .../modules/market_proposals_batch.md | 0 .../reference/modules/market_service.md | 0 .../reference/modules/market_strategy.md | 0 .../reference/modules/network_error.md | 0 .../reference/modules/network_network.md | 0 .../reference/modules/network_node.md | 0 .../reference/modules/network_service.md | 0 .../reference/modules/package_package.md | 0 .../modules/payment_InvoiceProcessor.md | 0 .../payment_agreement_payment_process.md | 0 .../reference/modules/payment_config.md | 0 .../reference/modules/payment_debit_note.md | 0 .../reference/modules/payment_error.md | 0 .../reference/modules/payment_invoice.md | 0 .../reference/modules/payment_payments.md | 0 .../reference/modules/payment_service.md | 0 .../reference/modules/payment_strategy.md | 0 .../reference/modules/script_command.md | 0 .../reference/modules/storage_gftp.md | 0 .../reference/modules/storage_null.md | 0 .../reference/modules/storage_provider.md | 0 .../reference/modules/storage_ws_browser.md | 0 .../golem-js/reference/modules/task_batch.md | 0 .../golem-js/reference/modules/task_error.md | 0 .../reference/modules/task_process.md | 0 .../reference/modules/task_service.md | 0 .../golem-js/reference/modules/task_task.md | 0 .../golem-js/reference/modules/task_work.md | 0 .../golem-js/reference/modules/utils_env.md | 0 .../modules/utils_logger_defaultLogger.md | 0 .../modules/utils_logger_jsonLogger.md | 0 .../reference/modules/utils_logger_logger.md | 0 .../modules/utils_logger_nullLogger.md | 0 .../modules/utils_logger_pinoLogger.md | 0 .../modules/utils_runtimeContextChecker.md | 0 .../golem-js/reference/modules/utils_types.md | 0 .../reference/modules/utils_yagna_activity.md | 0 .../reference/modules/utils_yagna_gsb.md | 0 .../reference/modules/utils_yagna_identity.md | 0 .../reference/modules/utils_yagna_yagna.md | 0 .../docs/golem-js/reference/overview.md | 0 .../reference/.nojekyll | 0 .../reference/README.md | 0 .../classes/executor.TaskExecutor.md | 0 .../reference/classes/task.Task.md | 0 .../reference/default-values.md | 0 .../reference/enums/task.TaskState.md | 0 .../events.TaskExecutorEventsDict.md | 0 .../interfaces/service.TaskServiceOptions.md | 0 .../reference/interfaces/task.ProviderInfo.md | 0 .../reference/modules.md | 0 .../reference/modules/events.md | 0 .../reference/modules/executor.md | 0 .../reference/modules/service.md | 0 .../reference/modules/task.md | 0 .../reference/modules/types.md | 0 .../reference/modules/utils.md | 0 .../reference/overview.md | 0 src/pages/{ => en}/docs/golem/index.md | 0 .../{ => en}/docs/golem/migrate/guideline.md | 0 .../{ => en}/docs/golem/migrate/terms.md | 0 .../docs/golem/overview/golem-token.md | 0 .../{ => en}/docs/golem/overview/index.md | 0 .../{ => en}/docs/golem/overview/provider.md | 0 .../docs/golem/overview/requestor-faq.md | 0 .../{ => en}/docs/golem/overview/requestor.md | 0 .../docs/golem/overview/testnet-mainnet.md | 0 .../computation-payload-manifest.schema.md | 0 .../docs/golem/payload-manifest/index.md | 0 .../golem/payments/golem-token-conversion.md | 0 .../{ => en}/docs/golem/payments/index.md | 0 .../docs/golem/payments/layer-2-payments.md | 0 src/pages/{ => en}/docs/golem/terms.md | 0 src/pages/en/docs/index.jsx | 26 + .../docs/providers/configuration/general.md | 0 .../docs/providers/configuration/outbound.md | 0 .../docs/providers/gpu/gpu-golem-live.md | 0 src/pages/{ => en}/docs/providers/index.md | 0 .../{ => en}/docs/providers/maintenance.md | 0 .../{ => en}/docs/providers/provider-faq.md | 0 .../docs/providers/provider-installation.md | 0 .../docs/providers/provider-uninstallation.md | 0 .../{ => en}/docs/providers/wallet/backup.md | 0 .../docs/providers/wallet/restoration.md | 0 .../docs/quickstarts/golem-in-a-browser.md | 0 src/pages/{ => en}/docs/quickstarts/index.md | 0 .../docs/quickstarts/js-quickstart.md | 0 .../quickstarts/no-code-app-deployment.md | 0 .../docs/quickstarts/python-quickstart.md | 0 .../docs/quickstarts/ray-quickstart.md | 0 .../docs/quickstarts/retrievable-task.md | 0 .../reputation/finding-the-best-providers.md | 0 src/pages/{ => en}/docs/reputation/index.md | 0 .../reputation-api-swagger-ui-v1.md | 0 .../reputation-api-swagger-ui-v2.md | 0 .../using-reputation-with-nodejs.md | 0 src/pages/{ => en}/docs/templates/demo.md | 0 .../docs/templates/example-template.md | 0 .../{ => en}/docs/templates/guide-template.md | 0 .../{ => en}/docs/templates/index-template.md | 0 .../docs/templates/tutorial-template.md | 0 .../docs/troubleshooting/dapps/index.md | 0 .../docs/troubleshooting/javascript/index.md | 0 .../js-requestor/exit-codes.md | 0 .../troubleshooting/js-requestor/index.md | 0 .../docs/troubleshooting/provider/index.md | 0 .../docs/troubleshooting/yagna/index.md | 0 .../creators/common/providers-filesystem.md | 86 ++ .../common/requestor-provider-interaction.md | 293 +++++++ .../creators/dapps/creating-golem-dapps.md | 366 +++++++++ .../dapps/docker-containers-vs-golem-vms.md | 55 ++ .../docs/creators/dapps/hello-world-dapp.md | 425 ++++++++++ src/pages/ja/docs/creators/dapps/index.md | 78 ++ .../creators/dapps/managing-multiple-dapps.md | 301 +++++++ .../ja/docs/creators/dapps/run-a-dapp.md | 9 + src/pages/ja/docs/creators/index.md | 69 ++ .../javascript/examples/accessing-internet.md | 140 ++++ .../javascript/examples/composing-tasks.md | 146 ++++ .../javascript/examples/executing-tasks.md | 129 +++ .../creators/javascript/examples/index.md | 34 + .../examples/selecting-providers.md | 101 +++ .../examples/switching-to-mainnet.md | 45 ++ .../javascript/examples/transferring-data.md | 127 +++ .../javascript/examples/using-app-keys.md | 120 +++ .../examples/working-with-events.md | 46 ++ .../examples/working-with-images.md | 72 ++ .../examples/working-with-results.md | 109 +++ .../javascript/guides/accessing-internet.md | 66 ++ .../javascript/guides/error-handling.md | 126 +++ .../javascript/guides/golem-images-faq.md | 59 ++ .../javascript/guides/golem-images.md | 93 +++ .../javascript/guides/golem-sdk-cli.md | 154 ++++ .../docs/creators/javascript/guides/index.md | 20 + .../javascript/guides/retrievable-tasks.md | 220 +++++ .../javascript/guides/switching-to-mainnet.md | 127 +++ .../creators/javascript/guides/task-model.md | 129 +++ .../ja/docs/creators/javascript/index.md | 22 + .../quickstarts/golem-in-a-browser.md | 10 + .../creators/javascript/quickstarts/index.md | 13 + .../javascript/quickstarts/quickstart.md | 10 + .../quickstarts/retrievable-task.md | 8 + .../react/api-reference-overview.md | 18 + .../javascript/react/getting-started.md | 109 +++ .../docs/creators/javascript/react/index.md | 47 ++ .../creators/javascript/react/use-executor.md | 75 ++ .../javascript/react/use-handle-invoice.md | 63 ++ .../creators/javascript/react/use-invoices.md | 87 ++ .../creators/javascript/react/use-task.md | 46 ++ .../creators/javascript/react/use-yagna.md | 44 + .../javascript/react/yagna-provider.md | 37 + .../tutorials/accessing-internet.md | 203 +++++ .../tutorials/building-custom-image.md | 146 ++++ .../creators/javascript/tutorials/index.md | 18 + .../tutorials/quickstart-explained.md | 130 +++ .../tutorials/rest-api-with-express.md | 376 +++++++++ .../tutorials/running-in-browser.md | 260 ++++++ .../tutorials/running-parallel-tasks.md | 371 +++++++++ .../tutorials/testing-golem-image.md | 163 ++++ .../examples/tools/self-hosted-vm-images.md | 69 ++ .../python/guides/application-fundamentals.md | 108 +++ .../docs/creators/python/guides/debugging.md | 293 +++++++ .../python/guides/golem-images-faq.md | 56 ++ .../creators/python/guides/golem-images.md | 94 +++ .../ja/docs/creators/python/guides/index.md | 45 ++ .../creators/python/guides/service-model.md | 169 ++++ .../python/guides/switching-to-mainnet.md | 122 +++ .../docs/creators/python/guides/task-model.md | 60 ++ .../ja/docs/creators/python/guides/vpn.md | 69 ++ src/pages/ja/docs/creators/python/index.md | 32 + .../quickstarts/run-first-task-on-golem.md | 10 + .../python/tutorials/building-custom-image.md | 214 +++++ .../docs/creators/python/tutorials/index.md | 33 + .../service-example-0-hello-world.md | 274 +++++++ .../service-example-1-simple-service.md | 386 +++++++++ .../service-example-2-vpn-ssh-terminal.md | 209 +++++ ...service-example-3-vpn-simple-http-proxy.md | 286 +++++++ ...service-example-4-custom-usage-counters.md | 277 +++++++ .../tutorials/service-example-5-webapp.md | 454 +++++++++++ .../service-example-6-external-api-request.md | 183 +++++ .../python/tutorials/task-example-0-hello.md | 284 +++++++ .../tutorials/task-example-1-cracker.md | 693 ++++++++++++++++ .../tutorials/task-example-2-hashcat.md | 760 ++++++++++++++++++ .../python/tutorials/testing-golem-image.md | 162 ++++ .../ray/basic-ray-tasks-usage-tutorial.md | 138 ++++ .../ja/docs/creators/ray/cluster-yaml.md | 258 ++++++ .../conversion-to-ray-on-golem-tutorial.md | 333 ++++++++ src/pages/ja/docs/creators/ray/index.md | 90 +++ src/pages/ja/docs/creators/ray/mainnet.md | 128 +++ src/pages/ja/docs/creators/ray/outbound.md | 218 +++++ src/pages/ja/docs/creators/ray/quickstart.md | 15 + src/pages/ja/docs/creators/ray/ray-cli.md | 28 + .../ja/docs/creators/ray/ray-on-golem-cli.md | 125 +++ .../ja/docs/creators/ray/setup-tutorial.md | 162 ++++ ...upported-versions-and-other-limitations.md | 41 + .../ja/docs/creators/ray/troubleshooting.md | 285 +++++++ .../ja/docs/creators/tools/goth/index.md | 61 ++ .../docs/creators/tools/goth/running-goth.md | 196 +++++ .../goth/running-goths-interactive-mode.md | 66 ++ ...converting-docker-image-to-golem-format.md | 134 +++ .../tools/gvmkit/gvmkit-build-installation.md | 50 ++ .../ja/docs/creators/tools/gvmkit/index.md | 14 + .../tools/gvmkit/publishing-custom-images.md | 101 +++ .../tools/yagna/golem-wallet-backup.md | 129 +++ .../ja/docs/creators/tools/yagna/index.md | 17 + .../tools/yagna/managing-golem-wallet.md | 176 ++++ .../tools/yagna/requestor-uninstallation.md | 181 +++++ .../tools/yagna/restoring-golem-wallet.md | 151 ++++ .../yagna-installation-for-requestors.md | 108 +++ .../tools/yagna/yagna-mostly-used-commands.md | 25 + src/pages/ja/docs/degenhack/index.md | 239 ++++++ .../ja/docs/degenhack/mainnet-version.md | 277 +++++++ .../ja/docs/golem-js/reference/.nojekyll | 1 + .../ja/docs/golem-js/reference/README.md | 301 +++++++ .../classes/activity_activity.Activity.md | 203 +++++ .../classes/activity_results.Result.md | 216 +++++ .../agreement_service.AgreementCandidate.md | 60 ++ .../error_golem_error.GolemAbortError.md | 74 ++ .../error_golem_error.GolemConfigError.md | 74 ++ .../classes/error_golem_error.GolemError.md | 74 ++ .../error_golem_error.GolemInternalError.md | 74 ++ .../error_golem_error.GolemModuleError.md | 90 +++ .../error_golem_error.GolemPlatformError.md | 71 ++ .../error_golem_error.GolemTimeoutError.md | 73 ++ .../error_golem_error.GolemUserError.md | 78 ++ .../classes/events_events.ActivityCreated.md | 102 +++ .../events_events.ActivityDestroyed.md | 102 +++ .../events_events.ActivityStateChanged.md | 102 +++ .../events_events.AgreementConfirmed.md | 102 +++ .../classes/events_events.AgreementCreated.md | 106 +++ .../events_events.AgreementRejected.md | 104 +++ .../events_events.AgreementTerminated.md | 104 +++ .../events_events.AllocationCreated.md | 104 +++ .../classes/events_events.BaseEvent.md | 169 ++++ .../classes/events_events.CollectFailed.md | 102 +++ .../events_events.ComputationFailed.md | 100 +++ .../events_events.ComputationFinished.md | 87 ++ .../events_events.ComputationStarted.md | 87 ++ .../events_events.DebitNoteAccepted.md | 106 +++ .../events_events.DebitNoteReceived.md | 108 +++ .../classes/events_events.DemandFailed.md | 100 +++ .../classes/events_events.DemandSubscribed.md | 102 +++ .../events_events.DemandUnsubscribed.md | 100 +++ .../classes/events_events.InvoiceReceived.md | 106 +++ .../classes/events_events.PackageCreated.md | 102 +++ .../classes/events_events.PaymentAccepted.md | 106 +++ .../classes/events_events.PaymentFailed.md | 104 +++ .../events_events.ProposalConfirmed.md | 102 +++ .../classes/events_events.ProposalFailed.md | 106 +++ .../classes/events_events.ProposalReceived.md | 106 +++ .../classes/events_events.ProposalRejected.md | 106 +++ .../events_events.ProposalResponded.md | 104 +++ .../classes/events_events.ScriptExecuted.md | 104 +++ .../classes/events_events.ScriptSent.md | 102 +++ .../classes/events_events.TaskFinished.md | 100 +++ .../classes/events_events.TaskRedone.md | 112 +++ .../classes/events_events.TaskRejected.md | 111 +++ .../classes/events_events.TaskStarted.md | 106 +++ .../classes/executor_executor.TaskExecutor.md | 277 +++++++ ...olem_network_golem_network.GolemNetwork.md | 140 ++++ .../golem-js/reference/classes/job_job.Job.md | 197 +++++ .../classes/market_error.GolemMarketError.md | 98 +++ .../classes/market_proposal.Proposal.md | 330 ++++++++ .../market_proposals_batch.ProposalsBatch.md | 83 ++ .../network_error.GolemNetworkError.md | 98 +++ .../classes/network_node.NetworkNode.md | 116 +++ .../classes/package_package.Package.md | 91 +++ ...yment_InvoiceProcessor.InvoiceProcessor.md | 165 ++++ ...payment_process.AgreementPaymentProcess.md | 162 ++++ .../payment_error.GolemPaymentError.md | 110 +++ .../classes/payment_payments.Payments.md | 89 ++ .../classes/script_command.DownloadData.md | 179 +++++ .../classes/script_command.Terminate.md | 158 ++++ .../classes/script_command.UploadData.md | 180 +++++ .../storage_gftp.GftpStorageProvider.md | 222 +++++ .../storage_null.NullStorageProvider.md | 216 +++++ ...browser.WebSocketBrowserStorageProvider.md | 210 +++++ .../reference/classes/task_batch.Batch.md | 247 ++++++ .../classes/task_error.GolemWorkError.md | 122 +++ .../classes/task_process.RemoteProcess.md | 94 +++ .../reference/classes/task_task.Task.md | 416 ++++++++++ .../classes/task_work.WorkContext.md | 397 +++++++++ .../utils_yagna_activity.RequestorApi.md | 71 ++ .../classes/utils_yagna_gsb.RequestorApi.md | 105 +++ .../utils_yagna_identity.RequestorApi.md | 73 ++ .../classes/utils_yagna_yagna.Yagna.md | 237 ++++++ .../docs/golem-js/reference/default-values.md | 7 + .../activity_activity.ActivityStateEnum.md | 80 ++ .../enums/market_error.MarketErrorCode.md | 124 +++ .../enums/network_error.NetworkErrorCode.md | 113 +++ .../enums/payment_error.PaymentErrorCode.md | 135 ++++ .../enums/task_error.WorkErrorCode.md | 146 ++++ .../reference/enums/task_task.TaskState.md | 80 ++ .../activity_activity.ActivityOptions.md | 85 ++ .../activity_activity.ExeScriptRequest.md | 25 + .../interfaces/activity_results.ResultData.md | 128 +++ .../activity_results.RuntimeEventKind.md | 58 ++ .../activity_results.StreamingBatchEvent.md | 58 ++ .../agreement_agreement.ProviderInfo.md | 47 ++ .../agreement_service.AgreementDTO.md | 43 + ...reement_service.AgreementServiceOptions.md | 157 ++++ .../executor_events.TaskExecutorEventsDict.md | 85 ++ .../interfaces/job_job.JobEventsDict.md | 158 ++++ .../interfaces/market_demand.DemandDetails.md | 36 + .../interfaces/market_demand.DemandOptions.md | 192 +++++ .../market_proposal.ProposalDetails.md | 135 ++++ .../market_service.MarketOptions.md | 276 +++++++ .../interfaces/network_network.NetworkInfo.md | 62 ++ .../package_package.PackageDetails.md | 91 +++ .../payment_config.BasePaymentOptions.md | 117 +++ .../payment_debit_note.DebitNoteDTO.md | 80 ++ .../interfaces/payment_invoice.InvoiceDTO.md | 124 +++ .../payment_payments.PaymentOptions.md | 191 +++++ .../payment_service.PaymentOptions.md | 225 ++++++ .../storage_provider.StorageProvider.md | 169 ++++ ...browser.WebSocketStorageProviderOptions.md | 25 + .../task_service.TaskServiceOptions.md | 173 ++++ .../interfaces/task_work.CommandOptions.md | 47 ++ .../interfaces/task_work.WorkOptions.md | 80 ++ .../interfaces/utils_logger_logger.Logger.md | 187 +++++ .../utils_yagna_identity.IdentityModel.md | 47 ++ .../ja/docs/golem-js/reference/modules.md | 68 ++ .../reference/modules/activity_activity.md | 22 + .../reference/modules/activity_results.md | 19 + .../reference/modules/agreement_agreement.md | 13 + .../reference/modules/agreement_service.md | 46 ++ .../reference/modules/agreement_strategy.md | 105 +++ .../reference/modules/error_golem_error.md | 20 + .../reference/modules/events_events.md | 61 ++ .../reference/modules/executor_events.md | 13 + .../reference/modules/executor_executor.md | 58 ++ .../modules/golem_network_golem_network.md | 27 + .../golem-js/reference/modules/job_job.md | 43 + .../reference/modules/market_builder.md | 32 + .../reference/modules/market_demand.md | 14 + .../reference/modules/market_error.md | 17 + .../reference/modules/market_helpers.md | 33 + .../reference/modules/market_proposal.md | 50 ++ .../modules/market_proposals_batch.md | 34 + .../reference/modules/market_service.md | 41 + .../reference/modules/market_strategy.md | 302 +++++++ .../reference/modules/network_error.md | 17 + .../reference/modules/network_network.md | 13 + .../reference/modules/network_node.md | 13 + .../reference/modules/network_service.md | 23 + .../reference/modules/package_package.md | 60 ++ .../modules/payment_InvoiceProcessor.md | 27 + .../payment_agreement_payment_process.md | 13 + .../reference/modules/payment_config.md | 13 + .../reference/modules/payment_debit_note.md | 27 + .../reference/modules/payment_error.md | 17 + .../reference/modules/payment_invoice.md | 27 + .../reference/modules/payment_payments.md | 31 + .../reference/modules/payment_service.md | 66 ++ .../reference/modules/payment_strategy.md | 128 +++ .../reference/modules/script_command.md | 49 ++ .../reference/modules/storage_gftp.md | 13 + .../reference/modules/storage_null.md | 13 + .../reference/modules/storage_provider.md | 41 + .../reference/modules/storage_ws_browser.md | 17 + .../golem-js/reference/modules/task_batch.md | 13 + .../golem-js/reference/modules/task_error.md | 17 + .../reference/modules/task_process.md | 13 + .../reference/modules/task_service.md | 13 + .../golem-js/reference/modules/task_task.md | 39 + .../golem-js/reference/modules/task_work.md | 52 ++ .../golem-js/reference/modules/utils_env.md | 102 +++ .../modules/utils_logger_defaultLogger.md | 45 ++ .../modules/utils_logger_jsonLogger.md | 35 + .../reference/modules/utils_logger_logger.md | 13 + .../modules/utils_logger_nullLogger.md | 27 + .../modules/utils_logger_pinoLogger.md | 33 + .../modules/utils_runtimeContextChecker.md | 23 + .../golem-js/reference/modules/utils_types.md | 30 + .../reference/modules/utils_yagna_activity.md | 13 + .../reference/modules/utils_yagna_gsb.md | 51 ++ .../reference/modules/utils_yagna_identity.md | 17 + .../reference/modules/utils_yagna_yagna.md | 76 ++ .../ja/docs/golem-js/reference/overview.md | 172 ++++ .../reference/.nojekyll | 1 + .../reference/README.md | 260 ++++++ .../classes/executor.TaskExecutor.md | 277 +++++++ .../reference/classes/task.Task.md | 442 ++++++++++ .../reference/default-values.md | 7 + .../reference/enums/task.TaskState.md | 80 ++ .../events.TaskExecutorEventsDict.md | 250 ++++++ .../interfaces/service.TaskServiceOptions.md | 103 +++ .../reference/interfaces/task.ProviderInfo.md | 47 ++ .../reference/modules.md | 18 + .../reference/modules/events.md | 13 + .../reference/modules/executor.md | 58 ++ .../reference/modules/service.md | 13 + .../reference/modules/task.md | 65 ++ .../reference/modules/types.md | 30 + .../reference/modules/utils.md | 59 ++ .../reference/overview.md | 22 + src/pages/ja/docs/golem/index.md | 13 + src/pages/ja/docs/golem/migrate/guideline.md | 268 ++++++ src/pages/ja/docs/golem/migrate/terms.md | 204 +++++ .../ja/docs/golem/overview/golem-token.md | 64 ++ src/pages/ja/docs/golem/overview/index.md | 67 ++ src/pages/ja/docs/golem/overview/provider.md | 34 + .../ja/docs/golem/overview/requestor-faq.md | 48 ++ src/pages/ja/docs/golem/overview/requestor.md | 42 + .../ja/docs/golem/overview/testnet-mainnet.md | 49 ++ .../computation-payload-manifest.schema.md | 329 ++++++++ .../ja/docs/golem/payload-manifest/index.md | 287 +++++++ .../golem/payments/golem-token-conversion.md | 44 + src/pages/ja/docs/golem/payments/index.md | 95 +++ .../docs/golem/payments/layer-2-payments.md | 61 ++ src/pages/ja/docs/golem/terms.md | 118 +++ src/pages/ja/docs/index.jsx | 26 + .../docs/providers/configuration/general.md | 114 +++ .../docs/providers/configuration/outbound.md | 155 ++++ .../ja/docs/providers/gpu/gpu-golem-live.md | 322 ++++++++ src/pages/ja/docs/providers/index.md | 30 + src/pages/ja/docs/providers/maintenance.md | 53 ++ src/pages/ja/docs/providers/provider-faq.md | 109 +++ .../docs/providers/provider-installation.md | 198 +++++ .../docs/providers/provider-uninstallation.md | 103 +++ src/pages/ja/docs/providers/wallet/backup.md | 126 +++ .../ja/docs/providers/wallet/restoration.md | 148 ++++ .../ja/docs/quickstarts/golem-in-a-browser.md | 10 + src/pages/ja/docs/quickstarts/index.md | 16 + .../ja/docs/quickstarts/js-quickstart.md | 10 + .../quickstarts/no-code-app-deployment.md | 11 + .../ja/docs/quickstarts/python-quickstart.md | 10 + .../ja/docs/quickstarts/ray-quickstart.md | 14 + .../ja/docs/quickstarts/retrievable-task.md | 8 + .../reputation/finding-the-best-providers.md | 198 +++++ src/pages/ja/docs/reputation/index.md | 73 ++ .../reputation-api-swagger-ui-v1.md | 11 + .../reputation-api-swagger-ui-v2.md | 11 + .../using-reputation-with-nodejs.md | 95 +++ src/pages/ja/docs/templates/demo.md | 209 +++++ .../ja/docs/templates/example-template.md | 110 +++ src/pages/ja/docs/templates/guide-template.md | 61 ++ src/pages/ja/docs/templates/index-template.md | 25 + .../ja/docs/templates/tutorial-template.md | 112 +++ .../ja/docs/troubleshooting/dapps/index.md | 10 + .../docs/troubleshooting/javascript/index.md | 20 + .../js-requestor/exit-codes.md | 144 ++++ .../troubleshooting/js-requestor/index.md | 16 + .../ja/docs/troubleshooting/provider/index.md | 18 + .../ja/docs/troubleshooting/yagna/index.md | 10 + src/utils/localization.jsx | 8 + 681 files changed, 37946 insertions(+), 102 deletions(-) create mode 100644 src/navigation/docs.ja.js rename src/pages/{ => en}/docs/creators/common/providers-filesystem.md (100%) rename src/pages/{ => en}/docs/creators/common/requestor-provider-interaction.md (100%) rename src/pages/{ => en}/docs/creators/dapps/creating-golem-dapps.md (100%) rename src/pages/{ => en}/docs/creators/dapps/docker-containers-vs-golem-vms.md (100%) rename src/pages/{ => en}/docs/creators/dapps/hello-world-dapp.md (100%) rename src/pages/{ => en}/docs/creators/dapps/index.md (100%) rename src/pages/{ => en}/docs/creators/dapps/managing-multiple-dapps.md (100%) rename src/pages/{ => en}/docs/creators/dapps/run-a-dapp.md (100%) rename src/pages/{ => en}/docs/creators/index.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/accessing-internet.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/composing-tasks.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/executing-tasks.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/index.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/selecting-providers.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/switching-to-mainnet.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/transferring-data.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/using-app-keys.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/working-with-events.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/working-with-images.md (100%) rename src/pages/{ => en}/docs/creators/javascript/examples/working-with-results.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/accessing-internet.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/error-handling.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/golem-images-faq.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/golem-images.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/golem-sdk-cli.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/index.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/retrievable-tasks.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/switching-to-mainnet.md (100%) rename src/pages/{ => en}/docs/creators/javascript/guides/task-model.md (100%) rename src/pages/{ => en}/docs/creators/javascript/index.md (100%) rename src/pages/{ => en}/docs/creators/javascript/quickstarts/golem-in-a-browser.md (100%) rename src/pages/{ => en}/docs/creators/javascript/quickstarts/index.md (100%) rename src/pages/{ => en}/docs/creators/javascript/quickstarts/quickstart.md (100%) rename src/pages/{ => en}/docs/creators/javascript/quickstarts/retrievable-task.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/api-reference-overview.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/getting-started.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/index.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/use-executor.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/use-handle-invoice.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/use-invoices.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/use-task.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/use-yagna.md (100%) rename src/pages/{ => en}/docs/creators/javascript/react/yagna-provider.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/accessing-internet.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/building-custom-image.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/index.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/quickstart-explained.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/rest-api-with-express.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/running-in-browser.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/running-parallel-tasks.md (100%) rename src/pages/{ => en}/docs/creators/javascript/tutorials/testing-golem-image.md (100%) rename src/pages/{ => en}/docs/creators/python/examples/tools/self-hosted-vm-images.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/application-fundamentals.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/debugging.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/golem-images-faq.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/golem-images.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/index.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/service-model.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/switching-to-mainnet.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/task-model.md (100%) rename src/pages/{ => en}/docs/creators/python/guides/vpn.md (100%) rename src/pages/{ => en}/docs/creators/python/index.md (100%) rename src/pages/{ => en}/docs/creators/python/quickstarts/run-first-task-on-golem.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/building-custom-image.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/index.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/service-example-0-hello-world.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/service-example-1-simple-service.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/service-example-2-vpn-ssh-terminal.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/service-example-3-vpn-simple-http-proxy.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/service-example-4-custom-usage-counters.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/service-example-5-webapp.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/service-example-6-external-api-request.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/task-example-0-hello.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/task-example-1-cracker.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/task-example-2-hashcat.md (100%) rename src/pages/{ => en}/docs/creators/python/tutorials/testing-golem-image.md (100%) rename src/pages/{ => en}/docs/creators/ray/basic-ray-tasks-usage-tutorial.md (100%) rename src/pages/{ => en}/docs/creators/ray/cluster-yaml.md (100%) rename src/pages/{ => en}/docs/creators/ray/conversion-to-ray-on-golem-tutorial.md (100%) rename src/pages/{ => en}/docs/creators/ray/index.md (100%) rename src/pages/{ => en}/docs/creators/ray/mainnet.md (100%) rename src/pages/{ => en}/docs/creators/ray/outbound.md (100%) rename src/pages/{ => en}/docs/creators/ray/quickstart.md (100%) rename src/pages/{ => en}/docs/creators/ray/ray-cli.md (100%) rename src/pages/{ => en}/docs/creators/ray/ray-on-golem-cli.md (100%) rename src/pages/{ => en}/docs/creators/ray/setup-tutorial.md (100%) rename src/pages/{ => en}/docs/creators/ray/supported-versions-and-other-limitations.md (100%) rename src/pages/{ => en}/docs/creators/ray/troubleshooting.md (100%) rename src/pages/{ => en}/docs/creators/tools/goth/index.md (100%) rename src/pages/{ => en}/docs/creators/tools/goth/running-goth.md (100%) rename src/pages/{ => en}/docs/creators/tools/goth/running-goths-interactive-mode.md (100%) rename src/pages/{ => en}/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format.md (100%) rename src/pages/{ => en}/docs/creators/tools/gvmkit/gvmkit-build-installation.md (100%) rename src/pages/{ => en}/docs/creators/tools/gvmkit/index.md (100%) rename src/pages/{ => en}/docs/creators/tools/gvmkit/publishing-custom-images.md (100%) rename src/pages/{ => en}/docs/creators/tools/yagna/golem-wallet-backup.md (100%) rename src/pages/{ => en}/docs/creators/tools/yagna/index.md (100%) rename src/pages/{ => en}/docs/creators/tools/yagna/managing-golem-wallet.md (100%) rename src/pages/{ => en}/docs/creators/tools/yagna/requestor-uninstallation.md (100%) rename src/pages/{ => en}/docs/creators/tools/yagna/restoring-golem-wallet.md (100%) rename src/pages/{ => en}/docs/creators/tools/yagna/yagna-installation-for-requestors.md (100%) rename src/pages/{ => en}/docs/creators/tools/yagna/yagna-mostly-used-commands.md (100%) rename src/pages/{ => en}/docs/degenhack/index.md (100%) rename src/pages/{ => en}/docs/degenhack/mainnet-version.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/.nojekyll (100%) rename src/pages/{ => en}/docs/golem-js/reference/README.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/activity_activity.Activity.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/activity_results.Result.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/agreement_service.AgreementCandidate.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemAbortError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemConfigError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemInternalError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemModuleError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemPlatformError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemTimeoutError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/error_golem_error.GolemUserError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ActivityCreated.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ActivityDestroyed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ActivityStateChanged.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.AgreementConfirmed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.AgreementCreated.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.AgreementRejected.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.AgreementTerminated.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.AllocationCreated.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.BaseEvent.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.CollectFailed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ComputationFailed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ComputationFinished.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ComputationStarted.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.DebitNoteAccepted.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.DebitNoteReceived.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.DemandFailed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.DemandSubscribed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.DemandUnsubscribed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.InvoiceReceived.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.PackageCreated.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.PaymentAccepted.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.PaymentFailed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ProposalConfirmed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ProposalFailed.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ProposalReceived.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ProposalRejected.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ProposalResponded.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ScriptExecuted.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.ScriptSent.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.TaskFinished.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.TaskRedone.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.TaskRejected.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/events_events.TaskStarted.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/executor_executor.TaskExecutor.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/golem_network_golem_network.GolemNetwork.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/job_job.Job.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/market_error.GolemMarketError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/market_proposal.Proposal.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/market_proposals_batch.ProposalsBatch.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/network_error.GolemNetworkError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/network_node.NetworkNode.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/package_package.Package.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/payment_InvoiceProcessor.InvoiceProcessor.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/payment_agreement_payment_process.AgreementPaymentProcess.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/payment_error.GolemPaymentError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/payment_payments.Payments.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/script_command.DownloadData.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/script_command.Terminate.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/script_command.UploadData.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/storage_gftp.GftpStorageProvider.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/storage_null.NullStorageProvider.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/storage_ws_browser.WebSocketBrowserStorageProvider.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/task_batch.Batch.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/task_error.GolemWorkError.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/task_process.RemoteProcess.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/task_task.Task.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/task_work.WorkContext.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/utils_yagna_activity.RequestorApi.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/utils_yagna_gsb.RequestorApi.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/utils_yagna_identity.RequestorApi.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/classes/utils_yagna_yagna.Yagna.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/default-values.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/enums/activity_activity.ActivityStateEnum.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/enums/market_error.MarketErrorCode.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/enums/network_error.NetworkErrorCode.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/enums/payment_error.PaymentErrorCode.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/enums/task_error.WorkErrorCode.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/enums/task_task.TaskState.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/activity_activity.ActivityOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/activity_activity.ExeScriptRequest.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/activity_results.ResultData.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/activity_results.RuntimeEventKind.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/activity_results.StreamingBatchEvent.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/agreement_agreement.ProviderInfo.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/agreement_service.AgreementDTO.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/agreement_service.AgreementServiceOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/executor_events.TaskExecutorEventsDict.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/job_job.JobEventsDict.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/market_demand.DemandDetails.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/market_demand.DemandOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/market_proposal.ProposalDetails.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/market_service.MarketOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/network_network.NetworkInfo.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/package_package.PackageDetails.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/payment_config.BasePaymentOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/payment_debit_note.DebitNoteDTO.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/payment_invoice.InvoiceDTO.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/payment_payments.PaymentOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/payment_service.PaymentOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/storage_provider.StorageProvider.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/storage_ws_browser.WebSocketStorageProviderOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/task_service.TaskServiceOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/task_work.CommandOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/task_work.WorkOptions.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/utils_logger_logger.Logger.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/interfaces/utils_yagna_identity.IdentityModel.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/activity_activity.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/activity_results.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/agreement_agreement.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/agreement_service.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/agreement_strategy.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/error_golem_error.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/events_events.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/executor_events.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/executor_executor.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/golem_network_golem_network.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/job_job.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_builder.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_demand.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_error.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_helpers.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_proposal.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_proposals_batch.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_service.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/market_strategy.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/network_error.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/network_network.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/network_node.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/network_service.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/package_package.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_InvoiceProcessor.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_agreement_payment_process.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_config.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_debit_note.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_error.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_invoice.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_payments.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_service.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/payment_strategy.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/script_command.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/storage_gftp.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/storage_null.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/storage_provider.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/storage_ws_browser.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/task_batch.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/task_error.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/task_process.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/task_service.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/task_task.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/task_work.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_env.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_logger_defaultLogger.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_logger_jsonLogger.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_logger_logger.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_logger_nullLogger.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_logger_pinoLogger.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_runtimeContextChecker.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_types.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_yagna_activity.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_yagna_gsb.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_yagna_identity.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/modules/utils_yagna_yagna.md (100%) rename src/pages/{ => en}/docs/golem-js/reference/overview.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/.nojekyll (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/README.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/classes/task.Task.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/default-values.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/enums/task.TaskState.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/interfaces/events.TaskExecutorEventsDict.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/interfaces/service.TaskServiceOptions.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/interfaces/task.ProviderInfo.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/modules.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/modules/events.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/modules/executor.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/modules/service.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/modules/task.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/modules/types.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/modules/utils.md (100%) rename src/pages/{ => en}/docs/golem-sdk-task-executor/reference/overview.md (100%) rename src/pages/{ => en}/docs/golem/index.md (100%) rename src/pages/{ => en}/docs/golem/migrate/guideline.md (100%) rename src/pages/{ => en}/docs/golem/migrate/terms.md (100%) rename src/pages/{ => en}/docs/golem/overview/golem-token.md (100%) rename src/pages/{ => en}/docs/golem/overview/index.md (100%) rename src/pages/{ => en}/docs/golem/overview/provider.md (100%) rename src/pages/{ => en}/docs/golem/overview/requestor-faq.md (100%) rename src/pages/{ => en}/docs/golem/overview/requestor.md (100%) rename src/pages/{ => en}/docs/golem/overview/testnet-mainnet.md (100%) rename src/pages/{ => en}/docs/golem/payload-manifest/computation-payload-manifest.schema.md (100%) rename src/pages/{ => en}/docs/golem/payload-manifest/index.md (100%) rename src/pages/{ => en}/docs/golem/payments/golem-token-conversion.md (100%) rename src/pages/{ => en}/docs/golem/payments/index.md (100%) rename src/pages/{ => en}/docs/golem/payments/layer-2-payments.md (100%) rename src/pages/{ => en}/docs/golem/terms.md (100%) create mode 100644 src/pages/en/docs/index.jsx rename src/pages/{ => en}/docs/providers/configuration/general.md (100%) rename src/pages/{ => en}/docs/providers/configuration/outbound.md (100%) rename src/pages/{ => en}/docs/providers/gpu/gpu-golem-live.md (100%) rename src/pages/{ => en}/docs/providers/index.md (100%) rename src/pages/{ => en}/docs/providers/maintenance.md (100%) rename src/pages/{ => en}/docs/providers/provider-faq.md (100%) rename src/pages/{ => en}/docs/providers/provider-installation.md (100%) rename src/pages/{ => en}/docs/providers/provider-uninstallation.md (100%) rename src/pages/{ => en}/docs/providers/wallet/backup.md (100%) rename src/pages/{ => en}/docs/providers/wallet/restoration.md (100%) rename src/pages/{ => en}/docs/quickstarts/golem-in-a-browser.md (100%) rename src/pages/{ => en}/docs/quickstarts/index.md (100%) rename src/pages/{ => en}/docs/quickstarts/js-quickstart.md (100%) rename src/pages/{ => en}/docs/quickstarts/no-code-app-deployment.md (100%) rename src/pages/{ => en}/docs/quickstarts/python-quickstart.md (100%) rename src/pages/{ => en}/docs/quickstarts/ray-quickstart.md (100%) rename src/pages/{ => en}/docs/quickstarts/retrievable-task.md (100%) rename src/pages/{ => en}/docs/reputation/finding-the-best-providers.md (100%) rename src/pages/{ => en}/docs/reputation/index.md (100%) rename src/pages/{ => en}/docs/reputation/reputation-api-swagger-ui-v1.md (100%) rename src/pages/{ => en}/docs/reputation/reputation-api-swagger-ui-v2.md (100%) rename src/pages/{ => en}/docs/reputation/using-reputation-with-nodejs.md (100%) rename src/pages/{ => en}/docs/templates/demo.md (100%) rename src/pages/{ => en}/docs/templates/example-template.md (100%) rename src/pages/{ => en}/docs/templates/guide-template.md (100%) rename src/pages/{ => en}/docs/templates/index-template.md (100%) rename src/pages/{ => en}/docs/templates/tutorial-template.md (100%) rename src/pages/{ => en}/docs/troubleshooting/dapps/index.md (100%) rename src/pages/{ => en}/docs/troubleshooting/javascript/index.md (100%) rename src/pages/{ => en}/docs/troubleshooting/js-requestor/exit-codes.md (100%) rename src/pages/{ => en}/docs/troubleshooting/js-requestor/index.md (100%) rename src/pages/{ => en}/docs/troubleshooting/provider/index.md (100%) rename src/pages/{ => en}/docs/troubleshooting/yagna/index.md (100%) create mode 100644 src/pages/ja/docs/creators/common/providers-filesystem.md create mode 100644 src/pages/ja/docs/creators/common/requestor-provider-interaction.md create mode 100644 src/pages/ja/docs/creators/dapps/creating-golem-dapps.md create mode 100644 src/pages/ja/docs/creators/dapps/docker-containers-vs-golem-vms.md create mode 100644 src/pages/ja/docs/creators/dapps/hello-world-dapp.md create mode 100644 src/pages/ja/docs/creators/dapps/index.md create mode 100644 src/pages/ja/docs/creators/dapps/managing-multiple-dapps.md create mode 100644 src/pages/ja/docs/creators/dapps/run-a-dapp.md create mode 100644 src/pages/ja/docs/creators/index.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/accessing-internet.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/composing-tasks.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/executing-tasks.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/index.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/selecting-providers.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/switching-to-mainnet.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/transferring-data.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/using-app-keys.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/working-with-events.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/working-with-images.md create mode 100644 src/pages/ja/docs/creators/javascript/examples/working-with-results.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/accessing-internet.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/error-handling.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/golem-images-faq.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/golem-images.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/golem-sdk-cli.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/index.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/retrievable-tasks.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/switching-to-mainnet.md create mode 100644 src/pages/ja/docs/creators/javascript/guides/task-model.md create mode 100644 src/pages/ja/docs/creators/javascript/index.md create mode 100644 src/pages/ja/docs/creators/javascript/quickstarts/golem-in-a-browser.md create mode 100644 src/pages/ja/docs/creators/javascript/quickstarts/index.md create mode 100644 src/pages/ja/docs/creators/javascript/quickstarts/quickstart.md create mode 100644 src/pages/ja/docs/creators/javascript/quickstarts/retrievable-task.md create mode 100644 src/pages/ja/docs/creators/javascript/react/api-reference-overview.md create mode 100644 src/pages/ja/docs/creators/javascript/react/getting-started.md create mode 100644 src/pages/ja/docs/creators/javascript/react/index.md create mode 100644 src/pages/ja/docs/creators/javascript/react/use-executor.md create mode 100644 src/pages/ja/docs/creators/javascript/react/use-handle-invoice.md create mode 100644 src/pages/ja/docs/creators/javascript/react/use-invoices.md create mode 100644 src/pages/ja/docs/creators/javascript/react/use-task.md create mode 100644 src/pages/ja/docs/creators/javascript/react/use-yagna.md create mode 100644 src/pages/ja/docs/creators/javascript/react/yagna-provider.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/accessing-internet.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/building-custom-image.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/index.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/quickstart-explained.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/rest-api-with-express.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/running-in-browser.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/running-parallel-tasks.md create mode 100644 src/pages/ja/docs/creators/javascript/tutorials/testing-golem-image.md create mode 100644 src/pages/ja/docs/creators/python/examples/tools/self-hosted-vm-images.md create mode 100644 src/pages/ja/docs/creators/python/guides/application-fundamentals.md create mode 100644 src/pages/ja/docs/creators/python/guides/debugging.md create mode 100644 src/pages/ja/docs/creators/python/guides/golem-images-faq.md create mode 100644 src/pages/ja/docs/creators/python/guides/golem-images.md create mode 100644 src/pages/ja/docs/creators/python/guides/index.md create mode 100644 src/pages/ja/docs/creators/python/guides/service-model.md create mode 100644 src/pages/ja/docs/creators/python/guides/switching-to-mainnet.md create mode 100644 src/pages/ja/docs/creators/python/guides/task-model.md create mode 100644 src/pages/ja/docs/creators/python/guides/vpn.md create mode 100644 src/pages/ja/docs/creators/python/index.md create mode 100644 src/pages/ja/docs/creators/python/quickstarts/run-first-task-on-golem.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/building-custom-image.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/index.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/service-example-0-hello-world.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/service-example-1-simple-service.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/service-example-2-vpn-ssh-terminal.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/service-example-3-vpn-simple-http-proxy.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/service-example-4-custom-usage-counters.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/service-example-5-webapp.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/service-example-6-external-api-request.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/task-example-0-hello.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/task-example-1-cracker.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/task-example-2-hashcat.md create mode 100644 src/pages/ja/docs/creators/python/tutorials/testing-golem-image.md create mode 100644 src/pages/ja/docs/creators/ray/basic-ray-tasks-usage-tutorial.md create mode 100644 src/pages/ja/docs/creators/ray/cluster-yaml.md create mode 100644 src/pages/ja/docs/creators/ray/conversion-to-ray-on-golem-tutorial.md create mode 100644 src/pages/ja/docs/creators/ray/index.md create mode 100644 src/pages/ja/docs/creators/ray/mainnet.md create mode 100644 src/pages/ja/docs/creators/ray/outbound.md create mode 100644 src/pages/ja/docs/creators/ray/quickstart.md create mode 100644 src/pages/ja/docs/creators/ray/ray-cli.md create mode 100644 src/pages/ja/docs/creators/ray/ray-on-golem-cli.md create mode 100644 src/pages/ja/docs/creators/ray/setup-tutorial.md create mode 100644 src/pages/ja/docs/creators/ray/supported-versions-and-other-limitations.md create mode 100644 src/pages/ja/docs/creators/ray/troubleshooting.md create mode 100644 src/pages/ja/docs/creators/tools/goth/index.md create mode 100644 src/pages/ja/docs/creators/tools/goth/running-goth.md create mode 100644 src/pages/ja/docs/creators/tools/goth/running-goths-interactive-mode.md create mode 100644 src/pages/ja/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format.md create mode 100644 src/pages/ja/docs/creators/tools/gvmkit/gvmkit-build-installation.md create mode 100644 src/pages/ja/docs/creators/tools/gvmkit/index.md create mode 100644 src/pages/ja/docs/creators/tools/gvmkit/publishing-custom-images.md create mode 100644 src/pages/ja/docs/creators/tools/yagna/golem-wallet-backup.md create mode 100644 src/pages/ja/docs/creators/tools/yagna/index.md create mode 100644 src/pages/ja/docs/creators/tools/yagna/managing-golem-wallet.md create mode 100644 src/pages/ja/docs/creators/tools/yagna/requestor-uninstallation.md create mode 100644 src/pages/ja/docs/creators/tools/yagna/restoring-golem-wallet.md create mode 100644 src/pages/ja/docs/creators/tools/yagna/yagna-installation-for-requestors.md create mode 100644 src/pages/ja/docs/creators/tools/yagna/yagna-mostly-used-commands.md create mode 100644 src/pages/ja/docs/degenhack/index.md create mode 100644 src/pages/ja/docs/degenhack/mainnet-version.md create mode 100644 src/pages/ja/docs/golem-js/reference/.nojekyll create mode 100644 src/pages/ja/docs/golem-js/reference/README.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/activity_activity.Activity.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/activity_results.Result.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/agreement_service.AgreementCandidate.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemAbortError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemConfigError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemInternalError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemModuleError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemPlatformError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemTimeoutError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/error_golem_error.GolemUserError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ActivityCreated.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ActivityDestroyed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ActivityStateChanged.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.AgreementConfirmed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.AgreementCreated.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.AgreementRejected.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.AgreementTerminated.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.AllocationCreated.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.BaseEvent.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.CollectFailed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ComputationFailed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ComputationFinished.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ComputationStarted.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.DebitNoteAccepted.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.DebitNoteReceived.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.DemandFailed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.DemandSubscribed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.DemandUnsubscribed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.InvoiceReceived.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.PackageCreated.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.PaymentAccepted.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.PaymentFailed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ProposalConfirmed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ProposalFailed.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ProposalReceived.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ProposalRejected.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ProposalResponded.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ScriptExecuted.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.ScriptSent.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.TaskFinished.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.TaskRedone.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.TaskRejected.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/events_events.TaskStarted.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/executor_executor.TaskExecutor.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/golem_network_golem_network.GolemNetwork.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/job_job.Job.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/market_error.GolemMarketError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/market_proposal.Proposal.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/market_proposals_batch.ProposalsBatch.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/network_error.GolemNetworkError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/network_node.NetworkNode.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/package_package.Package.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/payment_InvoiceProcessor.InvoiceProcessor.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/payment_agreement_payment_process.AgreementPaymentProcess.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/payment_error.GolemPaymentError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/payment_payments.Payments.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/script_command.DownloadData.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/script_command.Terminate.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/script_command.UploadData.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/storage_gftp.GftpStorageProvider.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/storage_null.NullStorageProvider.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/storage_ws_browser.WebSocketBrowserStorageProvider.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/task_batch.Batch.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/task_error.GolemWorkError.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/task_process.RemoteProcess.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/task_task.Task.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/task_work.WorkContext.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/utils_yagna_activity.RequestorApi.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/utils_yagna_gsb.RequestorApi.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/utils_yagna_identity.RequestorApi.md create mode 100644 src/pages/ja/docs/golem-js/reference/classes/utils_yagna_yagna.Yagna.md create mode 100644 src/pages/ja/docs/golem-js/reference/default-values.md create mode 100644 src/pages/ja/docs/golem-js/reference/enums/activity_activity.ActivityStateEnum.md create mode 100644 src/pages/ja/docs/golem-js/reference/enums/market_error.MarketErrorCode.md create mode 100644 src/pages/ja/docs/golem-js/reference/enums/network_error.NetworkErrorCode.md create mode 100644 src/pages/ja/docs/golem-js/reference/enums/payment_error.PaymentErrorCode.md create mode 100644 src/pages/ja/docs/golem-js/reference/enums/task_error.WorkErrorCode.md create mode 100644 src/pages/ja/docs/golem-js/reference/enums/task_task.TaskState.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/activity_activity.ActivityOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/activity_activity.ExeScriptRequest.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/activity_results.ResultData.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/activity_results.RuntimeEventKind.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/activity_results.StreamingBatchEvent.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/agreement_agreement.ProviderInfo.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/agreement_service.AgreementDTO.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/agreement_service.AgreementServiceOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/executor_events.TaskExecutorEventsDict.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/job_job.JobEventsDict.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/market_demand.DemandDetails.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/market_demand.DemandOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/market_proposal.ProposalDetails.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/market_service.MarketOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/network_network.NetworkInfo.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/package_package.PackageDetails.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/payment_config.BasePaymentOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/payment_debit_note.DebitNoteDTO.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/payment_invoice.InvoiceDTO.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/payment_payments.PaymentOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/payment_service.PaymentOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/storage_provider.StorageProvider.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/storage_ws_browser.WebSocketStorageProviderOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/task_service.TaskServiceOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/task_work.CommandOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/task_work.WorkOptions.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/utils_logger_logger.Logger.md create mode 100644 src/pages/ja/docs/golem-js/reference/interfaces/utils_yagna_identity.IdentityModel.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/activity_activity.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/activity_results.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/agreement_agreement.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/agreement_service.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/agreement_strategy.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/error_golem_error.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/events_events.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/executor_events.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/executor_executor.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/golem_network_golem_network.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/job_job.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_builder.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_demand.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_error.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_helpers.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_proposal.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_proposals_batch.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_service.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/market_strategy.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/network_error.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/network_network.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/network_node.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/network_service.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/package_package.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_InvoiceProcessor.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_agreement_payment_process.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_config.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_debit_note.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_error.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_invoice.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_payments.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_service.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/payment_strategy.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/script_command.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/storage_gftp.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/storage_null.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/storage_provider.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/storage_ws_browser.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/task_batch.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/task_error.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/task_process.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/task_service.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/task_task.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/task_work.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_env.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_logger_defaultLogger.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_logger_jsonLogger.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_logger_logger.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_logger_nullLogger.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_logger_pinoLogger.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_runtimeContextChecker.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_types.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_yagna_activity.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_yagna_gsb.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_yagna_identity.md create mode 100644 src/pages/ja/docs/golem-js/reference/modules/utils_yagna_yagna.md create mode 100644 src/pages/ja/docs/golem-js/reference/overview.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/.nojekyll create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/README.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/classes/task.Task.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/default-values.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/enums/task.TaskState.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/interfaces/events.TaskExecutorEventsDict.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/interfaces/service.TaskServiceOptions.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/interfaces/task.ProviderInfo.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/modules.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/modules/events.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/modules/executor.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/modules/service.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/modules/task.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/modules/types.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/modules/utils.md create mode 100644 src/pages/ja/docs/golem-sdk-task-executor/reference/overview.md create mode 100644 src/pages/ja/docs/golem/index.md create mode 100644 src/pages/ja/docs/golem/migrate/guideline.md create mode 100644 src/pages/ja/docs/golem/migrate/terms.md create mode 100644 src/pages/ja/docs/golem/overview/golem-token.md create mode 100644 src/pages/ja/docs/golem/overview/index.md create mode 100644 src/pages/ja/docs/golem/overview/provider.md create mode 100644 src/pages/ja/docs/golem/overview/requestor-faq.md create mode 100644 src/pages/ja/docs/golem/overview/requestor.md create mode 100644 src/pages/ja/docs/golem/overview/testnet-mainnet.md create mode 100644 src/pages/ja/docs/golem/payload-manifest/computation-payload-manifest.schema.md create mode 100644 src/pages/ja/docs/golem/payload-manifest/index.md create mode 100644 src/pages/ja/docs/golem/payments/golem-token-conversion.md create mode 100644 src/pages/ja/docs/golem/payments/index.md create mode 100644 src/pages/ja/docs/golem/payments/layer-2-payments.md create mode 100644 src/pages/ja/docs/golem/terms.md create mode 100644 src/pages/ja/docs/index.jsx create mode 100644 src/pages/ja/docs/providers/configuration/general.md create mode 100644 src/pages/ja/docs/providers/configuration/outbound.md create mode 100644 src/pages/ja/docs/providers/gpu/gpu-golem-live.md create mode 100644 src/pages/ja/docs/providers/index.md create mode 100644 src/pages/ja/docs/providers/maintenance.md create mode 100644 src/pages/ja/docs/providers/provider-faq.md create mode 100644 src/pages/ja/docs/providers/provider-installation.md create mode 100644 src/pages/ja/docs/providers/provider-uninstallation.md create mode 100644 src/pages/ja/docs/providers/wallet/backup.md create mode 100644 src/pages/ja/docs/providers/wallet/restoration.md create mode 100644 src/pages/ja/docs/quickstarts/golem-in-a-browser.md create mode 100644 src/pages/ja/docs/quickstarts/index.md create mode 100644 src/pages/ja/docs/quickstarts/js-quickstart.md create mode 100644 src/pages/ja/docs/quickstarts/no-code-app-deployment.md create mode 100644 src/pages/ja/docs/quickstarts/python-quickstart.md create mode 100644 src/pages/ja/docs/quickstarts/ray-quickstart.md create mode 100644 src/pages/ja/docs/quickstarts/retrievable-task.md create mode 100644 src/pages/ja/docs/reputation/finding-the-best-providers.md create mode 100644 src/pages/ja/docs/reputation/index.md create mode 100644 src/pages/ja/docs/reputation/reputation-api-swagger-ui-v1.md create mode 100644 src/pages/ja/docs/reputation/reputation-api-swagger-ui-v2.md create mode 100644 src/pages/ja/docs/reputation/using-reputation-with-nodejs.md create mode 100644 src/pages/ja/docs/templates/demo.md create mode 100644 src/pages/ja/docs/templates/example-template.md create mode 100644 src/pages/ja/docs/templates/guide-template.md create mode 100644 src/pages/ja/docs/templates/index-template.md create mode 100644 src/pages/ja/docs/templates/tutorial-template.md create mode 100644 src/pages/ja/docs/troubleshooting/dapps/index.md create mode 100644 src/pages/ja/docs/troubleshooting/javascript/index.md create mode 100644 src/pages/ja/docs/troubleshooting/js-requestor/exit-codes.md create mode 100644 src/pages/ja/docs/troubleshooting/js-requestor/index.md create mode 100644 src/pages/ja/docs/troubleshooting/provider/index.md create mode 100644 src/pages/ja/docs/troubleshooting/yagna/index.md create mode 100644 src/utils/localization.jsx diff --git a/next.config.mjs b/next.config.mjs index 46cb208f9..84f61b5d6 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -4,11 +4,18 @@ import withSearch from './src/markdoc/search.mjs' /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - pageExtensions: ['js', 'jsx', 'md'], + pageExtensions: ['md', 'mdoc', 'js', 'jsx', 'ts', 'tsx'], experimental: { scrollRestoration: true, }, distDir: 'dist', + i18n: { + locales: ['en', 'ja'], + // This is the default locale you want to be used when visiting + // a non-locale prefixed path e.g. `/hello` + defaultLocale: 'en', + localeDetection: false, // Disable automatic locale detection + }, } // if (!process.env.VERCEL) { diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index 7cef4e36a..2e3d4fb3f 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -8,7 +8,7 @@ import { YoutubeIcon } from './icons/YoutubeIcon' import { javascript, python, ray, dapps } from '@/navigation/footer' import { ArrowRightIcon } from './icons/ArrowRightIcon' import Link from 'next/link' - +import { useRouter } from 'next/router' const links = [...javascript, ...python] const navigation = [ @@ -40,43 +40,53 @@ const navigation = [ }, ] -const LinkSection = ({ title, links }) => ( -
-

- {title} -

- -
-) +const LinkSection = ({ title, links }) => { + const router = useRouter() + const locale = router.locale || 'en' -const DocSection = ({ title, description, link, data }) => ( -
- -
- {data.map(({ type, links }) => - links.length > 0 ? ( - - ) : null - )} + return ( +
+

+ {title} +

+
    + {links.map(({ title, href }) => ( +
  • + + {title} + +
  • + ))} +
+
+ ) +} + +const DocSection = ({ title, description, link, data }) => { + const router = useRouter() + const locale = router.locale || 'en' + + return ( +
+ +
+ {data.map(({ type, links }) => + links.length > 0 ? ( + + ) : null + )} +
-
-) + ) +} const DocHeader = ({ title, description, link, classes }) => ( <> @@ -87,47 +97,46 @@ const DocHeader = ({ title, description, link, classes }) => ( ) const NavLink = ({ link }) => ( - +
Overview{' '} - +
) -export const Footer = () => ( -
-
-
- - - +export const Footer = () => { + const router = useRouter() + const locale = router.locale || 'en' - {/* */} + return ( +
+
+
+ + + +
-
- -
-) + + + ) +} const LowerFooter = () => (
@@ -135,7 +144,7 @@ const LowerFooter = () => (
- + Copyright © 2023 Golem Factory GmbH diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx index 3771f4a2f..1ddc6641a 100644 --- a/src/components/Layout.jsx +++ b/src/components/Layout.jsx @@ -1,6 +1,5 @@ import { useCallback, useEffect, useState } from 'react' import Link from 'next/link' -import { useRouter } from 'next/router' import clsx from 'clsx' import { Hero } from '@/components/Hero' @@ -10,7 +9,6 @@ import { MobileNavigation } from '@/components/MobileNavigation' import { Prose } from '@/components/Prose' import { Search } from '@/components/Search' import { ThemeToggler } from '@/components/ThemeSelector' -import VersionSwitcher from '@/components/VersionSwitcher' function Heading({ section, isActive }) { const isChildActive = section.children.some(isActive) @@ -65,6 +63,9 @@ function recursiveRender(children, isActive, pageType = 'article') { function Header({ navigation }) { const [isScrolled, setIsScrolled] = useState(false) + const router = useRouter() + const { locale, locales, asPath } = router + console.log(locale) useEffect(() => { const handleScroll = () => { @@ -76,9 +77,10 @@ function Header({ navigation }) { } }, []) - const [githubInfo, setGithubInfo] = useState({ stargazersCount: 365, forks: 58 }) - - + const [githubInfo, setGithubInfo] = useState({ + stargazersCount: 365, + forks: 58, + }) return (
section.links) let LinkIndex = allLinks.findIndex((link) => link.href === router.pathname) let previousPage = allLinks[LinkIndex - 1] diff --git a/src/components/Navigation.jsx b/src/components/Navigation.jsx index 5ff4913a9..946a1f220 100644 --- a/src/components/Navigation.jsx +++ b/src/components/Navigation.jsx @@ -25,7 +25,9 @@ export const MenuBar = ({ navigation }) => { className="text-base text-primary dark:text-lightergray" key={item.title} target={item.links[0].href.startsWith('http') ? '_blank' : '_self'} - rel={item.links[0].href.startsWith('http') ? 'noopener noreferrer' : ''} + rel={ + item.links[0].href.startsWith('http') ? 'noopener noreferrer' : '' + } href={item.links[0].href} > {item.title} @@ -40,13 +42,8 @@ export const SideBar = ({ navigation }) => { const router = useRouter() const isActive = (item) => { - if ( - item.href && - (router.pathname === item.href || router.pathname === `${item.href}/`) - ) { - return true - } - return item.children?.some(isActive) || false + const { pathname } = router + return item.href && (pathname === item.href || pathname === `${item.href}/`) } const currentSection = navigation.find((section) => @@ -88,10 +85,13 @@ export const SideBar = ({ navigation }) => { ) : null } -export const NavigationItem = ({ item, isActive }) => - item.href ? ( +export const NavigationItem = ({ item, isActive }) => { + const { locale } = useRouter() + + return item.href ? ( {item.title} ) +} export const Dropdown = ({ children, isActive }) => { const [isOpen, setIsOpen] = useState(false) @@ -138,10 +139,10 @@ export const Dropdown = ({ children, isActive }) => { export const Navigation = ({ className, links, title = '' }) => { const router = useRouter() - const isActive = (item) => - item.href && - (router.pathname === item.href || router.pathname === item.href) - + const isActive = (item) => { + const { pathname } = router + return item.href && (pathname === item.href || pathname === `${item.href}/`) + } const renderNavItems = (items) => items.map((item) => { const itemIsActive = isActive(item) diff --git a/src/markdoc/search.mjs b/src/markdoc/search.mjs index 27b7ffdd0..4a7640feb 100644 --- a/src/markdoc/search.mjs +++ b/src/markdoc/search.mjs @@ -75,13 +75,14 @@ export default function (nextConfig = {}) { let data = files .map((file) => { if (file.startsWith('docs/templates/')) { - // Dont index templates + // Don't index templates console.log('Skipping', file) return } + let locale = file.split('/')[0] let url = - file === 'index.md' - ? '/' + file === `${locale}/index.md` + ? `/${locale}` : `/${file.replace(/\.md$/, '').replace(/\/index$/, '')}` let md = fs.readFileSync(path.join(pagesDir, file), 'utf8') @@ -97,25 +98,26 @@ export default function (nextConfig = {}) { )?.[1] let type = ast.attributes?.frontmatter ?.match(/^type:\s*(.*?)\s*$/m)?.[1] - .replace('"', '') + ?.replace('"', '') .replace('"', '') if ( + !type || type.toLowerCase() === 'noindex' || type.toLowerCase() === 'page' || type.toLowerCase() === 'noicon' ) { - // Dont index these pages + // Don't index these pages return } - const articleFor = file.startsWith('docs/creators/') + const articleFor = file.startsWith(`${locale}/docs/creators/`) ? 'Requestor' - : file.startsWith('docs/providers/') + : file.startsWith(`${locale}/docs/providers/`) ? 'Provider' - : file.startsWith('docs/quickstarts/') + : file.startsWith(`${locale}/docs/quickstarts/`) ? 'Requestor' - : file.startsWith('docs/golem-js/') + : file.startsWith(`${locale}/docs/golem-js/`) ? 'Requestor' : 'General' @@ -125,7 +127,7 @@ export default function (nextConfig = {}) { cache.set(file, [md, sections]) } - return { url, sections } + return { url, sections, locale } }) .filter((item) => item !== undefined) @@ -139,7 +141,7 @@ export default function (nextConfig = {}) { document: { id: 'url', index: 'content', - store: ['title', 'pageTitle', 'type', 'articleFor'], + store: ['title', 'pageTitle', 'type', 'articleFor', 'locale'], }, context: { resolution: 9, @@ -150,7 +152,7 @@ export default function (nextConfig = {}) { let data = ${JSON.stringify(data)} - for (let { url, sections } of data) { + for (let { url, sections, locale } of data) { for (let [title, hash, content] of sections) { if (title === [title, ...content].join('\\n')) continue @@ -161,6 +163,7 @@ export default function (nextConfig = {}) { pageTitle: hash ? sections[0][0] : undefined, type: sections[0][3], articleFor: sections[0][4], + locale, }) } } @@ -179,6 +182,7 @@ export default function (nextConfig = {}) { pageTitle: item.doc.pageTitle, type: item.doc.type, articleFor: item.doc.articleFor, + locale: item.doc.locale, })) } ` diff --git a/src/navigation/docs.ja.js b/src/navigation/docs.ja.js new file mode 100644 index 000000000..8c7d36801 --- /dev/null +++ b/src/navigation/docs.ja.js @@ -0,0 +1,707 @@ +import { navigation as taskExecutorReference } from './golem-sdk-task-executor-jsreference' +import { navigation as golemJsReference } from './golem-js-jsreference' +import { parseReference } from './parseReference' + +export const navigation = [ + { + title: 'ホーム', + links: [{ title: 'インデックス', href: '/' }], + }, + { + title: 'クイックスタート', + links: [ + { title: '紹介', href: '/docs/ja/quickstarts' }, + { + title: 'JS クイックスタート (node.js)', + href: '/docs/ja/quickstarts/js-quickstart', + }, + { + title: 'ブラウザでのGolem', + href: '/docs/ja/quickstarts/golem-in-a-browser', + }, + { + title: 'Golem上のRayクイックスタート', + href: '/docs/ja/quickstarts/ray-quickstart', + }, + { + title: '"ノーコード"アプリデプロイメント', + href: '/docs/ja/quickstarts/no-code-app-deployment', + }, + { + title: 'Pythonクイックスタート', + href: '/docs/ja/quickstarts/python-quickstart', + }, + { + title: '取得可能タスク', + href: '/docs/ja/quickstarts/retrievable-task', + }, + ], + }, + { + title: 'Golemで創造する', + links: [ + { title: 'どのように創造したいですか?', href: '/docs/ja/creators' }, + { + title: 'JavaScript', + children: [ + { title: '紹介', href: '/docs/ja/creators/javascript' }, + { + title: 'クイックスタート', + href: '/docs/ja/creators/javascript/quickstarts', + children: [ + { + title: 'Node.jsでのGolem', + href: '/docs/ja/creators/javascript/quickstarts/quickstart', + }, + { + title: 'ブラウザでのGolem', + href: '/docs/ja/creators/javascript/quickstarts/golem-in-a-browser', + }, + { + title: '取得可能タスク (Job API)', + href: '/docs/ja/creators/javascript/quickstarts/retrievable-task', + }, + ], + }, + { + title: 'ガイド', + href: '', + children: [ + { + title: 'ガイド一覧', + href: '/docs/ja/creators/javascript/guides', + }, + { + title: 'タスクモデル', + href: '/docs/ja/creators/javascript/guides/task-model', + }, + { + title: '取得可能タスク (Job API)', + href: '/docs/ja/creators/javascript/guides/retrievable-tasks', + }, + { + title: 'Golem SDK CLI', + href: '/docs/ja/creators/javascript/guides/golem-sdk-cli', + }, + { + title: 'インターネットへのアクセス', + href: '/docs/ja/creators/javascript/guides/accessing-internet', + }, + { + title: 'VMファイルシステム', + href: '/docs/ja/creators/common/providers-filesystem', + }, + { + title: 'Golemイメージ', + href: '/docs/ja/creators/javascript/guides/golem-images', + }, + { + title: 'GolemイメージFAQ', + href: '/docs/ja/creators/javascript/guides/golem-images-faq', + }, + { + title: 'エラー処理', + href: '/docs/ja/creators/javascript/guides/error-handling', + }, + { + title: 'メインネットへの切り替え', + href: '/docs/ja/creators/javascript/guides/switching-to-mainnet', + }, + ], + }, + { + title: 'チュートリアル', + children: [ + { + title: 'チュートリアル一覧', + href: '/docs/ja/creators/javascript/tutorials', + }, + { + title: 'クイックスタートの説明', + href: '/docs/ja/creators/javascript/tutorials/quickstart-explained', + }, + { + title: '並列タスクの実行', + href: '/docs/ja/creators/javascript/tutorials/running-parallel-tasks', + }, + { + title: 'ブラウザでのGolem', + href: '/docs/ja/creators/javascript/tutorials/running-in-browser', + }, + { + title: 'カスタムイメージの構築', + href: '/docs/ja/creators/javascript/tutorials/building-custom-image', + }, + { + title: 'アウトバウンドの使用', + href: '/docs/ja/creators/javascript/tutorials/accessing-internet', + }, + { + title: 'Golemイメージのテスト', + href: '/docs/ja/creators/javascript/tutorials/testing-golem-image', + }, + { + title: 'Express.jsでのREST API', + href: '/docs/ja/creators/javascript/tutorials/rest-api-with-express', + }, + ], + }, + { + title: 'JS Task API', + href: '', + children: [ + { + title: 'Task API 例', + href: '', + children: [ + { + title: '例一覧', + href: '/docs/ja/creators/javascript/examples', + }, + { + title: 'タスクの実行', + href: '/docs/ja/creators/javascript/examples/executing-tasks', + }, + { + title: 'タスクの構成', + href: '/docs/ja/creators/javascript/examples/composing-tasks', + }, + { + title: 'データの転送', + href: '/docs/ja/creators/javascript/examples/transferring-data', + }, + { + title: '結果の処理', + href: '/docs/ja/creators/javascript/examples/working-with-results', + }, + { + title: 'プロバイダーの選択', + href: '/docs/ja/creators/javascript/examples/selecting-providers', + }, + { + title: 'イメージの操作', + href: '/docs/ja/creators/javascript/examples/working-with-images', + }, + { + title: 'アプリキーの使用', + href: '/docs/ja/creators/javascript/examples/using-app-keys', + }, + { + title: 'インターネットへのアクセス', + href: '/docs/ja/creators/javascript/examples/accessing-internet', + }, + { + title: 'メインネットへの切り替え', + href: '/docs/ja/creators/javascript/examples/switching-to-mainnet', + }, + ], + }, + parseReference('Task API リファレンス', taskExecutorReference), + ], + }, + { + title: 'React SDK', + href: '', + children: [ + { + title: '紹介', + href: '/docs/ja/creators/javascript/react', + }, + { + title: '始めましょう', + href: '/docs/ja/creators/javascript/react/getting-started', + }, + { + title: 'APIリファレンス', + href: '', + children: [ + { + title: '概要', + href: '/docs/ja/creators/javascript/react/api-reference-overview', + }, + { + title: 'YagnaProvider', + href: '/docs/ja/creators/javascript/react/yagna-provider', + }, + { + title: 'useYagna', + href: '/docs/ja/creators/javascript/react/use-yagna', + }, + { + title: 'useExecutor', + href: '/docs/ja/creators/javascript/react/use-executor', + }, + { + title: 'useTask', + href: '/docs/ja/creators/javascript/react/use-task', + }, + { + title: 'useInvoices', + href: '/docs/ja/creators/javascript/react/use-invoices', + }, + { + title: 'useDebitNotes', + href: '/docs/ja/creators/javascript/react/use-debit-notes', + }, + { + title: 'useHandleInvoice', + href: '/docs/ja/creators/javascript/react/use-handle-invoice', + }, + { + title: 'useHandleDebitNote', + href: '/docs/ja/creators/javascript/react/use-handle-debit-note', + }, + ], + }, + ], + }, + parseReference('Golem JS APIリファレンス', golemJsReference), + ], + }, + { + title: 'Golem上のPythonとRay', + children: [ + { + title: '始めましょう', + href: '', + children: [ + { title: '紹介', href: '/docs/ja/creators/ray' }, + { + title: 'クイックスタート', + href: '/docs/ja/creators/ray/quickstart', + }, + { + title: 'セットアップチュートリアル', + href: '/docs/ja/creators/ray/setup-tutorial', + }, + { + title: 'サポートされているバージョンとその他の制限', + href: '/docs/ja/creators/ray/supported-versions-and-other-limitations', + }, + ], + }, + { + title: 'チュートリアル', + href: '', + children: [ + { + title: '基本的なRayタスク使用チュートリアル', + href: '/docs/ja/creators/ray/basic-ray-tasks-usage-tutorial', + }, + { + title: '実際のユースケースをGolem上のRayに変換する', + href: '/docs/ja/creators/ray/conversion-to-ray-on-golem-tutorial', + }, + { + title: 'メインネットでの実行', + href: '/docs/ja/creators/ray/mainnet', + }, + { + title: + 'インターネットへのアクセス(アウトバウンド)チュートリアル', + href: '/docs/ja/creators/ray/outbound', + }, + ], + }, + { + title: 'Golem上のRayツール', + href: '', + children: [ + { + title: 'クラスターyaml', + href: '/docs/ja/creators/ray/cluster-yaml', + }, + { + title: 'Ray CLI', + href: '/docs/ja/creators/ray/ray-cli', + }, + { + title: 'Golem上のRay CLI', + href: '/docs/ja/creators/ray/ray-on-golem-cli', + }, + ], + }, + ], + }, + { + title: 'Python', + children: [ + { title: '紹介', href: '/docs/ja/creators/python' }, + { + title: 'クイックスタート', + href: '', + children: [ + { + title: 'Task API クイックスタート', + href: '/docs/ja/creators/python/quickstarts/run-first-task-on-golem', + }, + ], + }, + { + title: 'ガイド', + href: '', + children: [ + { + title: 'ガイド一覧', + href: '/docs/ja/creators/python/guides', + }, + { + title: 'アプリケーションの基礎', + href: '/docs/ja/creators/python/guides/application-fundamentals', + }, + { + title: 'タスクモデル', + href: '/docs/ja/creators/python/guides/task-model', + }, + { + title: 'サービスモデル', + href: '/docs/ja/creators/python/guides/service-model', + }, + { + title: 'Golemイメージ', + href: '/docs/ja/creators/python/guides/golem-images', + }, + { + title: 'GolemイメージFAQ', + href: '/docs/ja/creators/python/guides/golem-images-faq', + }, + { + title: 'メインネットへの切り替え', + href: '/docs/ja/creators/python/guides/switching-to-mainnet', + }, + { + title: 'VPN', + href: '/docs/ja/creators/python/guides/vpn', + }, + { + title: 'デバッグ', + href: '/docs/ja/creators/python/guides/debugging', + }, + ], + }, + { + title: 'チュートリアル', + children: [ + { + title: 'チュートリアル一覧', + href: '/docs/ja/creators/python/tutorials', + }, + { + title: 'Task API - Hello World', + href: '/docs/ja/creators/python/tutorials/task-example-0-hello', + }, + { + title: 'Task API - Cracker', + href: '/docs/ja/creators/python/tutorials/task-example-1-cracker', + }, + { + title: 'Task API - Hashcat', + href: '/docs/ja/creators/python/tutorials/task-example-2-hashcat', + }, + { + title: 'Service API - Hello World', + href: '/docs/ja/creators/python/tutorials/service-example-0-hello-world', + }, + { + title: 'Service API - Simple', + href: '/docs/ja/creators/python/tutorials/service-example-1-simple-service', + }, + { + title: 'Service API - SSH', + href: '/docs/ja/creators/python/tutorials/service-example-2-vpn-ssh-terminal', + }, + { + title: 'Service API - Proxy', + href: '/docs/ja/creators/python/tutorials/service-example-3-vpn-simple-http-proxy', + }, + { + title: 'Service API - Counter', + href: '/docs/ja/creators/python/tutorials/service-example-4-custom-usage-counters', + }, + { + title: 'Service API - Web app', + href: '/docs/ja/creators/python/tutorials/service-example-5-webapp', + }, + { + title: 'Service API - External API', + href: '/docs/ja/creators/python/tutorials/service-example-6-external-api-request', + }, + { + title: 'カスタムイメージの構築', + href: '/docs/ja/creators/python/tutorials/building-custom-image', + }, + ], + }, + { + title: 'セルフホストVMイメージ', + href: '/docs/ja/creators/python/examples/tools/self-hosted-vm-images', + }, + { + title: 'Python APIリファレンス', + href: 'https://yapapi.readthedocs.io/en/latest/api.html', + }, + ], + }, + { + title: 'Golemでのアプリのデプロイ', + children: [ + { title: '紹介', href: '/docs/ja/creators/dapps' }, + { + title: 'クイックスタート', + href: '/docs/ja/creators/dapps/run-a-dapp', + }, + { + title: 'Hello World Dapp', + href: '/docs/ja/creators/dapps/hello-world-dapp', + }, + { + title: '複数のdappsの管理', + href: '/docs/ja/creators/dapps/managing-multiple-dapps', + }, + { + title: 'Golem Dappsの作成', + href: '/docs/ja/creators/dapps/creating-golem-dapps', + }, + { + title: 'DockerとGolem VMの違い', + href: '/docs/ja/creators/dapps/docker-containers-vs-golem-vms', + }, + ], + }, + { + title: '評判システム', + children: [ + { title: '紹介', href: '/docs/ja/reputation' }, + { + title: 'リクエスターとして最適なプロバイダーを見つける方法', + href: '/docs/ja/reputation/finding-the-best-providers', + }, + { + title: 'Node.js統合例', + href: '/docs/ja/reputation/using-reputation-with-nodejs', + }, + { + title: '評判API Swagger UI V1', + href: '/docs/ja/reputation/reputation-api-swagger-ui-v1', + }, + { + title: '評判API Swagger UI V2', + href: '/docs/ja/reputation/reputation-api-swagger-ui-v2', + }, + ], + }, + { + title: 'トラブルシューティング', + children: [ + { + title: 'JavaScriptリクエスター', + href: '/docs/ja/troubleshooting/js-requestor', + }, + { + title: 'Golem上のRay', + href: '/docs/ja/creators/ray/troubleshooting', + }, + { + title: 'Yagna', + href: '/docs/ja/troubleshooting/yagna', + }, + { + title: 'dApps', + href: '/docs/ja/troubleshooting/dapps', + }, + { + title: '終了コード', + href: '/docs/ja/troubleshooting/js-requestor/exit-codes', + }, + ], + }, + { + title: '------------------------------', + }, + { + title: '共通開発者ツール', + children: [ + { + title: 'Yagna', + href: '/docs/ja/creators/tools/yagna', + children: [ + { + title: 'Yagnaのインストール', + href: '/docs/ja/creators/tools/yagna/yagna-installation-for-requestors', + }, + { + title: 'Yagnaのアンインストール', + href: '/docs/ja/creators/tools/yagna/requestor-uninstallation', + }, + { + title: 'Golemウォレットの管理', + href: '/docs/ja/creators/tools/yagna/managing-golem-wallet', + }, + { + title: 'Golemウォレットのバックアップ', + href: '/docs/ja/creators/tools/yagna/golem-wallet-backup', + }, + { + title: 'Golemウォレットの復元', + href: '/docs/ja/creators/tools/yagna/restoring-golem-wallet', + }, + { + title: 'Yagnaの主要コマンド', + href: '/docs/ja/creators/tools/yagna/yagna-mostly-used-commands', + }, + ], + }, + { + title: 'Gvmkit-build', + href: '/docs/ja/creators/tools/gvmkit', + children: [ + { + title: 'Gvmkit-buildのインストール', + href: '/docs/ja/creators/tools/gvmkit/gvmkit-build-installation', + }, + { + title: 'Golemイメージの作成', + href: '/docs/ja/creators/tools/gvmkit/converting-docker-image-to-golem-format', + }, + { + title: 'カスタムイメージの公開', + href: '/docs/ja/creators/tools/gvmkit/publishing-custom-images', + }, + ], + }, + { + title: 'Goth', + href: '/docs/ja/creators/tools/goth', + children: [ + { + title: 'Gothチュートリアル', + href: '/docs/ja/creators/tools/goth/running-goth', + }, + { + title: 'インタラクティブモードでのGoth', + href: '/docs/ja/creators/tools/goth/running-goths-interactive-mode', + }, + ], + }, + ], + }, + { + title: '開発者向けGolemの概念', + children: [ + { + title: 'プロバイダーのファイルシステム', + href: '/docs/ja/creators/common/providers-filesystem', + }, + { + title: 'リクエスターとプロバイダーの相互作用', + href: '/docs/ja/creators/common/requestor-provider-interaction', + }, + ], + }, + ], + }, + { + title: '共有して稼ぐ', + links: [ + { title: '紹介', href: '/docs/ja/providers' }, + { title: 'インストール', href: '/docs/ja/providers/provider-installation' }, + { + title: 'プロバイダーの設定', + children: [ + { + title: '一般設定', + href: '/docs/ja/providers/configuration/general', + }, + { + title: 'アウトバウンドネットワーキング', + href: '/docs/ja/providers/configuration/outbound', + }, + ], + }, + { + title: 'ウォレットの管理', + children: [ + { + title: 'ウォレットのバックアップ', + href: '/docs/ja/providers/wallet/backup', + }, + { + title: 'ウォレットの復元', + href: '/docs/ja/providers/wallet/restoration', + }, + ], + }, + { title: 'メンテナンスと更新', href: '/docs/ja/providers/maintenance' }, + { title: 'GPUプロバイダー', href: '/docs/ja/providers/gpu/gpu-golem-live' }, + { + title: 'トラブルシューティング', + href: '/docs/ja/troubleshooting/provider', + }, + { + title: 'アンインストール', + href: '/docs/ja/providers/provider-uninstallation', + }, + { title: 'プロバイダーFAQ', href: '/docs/ja/providers/provider-faq' }, + ], + }, + { + title: '一般情報', + links: [ + { title: '目次', href: '/docs/ja/golem' }, + { + title: 'Golem概要', + children: [ + { title: 'Golem概要', href: '/docs/ja/golem/overview' }, + { title: 'プロバイダー', href: '/docs/ja/golem/overview/provider' }, + { title: 'リクエスター', href: '/docs/ja/golem/overview/requestor' }, + { title: 'GLMトークン', href: '/docs/ja/golem/overview/golem-token' }, + { + title: 'テストネットvsメインネット', + href: '/docs/ja/golem/overview/testnet-mainnet', + }, + ], + }, + { + title: '支払い', + children: [ + { title: '支払いの説明', href: '/docs/ja/golem/payments' }, + { + title: 'レイヤー2支払い', + href: '/docs/ja/golem/payments/layer-2-payments', + }, + { + title: 'Golemトークンの変換', + href: '/docs/ja/golem/payments/golem-token-conversion', + }, + ], + }, + { + title: 'ペイロードマニフェスト', + children: [ + { + title: 'ペイロードマニフェストの説明', + href: '/docs/ja/golem/payload-manifest', + }, + { + title: 'スキーマ', + href: '/docs/ja/golem/payload-manifest/computation-payload-manifest.schema', + }, + ], + }, + { + title: 'Golem移行アプリケーション', + children: [ + { + title: '移行の利用規約', + href: '/docs/ja/golem/migrate/terms', + }, + { + title: '移行ガイドライン', + href: '/docs/ja/golem/migrate/guideline', + }, + ], + }, + { title: '利用規約', href: '/docs/ja/golem/terms' }, + ], + }, +] diff --git a/src/pages/docs/creators/common/providers-filesystem.md b/src/pages/en/docs/creators/common/providers-filesystem.md similarity index 100% rename from src/pages/docs/creators/common/providers-filesystem.md rename to src/pages/en/docs/creators/common/providers-filesystem.md diff --git a/src/pages/docs/creators/common/requestor-provider-interaction.md b/src/pages/en/docs/creators/common/requestor-provider-interaction.md similarity index 100% rename from src/pages/docs/creators/common/requestor-provider-interaction.md rename to src/pages/en/docs/creators/common/requestor-provider-interaction.md diff --git a/src/pages/docs/creators/dapps/creating-golem-dapps.md b/src/pages/en/docs/creators/dapps/creating-golem-dapps.md similarity index 100% rename from src/pages/docs/creators/dapps/creating-golem-dapps.md rename to src/pages/en/docs/creators/dapps/creating-golem-dapps.md diff --git a/src/pages/docs/creators/dapps/docker-containers-vs-golem-vms.md b/src/pages/en/docs/creators/dapps/docker-containers-vs-golem-vms.md similarity index 100% rename from src/pages/docs/creators/dapps/docker-containers-vs-golem-vms.md rename to src/pages/en/docs/creators/dapps/docker-containers-vs-golem-vms.md diff --git a/src/pages/docs/creators/dapps/hello-world-dapp.md b/src/pages/en/docs/creators/dapps/hello-world-dapp.md similarity index 100% rename from src/pages/docs/creators/dapps/hello-world-dapp.md rename to src/pages/en/docs/creators/dapps/hello-world-dapp.md diff --git a/src/pages/docs/creators/dapps/index.md b/src/pages/en/docs/creators/dapps/index.md similarity index 100% rename from src/pages/docs/creators/dapps/index.md rename to src/pages/en/docs/creators/dapps/index.md diff --git a/src/pages/docs/creators/dapps/managing-multiple-dapps.md b/src/pages/en/docs/creators/dapps/managing-multiple-dapps.md similarity index 100% rename from src/pages/docs/creators/dapps/managing-multiple-dapps.md rename to src/pages/en/docs/creators/dapps/managing-multiple-dapps.md diff --git a/src/pages/docs/creators/dapps/run-a-dapp.md b/src/pages/en/docs/creators/dapps/run-a-dapp.md similarity index 100% rename from src/pages/docs/creators/dapps/run-a-dapp.md rename to src/pages/en/docs/creators/dapps/run-a-dapp.md diff --git a/src/pages/docs/creators/index.md b/src/pages/en/docs/creators/index.md similarity index 100% rename from src/pages/docs/creators/index.md rename to src/pages/en/docs/creators/index.md diff --git a/src/pages/docs/creators/javascript/examples/accessing-internet.md b/src/pages/en/docs/creators/javascript/examples/accessing-internet.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/accessing-internet.md rename to src/pages/en/docs/creators/javascript/examples/accessing-internet.md diff --git a/src/pages/docs/creators/javascript/examples/composing-tasks.md b/src/pages/en/docs/creators/javascript/examples/composing-tasks.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/composing-tasks.md rename to src/pages/en/docs/creators/javascript/examples/composing-tasks.md diff --git a/src/pages/docs/creators/javascript/examples/executing-tasks.md b/src/pages/en/docs/creators/javascript/examples/executing-tasks.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/executing-tasks.md rename to src/pages/en/docs/creators/javascript/examples/executing-tasks.md diff --git a/src/pages/docs/creators/javascript/examples/index.md b/src/pages/en/docs/creators/javascript/examples/index.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/index.md rename to src/pages/en/docs/creators/javascript/examples/index.md diff --git a/src/pages/docs/creators/javascript/examples/selecting-providers.md b/src/pages/en/docs/creators/javascript/examples/selecting-providers.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/selecting-providers.md rename to src/pages/en/docs/creators/javascript/examples/selecting-providers.md diff --git a/src/pages/docs/creators/javascript/examples/switching-to-mainnet.md b/src/pages/en/docs/creators/javascript/examples/switching-to-mainnet.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/switching-to-mainnet.md rename to src/pages/en/docs/creators/javascript/examples/switching-to-mainnet.md diff --git a/src/pages/docs/creators/javascript/examples/transferring-data.md b/src/pages/en/docs/creators/javascript/examples/transferring-data.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/transferring-data.md rename to src/pages/en/docs/creators/javascript/examples/transferring-data.md diff --git a/src/pages/docs/creators/javascript/examples/using-app-keys.md b/src/pages/en/docs/creators/javascript/examples/using-app-keys.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/using-app-keys.md rename to src/pages/en/docs/creators/javascript/examples/using-app-keys.md diff --git a/src/pages/docs/creators/javascript/examples/working-with-events.md b/src/pages/en/docs/creators/javascript/examples/working-with-events.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/working-with-events.md rename to src/pages/en/docs/creators/javascript/examples/working-with-events.md diff --git a/src/pages/docs/creators/javascript/examples/working-with-images.md b/src/pages/en/docs/creators/javascript/examples/working-with-images.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/working-with-images.md rename to src/pages/en/docs/creators/javascript/examples/working-with-images.md diff --git a/src/pages/docs/creators/javascript/examples/working-with-results.md b/src/pages/en/docs/creators/javascript/examples/working-with-results.md similarity index 100% rename from src/pages/docs/creators/javascript/examples/working-with-results.md rename to src/pages/en/docs/creators/javascript/examples/working-with-results.md diff --git a/src/pages/docs/creators/javascript/guides/accessing-internet.md b/src/pages/en/docs/creators/javascript/guides/accessing-internet.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/accessing-internet.md rename to src/pages/en/docs/creators/javascript/guides/accessing-internet.md diff --git a/src/pages/docs/creators/javascript/guides/error-handling.md b/src/pages/en/docs/creators/javascript/guides/error-handling.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/error-handling.md rename to src/pages/en/docs/creators/javascript/guides/error-handling.md diff --git a/src/pages/docs/creators/javascript/guides/golem-images-faq.md b/src/pages/en/docs/creators/javascript/guides/golem-images-faq.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/golem-images-faq.md rename to src/pages/en/docs/creators/javascript/guides/golem-images-faq.md diff --git a/src/pages/docs/creators/javascript/guides/golem-images.md b/src/pages/en/docs/creators/javascript/guides/golem-images.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/golem-images.md rename to src/pages/en/docs/creators/javascript/guides/golem-images.md diff --git a/src/pages/docs/creators/javascript/guides/golem-sdk-cli.md b/src/pages/en/docs/creators/javascript/guides/golem-sdk-cli.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/golem-sdk-cli.md rename to src/pages/en/docs/creators/javascript/guides/golem-sdk-cli.md diff --git a/src/pages/docs/creators/javascript/guides/index.md b/src/pages/en/docs/creators/javascript/guides/index.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/index.md rename to src/pages/en/docs/creators/javascript/guides/index.md diff --git a/src/pages/docs/creators/javascript/guides/retrievable-tasks.md b/src/pages/en/docs/creators/javascript/guides/retrievable-tasks.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/retrievable-tasks.md rename to src/pages/en/docs/creators/javascript/guides/retrievable-tasks.md diff --git a/src/pages/docs/creators/javascript/guides/switching-to-mainnet.md b/src/pages/en/docs/creators/javascript/guides/switching-to-mainnet.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/switching-to-mainnet.md rename to src/pages/en/docs/creators/javascript/guides/switching-to-mainnet.md diff --git a/src/pages/docs/creators/javascript/guides/task-model.md b/src/pages/en/docs/creators/javascript/guides/task-model.md similarity index 100% rename from src/pages/docs/creators/javascript/guides/task-model.md rename to src/pages/en/docs/creators/javascript/guides/task-model.md diff --git a/src/pages/docs/creators/javascript/index.md b/src/pages/en/docs/creators/javascript/index.md similarity index 100% rename from src/pages/docs/creators/javascript/index.md rename to src/pages/en/docs/creators/javascript/index.md diff --git a/src/pages/docs/creators/javascript/quickstarts/golem-in-a-browser.md b/src/pages/en/docs/creators/javascript/quickstarts/golem-in-a-browser.md similarity index 100% rename from src/pages/docs/creators/javascript/quickstarts/golem-in-a-browser.md rename to src/pages/en/docs/creators/javascript/quickstarts/golem-in-a-browser.md diff --git a/src/pages/docs/creators/javascript/quickstarts/index.md b/src/pages/en/docs/creators/javascript/quickstarts/index.md similarity index 100% rename from src/pages/docs/creators/javascript/quickstarts/index.md rename to src/pages/en/docs/creators/javascript/quickstarts/index.md diff --git a/src/pages/docs/creators/javascript/quickstarts/quickstart.md b/src/pages/en/docs/creators/javascript/quickstarts/quickstart.md similarity index 100% rename from src/pages/docs/creators/javascript/quickstarts/quickstart.md rename to src/pages/en/docs/creators/javascript/quickstarts/quickstart.md diff --git a/src/pages/docs/creators/javascript/quickstarts/retrievable-task.md b/src/pages/en/docs/creators/javascript/quickstarts/retrievable-task.md similarity index 100% rename from src/pages/docs/creators/javascript/quickstarts/retrievable-task.md rename to src/pages/en/docs/creators/javascript/quickstarts/retrievable-task.md diff --git a/src/pages/docs/creators/javascript/react/api-reference-overview.md b/src/pages/en/docs/creators/javascript/react/api-reference-overview.md similarity index 100% rename from src/pages/docs/creators/javascript/react/api-reference-overview.md rename to src/pages/en/docs/creators/javascript/react/api-reference-overview.md diff --git a/src/pages/docs/creators/javascript/react/getting-started.md b/src/pages/en/docs/creators/javascript/react/getting-started.md similarity index 100% rename from src/pages/docs/creators/javascript/react/getting-started.md rename to src/pages/en/docs/creators/javascript/react/getting-started.md diff --git a/src/pages/docs/creators/javascript/react/index.md b/src/pages/en/docs/creators/javascript/react/index.md similarity index 100% rename from src/pages/docs/creators/javascript/react/index.md rename to src/pages/en/docs/creators/javascript/react/index.md diff --git a/src/pages/docs/creators/javascript/react/use-executor.md b/src/pages/en/docs/creators/javascript/react/use-executor.md similarity index 100% rename from src/pages/docs/creators/javascript/react/use-executor.md rename to src/pages/en/docs/creators/javascript/react/use-executor.md diff --git a/src/pages/docs/creators/javascript/react/use-handle-invoice.md b/src/pages/en/docs/creators/javascript/react/use-handle-invoice.md similarity index 100% rename from src/pages/docs/creators/javascript/react/use-handle-invoice.md rename to src/pages/en/docs/creators/javascript/react/use-handle-invoice.md diff --git a/src/pages/docs/creators/javascript/react/use-invoices.md b/src/pages/en/docs/creators/javascript/react/use-invoices.md similarity index 100% rename from src/pages/docs/creators/javascript/react/use-invoices.md rename to src/pages/en/docs/creators/javascript/react/use-invoices.md diff --git a/src/pages/docs/creators/javascript/react/use-task.md b/src/pages/en/docs/creators/javascript/react/use-task.md similarity index 100% rename from src/pages/docs/creators/javascript/react/use-task.md rename to src/pages/en/docs/creators/javascript/react/use-task.md diff --git a/src/pages/docs/creators/javascript/react/use-yagna.md b/src/pages/en/docs/creators/javascript/react/use-yagna.md similarity index 100% rename from src/pages/docs/creators/javascript/react/use-yagna.md rename to src/pages/en/docs/creators/javascript/react/use-yagna.md diff --git a/src/pages/docs/creators/javascript/react/yagna-provider.md b/src/pages/en/docs/creators/javascript/react/yagna-provider.md similarity index 100% rename from src/pages/docs/creators/javascript/react/yagna-provider.md rename to src/pages/en/docs/creators/javascript/react/yagna-provider.md diff --git a/src/pages/docs/creators/javascript/tutorials/accessing-internet.md b/src/pages/en/docs/creators/javascript/tutorials/accessing-internet.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/accessing-internet.md rename to src/pages/en/docs/creators/javascript/tutorials/accessing-internet.md diff --git a/src/pages/docs/creators/javascript/tutorials/building-custom-image.md b/src/pages/en/docs/creators/javascript/tutorials/building-custom-image.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/building-custom-image.md rename to src/pages/en/docs/creators/javascript/tutorials/building-custom-image.md diff --git a/src/pages/docs/creators/javascript/tutorials/index.md b/src/pages/en/docs/creators/javascript/tutorials/index.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/index.md rename to src/pages/en/docs/creators/javascript/tutorials/index.md diff --git a/src/pages/docs/creators/javascript/tutorials/quickstart-explained.md b/src/pages/en/docs/creators/javascript/tutorials/quickstart-explained.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/quickstart-explained.md rename to src/pages/en/docs/creators/javascript/tutorials/quickstart-explained.md diff --git a/src/pages/docs/creators/javascript/tutorials/rest-api-with-express.md b/src/pages/en/docs/creators/javascript/tutorials/rest-api-with-express.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/rest-api-with-express.md rename to src/pages/en/docs/creators/javascript/tutorials/rest-api-with-express.md diff --git a/src/pages/docs/creators/javascript/tutorials/running-in-browser.md b/src/pages/en/docs/creators/javascript/tutorials/running-in-browser.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/running-in-browser.md rename to src/pages/en/docs/creators/javascript/tutorials/running-in-browser.md diff --git a/src/pages/docs/creators/javascript/tutorials/running-parallel-tasks.md b/src/pages/en/docs/creators/javascript/tutorials/running-parallel-tasks.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/running-parallel-tasks.md rename to src/pages/en/docs/creators/javascript/tutorials/running-parallel-tasks.md diff --git a/src/pages/docs/creators/javascript/tutorials/testing-golem-image.md b/src/pages/en/docs/creators/javascript/tutorials/testing-golem-image.md similarity index 100% rename from src/pages/docs/creators/javascript/tutorials/testing-golem-image.md rename to src/pages/en/docs/creators/javascript/tutorials/testing-golem-image.md diff --git a/src/pages/docs/creators/python/examples/tools/self-hosted-vm-images.md b/src/pages/en/docs/creators/python/examples/tools/self-hosted-vm-images.md similarity index 100% rename from src/pages/docs/creators/python/examples/tools/self-hosted-vm-images.md rename to src/pages/en/docs/creators/python/examples/tools/self-hosted-vm-images.md diff --git a/src/pages/docs/creators/python/guides/application-fundamentals.md b/src/pages/en/docs/creators/python/guides/application-fundamentals.md similarity index 100% rename from src/pages/docs/creators/python/guides/application-fundamentals.md rename to src/pages/en/docs/creators/python/guides/application-fundamentals.md diff --git a/src/pages/docs/creators/python/guides/debugging.md b/src/pages/en/docs/creators/python/guides/debugging.md similarity index 100% rename from src/pages/docs/creators/python/guides/debugging.md rename to src/pages/en/docs/creators/python/guides/debugging.md diff --git a/src/pages/docs/creators/python/guides/golem-images-faq.md b/src/pages/en/docs/creators/python/guides/golem-images-faq.md similarity index 100% rename from src/pages/docs/creators/python/guides/golem-images-faq.md rename to src/pages/en/docs/creators/python/guides/golem-images-faq.md diff --git a/src/pages/docs/creators/python/guides/golem-images.md b/src/pages/en/docs/creators/python/guides/golem-images.md similarity index 100% rename from src/pages/docs/creators/python/guides/golem-images.md rename to src/pages/en/docs/creators/python/guides/golem-images.md diff --git a/src/pages/docs/creators/python/guides/index.md b/src/pages/en/docs/creators/python/guides/index.md similarity index 100% rename from src/pages/docs/creators/python/guides/index.md rename to src/pages/en/docs/creators/python/guides/index.md diff --git a/src/pages/docs/creators/python/guides/service-model.md b/src/pages/en/docs/creators/python/guides/service-model.md similarity index 100% rename from src/pages/docs/creators/python/guides/service-model.md rename to src/pages/en/docs/creators/python/guides/service-model.md diff --git a/src/pages/docs/creators/python/guides/switching-to-mainnet.md b/src/pages/en/docs/creators/python/guides/switching-to-mainnet.md similarity index 100% rename from src/pages/docs/creators/python/guides/switching-to-mainnet.md rename to src/pages/en/docs/creators/python/guides/switching-to-mainnet.md diff --git a/src/pages/docs/creators/python/guides/task-model.md b/src/pages/en/docs/creators/python/guides/task-model.md similarity index 100% rename from src/pages/docs/creators/python/guides/task-model.md rename to src/pages/en/docs/creators/python/guides/task-model.md diff --git a/src/pages/docs/creators/python/guides/vpn.md b/src/pages/en/docs/creators/python/guides/vpn.md similarity index 100% rename from src/pages/docs/creators/python/guides/vpn.md rename to src/pages/en/docs/creators/python/guides/vpn.md diff --git a/src/pages/docs/creators/python/index.md b/src/pages/en/docs/creators/python/index.md similarity index 100% rename from src/pages/docs/creators/python/index.md rename to src/pages/en/docs/creators/python/index.md diff --git a/src/pages/docs/creators/python/quickstarts/run-first-task-on-golem.md b/src/pages/en/docs/creators/python/quickstarts/run-first-task-on-golem.md similarity index 100% rename from src/pages/docs/creators/python/quickstarts/run-first-task-on-golem.md rename to src/pages/en/docs/creators/python/quickstarts/run-first-task-on-golem.md diff --git a/src/pages/docs/creators/python/tutorials/building-custom-image.md b/src/pages/en/docs/creators/python/tutorials/building-custom-image.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/building-custom-image.md rename to src/pages/en/docs/creators/python/tutorials/building-custom-image.md diff --git a/src/pages/docs/creators/python/tutorials/index.md b/src/pages/en/docs/creators/python/tutorials/index.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/index.md rename to src/pages/en/docs/creators/python/tutorials/index.md diff --git a/src/pages/docs/creators/python/tutorials/service-example-0-hello-world.md b/src/pages/en/docs/creators/python/tutorials/service-example-0-hello-world.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/service-example-0-hello-world.md rename to src/pages/en/docs/creators/python/tutorials/service-example-0-hello-world.md diff --git a/src/pages/docs/creators/python/tutorials/service-example-1-simple-service.md b/src/pages/en/docs/creators/python/tutorials/service-example-1-simple-service.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/service-example-1-simple-service.md rename to src/pages/en/docs/creators/python/tutorials/service-example-1-simple-service.md diff --git a/src/pages/docs/creators/python/tutorials/service-example-2-vpn-ssh-terminal.md b/src/pages/en/docs/creators/python/tutorials/service-example-2-vpn-ssh-terminal.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/service-example-2-vpn-ssh-terminal.md rename to src/pages/en/docs/creators/python/tutorials/service-example-2-vpn-ssh-terminal.md diff --git a/src/pages/docs/creators/python/tutorials/service-example-3-vpn-simple-http-proxy.md b/src/pages/en/docs/creators/python/tutorials/service-example-3-vpn-simple-http-proxy.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/service-example-3-vpn-simple-http-proxy.md rename to src/pages/en/docs/creators/python/tutorials/service-example-3-vpn-simple-http-proxy.md diff --git a/src/pages/docs/creators/python/tutorials/service-example-4-custom-usage-counters.md b/src/pages/en/docs/creators/python/tutorials/service-example-4-custom-usage-counters.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/service-example-4-custom-usage-counters.md rename to src/pages/en/docs/creators/python/tutorials/service-example-4-custom-usage-counters.md diff --git a/src/pages/docs/creators/python/tutorials/service-example-5-webapp.md b/src/pages/en/docs/creators/python/tutorials/service-example-5-webapp.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/service-example-5-webapp.md rename to src/pages/en/docs/creators/python/tutorials/service-example-5-webapp.md diff --git a/src/pages/docs/creators/python/tutorials/service-example-6-external-api-request.md b/src/pages/en/docs/creators/python/tutorials/service-example-6-external-api-request.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/service-example-6-external-api-request.md rename to src/pages/en/docs/creators/python/tutorials/service-example-6-external-api-request.md diff --git a/src/pages/docs/creators/python/tutorials/task-example-0-hello.md b/src/pages/en/docs/creators/python/tutorials/task-example-0-hello.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/task-example-0-hello.md rename to src/pages/en/docs/creators/python/tutorials/task-example-0-hello.md diff --git a/src/pages/docs/creators/python/tutorials/task-example-1-cracker.md b/src/pages/en/docs/creators/python/tutorials/task-example-1-cracker.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/task-example-1-cracker.md rename to src/pages/en/docs/creators/python/tutorials/task-example-1-cracker.md diff --git a/src/pages/docs/creators/python/tutorials/task-example-2-hashcat.md b/src/pages/en/docs/creators/python/tutorials/task-example-2-hashcat.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/task-example-2-hashcat.md rename to src/pages/en/docs/creators/python/tutorials/task-example-2-hashcat.md diff --git a/src/pages/docs/creators/python/tutorials/testing-golem-image.md b/src/pages/en/docs/creators/python/tutorials/testing-golem-image.md similarity index 100% rename from src/pages/docs/creators/python/tutorials/testing-golem-image.md rename to src/pages/en/docs/creators/python/tutorials/testing-golem-image.md diff --git a/src/pages/docs/creators/ray/basic-ray-tasks-usage-tutorial.md b/src/pages/en/docs/creators/ray/basic-ray-tasks-usage-tutorial.md similarity index 100% rename from src/pages/docs/creators/ray/basic-ray-tasks-usage-tutorial.md rename to src/pages/en/docs/creators/ray/basic-ray-tasks-usage-tutorial.md diff --git a/src/pages/docs/creators/ray/cluster-yaml.md b/src/pages/en/docs/creators/ray/cluster-yaml.md similarity index 100% rename from src/pages/docs/creators/ray/cluster-yaml.md rename to src/pages/en/docs/creators/ray/cluster-yaml.md diff --git a/src/pages/docs/creators/ray/conversion-to-ray-on-golem-tutorial.md b/src/pages/en/docs/creators/ray/conversion-to-ray-on-golem-tutorial.md similarity index 100% rename from src/pages/docs/creators/ray/conversion-to-ray-on-golem-tutorial.md rename to src/pages/en/docs/creators/ray/conversion-to-ray-on-golem-tutorial.md diff --git a/src/pages/docs/creators/ray/index.md b/src/pages/en/docs/creators/ray/index.md similarity index 100% rename from src/pages/docs/creators/ray/index.md rename to src/pages/en/docs/creators/ray/index.md diff --git a/src/pages/docs/creators/ray/mainnet.md b/src/pages/en/docs/creators/ray/mainnet.md similarity index 100% rename from src/pages/docs/creators/ray/mainnet.md rename to src/pages/en/docs/creators/ray/mainnet.md diff --git a/src/pages/docs/creators/ray/outbound.md b/src/pages/en/docs/creators/ray/outbound.md similarity index 100% rename from src/pages/docs/creators/ray/outbound.md rename to src/pages/en/docs/creators/ray/outbound.md diff --git a/src/pages/docs/creators/ray/quickstart.md b/src/pages/en/docs/creators/ray/quickstart.md similarity index 100% rename from src/pages/docs/creators/ray/quickstart.md rename to src/pages/en/docs/creators/ray/quickstart.md diff --git a/src/pages/docs/creators/ray/ray-cli.md b/src/pages/en/docs/creators/ray/ray-cli.md similarity index 100% rename from src/pages/docs/creators/ray/ray-cli.md rename to src/pages/en/docs/creators/ray/ray-cli.md diff --git a/src/pages/docs/creators/ray/ray-on-golem-cli.md b/src/pages/en/docs/creators/ray/ray-on-golem-cli.md similarity index 100% rename from src/pages/docs/creators/ray/ray-on-golem-cli.md rename to src/pages/en/docs/creators/ray/ray-on-golem-cli.md diff --git a/src/pages/docs/creators/ray/setup-tutorial.md b/src/pages/en/docs/creators/ray/setup-tutorial.md similarity index 100% rename from src/pages/docs/creators/ray/setup-tutorial.md rename to src/pages/en/docs/creators/ray/setup-tutorial.md diff --git a/src/pages/docs/creators/ray/supported-versions-and-other-limitations.md b/src/pages/en/docs/creators/ray/supported-versions-and-other-limitations.md similarity index 100% rename from src/pages/docs/creators/ray/supported-versions-and-other-limitations.md rename to src/pages/en/docs/creators/ray/supported-versions-and-other-limitations.md diff --git a/src/pages/docs/creators/ray/troubleshooting.md b/src/pages/en/docs/creators/ray/troubleshooting.md similarity index 100% rename from src/pages/docs/creators/ray/troubleshooting.md rename to src/pages/en/docs/creators/ray/troubleshooting.md diff --git a/src/pages/docs/creators/tools/goth/index.md b/src/pages/en/docs/creators/tools/goth/index.md similarity index 100% rename from src/pages/docs/creators/tools/goth/index.md rename to src/pages/en/docs/creators/tools/goth/index.md diff --git a/src/pages/docs/creators/tools/goth/running-goth.md b/src/pages/en/docs/creators/tools/goth/running-goth.md similarity index 100% rename from src/pages/docs/creators/tools/goth/running-goth.md rename to src/pages/en/docs/creators/tools/goth/running-goth.md diff --git a/src/pages/docs/creators/tools/goth/running-goths-interactive-mode.md b/src/pages/en/docs/creators/tools/goth/running-goths-interactive-mode.md similarity index 100% rename from src/pages/docs/creators/tools/goth/running-goths-interactive-mode.md rename to src/pages/en/docs/creators/tools/goth/running-goths-interactive-mode.md diff --git a/src/pages/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format.md b/src/pages/en/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format.md similarity index 100% rename from src/pages/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format.md rename to src/pages/en/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format.md diff --git a/src/pages/docs/creators/tools/gvmkit/gvmkit-build-installation.md b/src/pages/en/docs/creators/tools/gvmkit/gvmkit-build-installation.md similarity index 100% rename from src/pages/docs/creators/tools/gvmkit/gvmkit-build-installation.md rename to src/pages/en/docs/creators/tools/gvmkit/gvmkit-build-installation.md diff --git a/src/pages/docs/creators/tools/gvmkit/index.md b/src/pages/en/docs/creators/tools/gvmkit/index.md similarity index 100% rename from src/pages/docs/creators/tools/gvmkit/index.md rename to src/pages/en/docs/creators/tools/gvmkit/index.md diff --git a/src/pages/docs/creators/tools/gvmkit/publishing-custom-images.md b/src/pages/en/docs/creators/tools/gvmkit/publishing-custom-images.md similarity index 100% rename from src/pages/docs/creators/tools/gvmkit/publishing-custom-images.md rename to src/pages/en/docs/creators/tools/gvmkit/publishing-custom-images.md diff --git a/src/pages/docs/creators/tools/yagna/golem-wallet-backup.md b/src/pages/en/docs/creators/tools/yagna/golem-wallet-backup.md similarity index 100% rename from src/pages/docs/creators/tools/yagna/golem-wallet-backup.md rename to src/pages/en/docs/creators/tools/yagna/golem-wallet-backup.md diff --git a/src/pages/docs/creators/tools/yagna/index.md b/src/pages/en/docs/creators/tools/yagna/index.md similarity index 100% rename from src/pages/docs/creators/tools/yagna/index.md rename to src/pages/en/docs/creators/tools/yagna/index.md diff --git a/src/pages/docs/creators/tools/yagna/managing-golem-wallet.md b/src/pages/en/docs/creators/tools/yagna/managing-golem-wallet.md similarity index 100% rename from src/pages/docs/creators/tools/yagna/managing-golem-wallet.md rename to src/pages/en/docs/creators/tools/yagna/managing-golem-wallet.md diff --git a/src/pages/docs/creators/tools/yagna/requestor-uninstallation.md b/src/pages/en/docs/creators/tools/yagna/requestor-uninstallation.md similarity index 100% rename from src/pages/docs/creators/tools/yagna/requestor-uninstallation.md rename to src/pages/en/docs/creators/tools/yagna/requestor-uninstallation.md diff --git a/src/pages/docs/creators/tools/yagna/restoring-golem-wallet.md b/src/pages/en/docs/creators/tools/yagna/restoring-golem-wallet.md similarity index 100% rename from src/pages/docs/creators/tools/yagna/restoring-golem-wallet.md rename to src/pages/en/docs/creators/tools/yagna/restoring-golem-wallet.md diff --git a/src/pages/docs/creators/tools/yagna/yagna-installation-for-requestors.md b/src/pages/en/docs/creators/tools/yagna/yagna-installation-for-requestors.md similarity index 100% rename from src/pages/docs/creators/tools/yagna/yagna-installation-for-requestors.md rename to src/pages/en/docs/creators/tools/yagna/yagna-installation-for-requestors.md diff --git a/src/pages/docs/creators/tools/yagna/yagna-mostly-used-commands.md b/src/pages/en/docs/creators/tools/yagna/yagna-mostly-used-commands.md similarity index 100% rename from src/pages/docs/creators/tools/yagna/yagna-mostly-used-commands.md rename to src/pages/en/docs/creators/tools/yagna/yagna-mostly-used-commands.md diff --git a/src/pages/docs/degenhack/index.md b/src/pages/en/docs/degenhack/index.md similarity index 100% rename from src/pages/docs/degenhack/index.md rename to src/pages/en/docs/degenhack/index.md diff --git a/src/pages/docs/degenhack/mainnet-version.md b/src/pages/en/docs/degenhack/mainnet-version.md similarity index 100% rename from src/pages/docs/degenhack/mainnet-version.md rename to src/pages/en/docs/degenhack/mainnet-version.md diff --git a/src/pages/docs/golem-js/reference/.nojekyll b/src/pages/en/docs/golem-js/reference/.nojekyll similarity index 100% rename from src/pages/docs/golem-js/reference/.nojekyll rename to src/pages/en/docs/golem-js/reference/.nojekyll diff --git a/src/pages/docs/golem-js/reference/README.md b/src/pages/en/docs/golem-js/reference/README.md similarity index 100% rename from src/pages/docs/golem-js/reference/README.md rename to src/pages/en/docs/golem-js/reference/README.md diff --git a/src/pages/docs/golem-js/reference/classes/activity_activity.Activity.md b/src/pages/en/docs/golem-js/reference/classes/activity_activity.Activity.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/activity_activity.Activity.md rename to src/pages/en/docs/golem-js/reference/classes/activity_activity.Activity.md diff --git a/src/pages/docs/golem-js/reference/classes/activity_results.Result.md b/src/pages/en/docs/golem-js/reference/classes/activity_results.Result.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/activity_results.Result.md rename to src/pages/en/docs/golem-js/reference/classes/activity_results.Result.md diff --git a/src/pages/docs/golem-js/reference/classes/agreement_service.AgreementCandidate.md b/src/pages/en/docs/golem-js/reference/classes/agreement_service.AgreementCandidate.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/agreement_service.AgreementCandidate.md rename to src/pages/en/docs/golem-js/reference/classes/agreement_service.AgreementCandidate.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemAbortError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemAbortError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemAbortError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemAbortError.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemConfigError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemConfigError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemConfigError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemConfigError.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemError.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemInternalError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemInternalError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemInternalError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemInternalError.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemModuleError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemModuleError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemModuleError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemModuleError.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemPlatformError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemPlatformError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemPlatformError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemPlatformError.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemTimeoutError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemTimeoutError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemTimeoutError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemTimeoutError.md diff --git a/src/pages/docs/golem-js/reference/classes/error_golem_error.GolemUserError.md b/src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemUserError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/error_golem_error.GolemUserError.md rename to src/pages/en/docs/golem-js/reference/classes/error_golem_error.GolemUserError.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ActivityCreated.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ActivityCreated.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ActivityCreated.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ActivityCreated.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ActivityDestroyed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ActivityDestroyed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ActivityDestroyed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ActivityDestroyed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ActivityStateChanged.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ActivityStateChanged.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ActivityStateChanged.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ActivityStateChanged.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.AgreementConfirmed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.AgreementConfirmed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.AgreementConfirmed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.AgreementConfirmed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.AgreementCreated.md b/src/pages/en/docs/golem-js/reference/classes/events_events.AgreementCreated.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.AgreementCreated.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.AgreementCreated.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.AgreementRejected.md b/src/pages/en/docs/golem-js/reference/classes/events_events.AgreementRejected.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.AgreementRejected.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.AgreementRejected.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.AgreementTerminated.md b/src/pages/en/docs/golem-js/reference/classes/events_events.AgreementTerminated.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.AgreementTerminated.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.AgreementTerminated.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.AllocationCreated.md b/src/pages/en/docs/golem-js/reference/classes/events_events.AllocationCreated.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.AllocationCreated.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.AllocationCreated.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.BaseEvent.md b/src/pages/en/docs/golem-js/reference/classes/events_events.BaseEvent.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.BaseEvent.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.BaseEvent.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.CollectFailed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.CollectFailed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.CollectFailed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.CollectFailed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ComputationFailed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ComputationFailed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ComputationFailed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ComputationFailed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ComputationFinished.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ComputationFinished.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ComputationFinished.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ComputationFinished.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ComputationStarted.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ComputationStarted.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ComputationStarted.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ComputationStarted.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.DebitNoteAccepted.md b/src/pages/en/docs/golem-js/reference/classes/events_events.DebitNoteAccepted.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.DebitNoteAccepted.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.DebitNoteAccepted.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.DebitNoteReceived.md b/src/pages/en/docs/golem-js/reference/classes/events_events.DebitNoteReceived.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.DebitNoteReceived.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.DebitNoteReceived.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.DemandFailed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.DemandFailed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.DemandFailed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.DemandFailed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.DemandSubscribed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.DemandSubscribed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.DemandSubscribed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.DemandSubscribed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.DemandUnsubscribed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.DemandUnsubscribed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.DemandUnsubscribed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.DemandUnsubscribed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.InvoiceReceived.md b/src/pages/en/docs/golem-js/reference/classes/events_events.InvoiceReceived.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.InvoiceReceived.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.InvoiceReceived.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.PackageCreated.md b/src/pages/en/docs/golem-js/reference/classes/events_events.PackageCreated.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.PackageCreated.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.PackageCreated.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.PaymentAccepted.md b/src/pages/en/docs/golem-js/reference/classes/events_events.PaymentAccepted.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.PaymentAccepted.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.PaymentAccepted.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.PaymentFailed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.PaymentFailed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.PaymentFailed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.PaymentFailed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ProposalConfirmed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ProposalConfirmed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ProposalConfirmed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ProposalConfirmed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ProposalFailed.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ProposalFailed.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ProposalFailed.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ProposalFailed.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ProposalReceived.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ProposalReceived.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ProposalReceived.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ProposalReceived.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ProposalRejected.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ProposalRejected.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ProposalRejected.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ProposalRejected.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ProposalResponded.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ProposalResponded.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ProposalResponded.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ProposalResponded.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ScriptExecuted.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ScriptExecuted.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ScriptExecuted.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ScriptExecuted.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.ScriptSent.md b/src/pages/en/docs/golem-js/reference/classes/events_events.ScriptSent.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.ScriptSent.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.ScriptSent.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.TaskFinished.md b/src/pages/en/docs/golem-js/reference/classes/events_events.TaskFinished.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.TaskFinished.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.TaskFinished.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.TaskRedone.md b/src/pages/en/docs/golem-js/reference/classes/events_events.TaskRedone.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.TaskRedone.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.TaskRedone.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.TaskRejected.md b/src/pages/en/docs/golem-js/reference/classes/events_events.TaskRejected.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.TaskRejected.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.TaskRejected.md diff --git a/src/pages/docs/golem-js/reference/classes/events_events.TaskStarted.md b/src/pages/en/docs/golem-js/reference/classes/events_events.TaskStarted.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/events_events.TaskStarted.md rename to src/pages/en/docs/golem-js/reference/classes/events_events.TaskStarted.md diff --git a/src/pages/docs/golem-js/reference/classes/executor_executor.TaskExecutor.md b/src/pages/en/docs/golem-js/reference/classes/executor_executor.TaskExecutor.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/executor_executor.TaskExecutor.md rename to src/pages/en/docs/golem-js/reference/classes/executor_executor.TaskExecutor.md diff --git a/src/pages/docs/golem-js/reference/classes/golem_network_golem_network.GolemNetwork.md b/src/pages/en/docs/golem-js/reference/classes/golem_network_golem_network.GolemNetwork.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/golem_network_golem_network.GolemNetwork.md rename to src/pages/en/docs/golem-js/reference/classes/golem_network_golem_network.GolemNetwork.md diff --git a/src/pages/docs/golem-js/reference/classes/job_job.Job.md b/src/pages/en/docs/golem-js/reference/classes/job_job.Job.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/job_job.Job.md rename to src/pages/en/docs/golem-js/reference/classes/job_job.Job.md diff --git a/src/pages/docs/golem-js/reference/classes/market_error.GolemMarketError.md b/src/pages/en/docs/golem-js/reference/classes/market_error.GolemMarketError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/market_error.GolemMarketError.md rename to src/pages/en/docs/golem-js/reference/classes/market_error.GolemMarketError.md diff --git a/src/pages/docs/golem-js/reference/classes/market_proposal.Proposal.md b/src/pages/en/docs/golem-js/reference/classes/market_proposal.Proposal.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/market_proposal.Proposal.md rename to src/pages/en/docs/golem-js/reference/classes/market_proposal.Proposal.md diff --git a/src/pages/docs/golem-js/reference/classes/market_proposals_batch.ProposalsBatch.md b/src/pages/en/docs/golem-js/reference/classes/market_proposals_batch.ProposalsBatch.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/market_proposals_batch.ProposalsBatch.md rename to src/pages/en/docs/golem-js/reference/classes/market_proposals_batch.ProposalsBatch.md diff --git a/src/pages/docs/golem-js/reference/classes/network_error.GolemNetworkError.md b/src/pages/en/docs/golem-js/reference/classes/network_error.GolemNetworkError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/network_error.GolemNetworkError.md rename to src/pages/en/docs/golem-js/reference/classes/network_error.GolemNetworkError.md diff --git a/src/pages/docs/golem-js/reference/classes/network_node.NetworkNode.md b/src/pages/en/docs/golem-js/reference/classes/network_node.NetworkNode.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/network_node.NetworkNode.md rename to src/pages/en/docs/golem-js/reference/classes/network_node.NetworkNode.md diff --git a/src/pages/docs/golem-js/reference/classes/package_package.Package.md b/src/pages/en/docs/golem-js/reference/classes/package_package.Package.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/package_package.Package.md rename to src/pages/en/docs/golem-js/reference/classes/package_package.Package.md diff --git a/src/pages/docs/golem-js/reference/classes/payment_InvoiceProcessor.InvoiceProcessor.md b/src/pages/en/docs/golem-js/reference/classes/payment_InvoiceProcessor.InvoiceProcessor.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/payment_InvoiceProcessor.InvoiceProcessor.md rename to src/pages/en/docs/golem-js/reference/classes/payment_InvoiceProcessor.InvoiceProcessor.md diff --git a/src/pages/docs/golem-js/reference/classes/payment_agreement_payment_process.AgreementPaymentProcess.md b/src/pages/en/docs/golem-js/reference/classes/payment_agreement_payment_process.AgreementPaymentProcess.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/payment_agreement_payment_process.AgreementPaymentProcess.md rename to src/pages/en/docs/golem-js/reference/classes/payment_agreement_payment_process.AgreementPaymentProcess.md diff --git a/src/pages/docs/golem-js/reference/classes/payment_error.GolemPaymentError.md b/src/pages/en/docs/golem-js/reference/classes/payment_error.GolemPaymentError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/payment_error.GolemPaymentError.md rename to src/pages/en/docs/golem-js/reference/classes/payment_error.GolemPaymentError.md diff --git a/src/pages/docs/golem-js/reference/classes/payment_payments.Payments.md b/src/pages/en/docs/golem-js/reference/classes/payment_payments.Payments.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/payment_payments.Payments.md rename to src/pages/en/docs/golem-js/reference/classes/payment_payments.Payments.md diff --git a/src/pages/docs/golem-js/reference/classes/script_command.DownloadData.md b/src/pages/en/docs/golem-js/reference/classes/script_command.DownloadData.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/script_command.DownloadData.md rename to src/pages/en/docs/golem-js/reference/classes/script_command.DownloadData.md diff --git a/src/pages/docs/golem-js/reference/classes/script_command.Terminate.md b/src/pages/en/docs/golem-js/reference/classes/script_command.Terminate.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/script_command.Terminate.md rename to src/pages/en/docs/golem-js/reference/classes/script_command.Terminate.md diff --git a/src/pages/docs/golem-js/reference/classes/script_command.UploadData.md b/src/pages/en/docs/golem-js/reference/classes/script_command.UploadData.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/script_command.UploadData.md rename to src/pages/en/docs/golem-js/reference/classes/script_command.UploadData.md diff --git a/src/pages/docs/golem-js/reference/classes/storage_gftp.GftpStorageProvider.md b/src/pages/en/docs/golem-js/reference/classes/storage_gftp.GftpStorageProvider.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/storage_gftp.GftpStorageProvider.md rename to src/pages/en/docs/golem-js/reference/classes/storage_gftp.GftpStorageProvider.md diff --git a/src/pages/docs/golem-js/reference/classes/storage_null.NullStorageProvider.md b/src/pages/en/docs/golem-js/reference/classes/storage_null.NullStorageProvider.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/storage_null.NullStorageProvider.md rename to src/pages/en/docs/golem-js/reference/classes/storage_null.NullStorageProvider.md diff --git a/src/pages/docs/golem-js/reference/classes/storage_ws_browser.WebSocketBrowserStorageProvider.md b/src/pages/en/docs/golem-js/reference/classes/storage_ws_browser.WebSocketBrowserStorageProvider.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/storage_ws_browser.WebSocketBrowserStorageProvider.md rename to src/pages/en/docs/golem-js/reference/classes/storage_ws_browser.WebSocketBrowserStorageProvider.md diff --git a/src/pages/docs/golem-js/reference/classes/task_batch.Batch.md b/src/pages/en/docs/golem-js/reference/classes/task_batch.Batch.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/task_batch.Batch.md rename to src/pages/en/docs/golem-js/reference/classes/task_batch.Batch.md diff --git a/src/pages/docs/golem-js/reference/classes/task_error.GolemWorkError.md b/src/pages/en/docs/golem-js/reference/classes/task_error.GolemWorkError.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/task_error.GolemWorkError.md rename to src/pages/en/docs/golem-js/reference/classes/task_error.GolemWorkError.md diff --git a/src/pages/docs/golem-js/reference/classes/task_process.RemoteProcess.md b/src/pages/en/docs/golem-js/reference/classes/task_process.RemoteProcess.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/task_process.RemoteProcess.md rename to src/pages/en/docs/golem-js/reference/classes/task_process.RemoteProcess.md diff --git a/src/pages/docs/golem-js/reference/classes/task_task.Task.md b/src/pages/en/docs/golem-js/reference/classes/task_task.Task.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/task_task.Task.md rename to src/pages/en/docs/golem-js/reference/classes/task_task.Task.md diff --git a/src/pages/docs/golem-js/reference/classes/task_work.WorkContext.md b/src/pages/en/docs/golem-js/reference/classes/task_work.WorkContext.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/task_work.WorkContext.md rename to src/pages/en/docs/golem-js/reference/classes/task_work.WorkContext.md diff --git a/src/pages/docs/golem-js/reference/classes/utils_yagna_activity.RequestorApi.md b/src/pages/en/docs/golem-js/reference/classes/utils_yagna_activity.RequestorApi.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/utils_yagna_activity.RequestorApi.md rename to src/pages/en/docs/golem-js/reference/classes/utils_yagna_activity.RequestorApi.md diff --git a/src/pages/docs/golem-js/reference/classes/utils_yagna_gsb.RequestorApi.md b/src/pages/en/docs/golem-js/reference/classes/utils_yagna_gsb.RequestorApi.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/utils_yagna_gsb.RequestorApi.md rename to src/pages/en/docs/golem-js/reference/classes/utils_yagna_gsb.RequestorApi.md diff --git a/src/pages/docs/golem-js/reference/classes/utils_yagna_identity.RequestorApi.md b/src/pages/en/docs/golem-js/reference/classes/utils_yagna_identity.RequestorApi.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/utils_yagna_identity.RequestorApi.md rename to src/pages/en/docs/golem-js/reference/classes/utils_yagna_identity.RequestorApi.md diff --git a/src/pages/docs/golem-js/reference/classes/utils_yagna_yagna.Yagna.md b/src/pages/en/docs/golem-js/reference/classes/utils_yagna_yagna.Yagna.md similarity index 100% rename from src/pages/docs/golem-js/reference/classes/utils_yagna_yagna.Yagna.md rename to src/pages/en/docs/golem-js/reference/classes/utils_yagna_yagna.Yagna.md diff --git a/src/pages/docs/golem-js/reference/default-values.md b/src/pages/en/docs/golem-js/reference/default-values.md similarity index 100% rename from src/pages/docs/golem-js/reference/default-values.md rename to src/pages/en/docs/golem-js/reference/default-values.md diff --git a/src/pages/docs/golem-js/reference/enums/activity_activity.ActivityStateEnum.md b/src/pages/en/docs/golem-js/reference/enums/activity_activity.ActivityStateEnum.md similarity index 100% rename from src/pages/docs/golem-js/reference/enums/activity_activity.ActivityStateEnum.md rename to src/pages/en/docs/golem-js/reference/enums/activity_activity.ActivityStateEnum.md diff --git a/src/pages/docs/golem-js/reference/enums/market_error.MarketErrorCode.md b/src/pages/en/docs/golem-js/reference/enums/market_error.MarketErrorCode.md similarity index 100% rename from src/pages/docs/golem-js/reference/enums/market_error.MarketErrorCode.md rename to src/pages/en/docs/golem-js/reference/enums/market_error.MarketErrorCode.md diff --git a/src/pages/docs/golem-js/reference/enums/network_error.NetworkErrorCode.md b/src/pages/en/docs/golem-js/reference/enums/network_error.NetworkErrorCode.md similarity index 100% rename from src/pages/docs/golem-js/reference/enums/network_error.NetworkErrorCode.md rename to src/pages/en/docs/golem-js/reference/enums/network_error.NetworkErrorCode.md diff --git a/src/pages/docs/golem-js/reference/enums/payment_error.PaymentErrorCode.md b/src/pages/en/docs/golem-js/reference/enums/payment_error.PaymentErrorCode.md similarity index 100% rename from src/pages/docs/golem-js/reference/enums/payment_error.PaymentErrorCode.md rename to src/pages/en/docs/golem-js/reference/enums/payment_error.PaymentErrorCode.md diff --git a/src/pages/docs/golem-js/reference/enums/task_error.WorkErrorCode.md b/src/pages/en/docs/golem-js/reference/enums/task_error.WorkErrorCode.md similarity index 100% rename from src/pages/docs/golem-js/reference/enums/task_error.WorkErrorCode.md rename to src/pages/en/docs/golem-js/reference/enums/task_error.WorkErrorCode.md diff --git a/src/pages/docs/golem-js/reference/enums/task_task.TaskState.md b/src/pages/en/docs/golem-js/reference/enums/task_task.TaskState.md similarity index 100% rename from src/pages/docs/golem-js/reference/enums/task_task.TaskState.md rename to src/pages/en/docs/golem-js/reference/enums/task_task.TaskState.md diff --git a/src/pages/docs/golem-js/reference/interfaces/activity_activity.ActivityOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/activity_activity.ActivityOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/activity_activity.ActivityOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/activity_activity.ActivityOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/activity_activity.ExeScriptRequest.md b/src/pages/en/docs/golem-js/reference/interfaces/activity_activity.ExeScriptRequest.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/activity_activity.ExeScriptRequest.md rename to src/pages/en/docs/golem-js/reference/interfaces/activity_activity.ExeScriptRequest.md diff --git a/src/pages/docs/golem-js/reference/interfaces/activity_results.ResultData.md b/src/pages/en/docs/golem-js/reference/interfaces/activity_results.ResultData.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/activity_results.ResultData.md rename to src/pages/en/docs/golem-js/reference/interfaces/activity_results.ResultData.md diff --git a/src/pages/docs/golem-js/reference/interfaces/activity_results.RuntimeEventKind.md b/src/pages/en/docs/golem-js/reference/interfaces/activity_results.RuntimeEventKind.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/activity_results.RuntimeEventKind.md rename to src/pages/en/docs/golem-js/reference/interfaces/activity_results.RuntimeEventKind.md diff --git a/src/pages/docs/golem-js/reference/interfaces/activity_results.StreamingBatchEvent.md b/src/pages/en/docs/golem-js/reference/interfaces/activity_results.StreamingBatchEvent.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/activity_results.StreamingBatchEvent.md rename to src/pages/en/docs/golem-js/reference/interfaces/activity_results.StreamingBatchEvent.md diff --git a/src/pages/docs/golem-js/reference/interfaces/agreement_agreement.ProviderInfo.md b/src/pages/en/docs/golem-js/reference/interfaces/agreement_agreement.ProviderInfo.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/agreement_agreement.ProviderInfo.md rename to src/pages/en/docs/golem-js/reference/interfaces/agreement_agreement.ProviderInfo.md diff --git a/src/pages/docs/golem-js/reference/interfaces/agreement_service.AgreementDTO.md b/src/pages/en/docs/golem-js/reference/interfaces/agreement_service.AgreementDTO.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/agreement_service.AgreementDTO.md rename to src/pages/en/docs/golem-js/reference/interfaces/agreement_service.AgreementDTO.md diff --git a/src/pages/docs/golem-js/reference/interfaces/agreement_service.AgreementServiceOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/agreement_service.AgreementServiceOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/agreement_service.AgreementServiceOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/agreement_service.AgreementServiceOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/executor_events.TaskExecutorEventsDict.md b/src/pages/en/docs/golem-js/reference/interfaces/executor_events.TaskExecutorEventsDict.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/executor_events.TaskExecutorEventsDict.md rename to src/pages/en/docs/golem-js/reference/interfaces/executor_events.TaskExecutorEventsDict.md diff --git a/src/pages/docs/golem-js/reference/interfaces/job_job.JobEventsDict.md b/src/pages/en/docs/golem-js/reference/interfaces/job_job.JobEventsDict.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/job_job.JobEventsDict.md rename to src/pages/en/docs/golem-js/reference/interfaces/job_job.JobEventsDict.md diff --git a/src/pages/docs/golem-js/reference/interfaces/market_demand.DemandDetails.md b/src/pages/en/docs/golem-js/reference/interfaces/market_demand.DemandDetails.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/market_demand.DemandDetails.md rename to src/pages/en/docs/golem-js/reference/interfaces/market_demand.DemandDetails.md diff --git a/src/pages/docs/golem-js/reference/interfaces/market_demand.DemandOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/market_demand.DemandOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/market_demand.DemandOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/market_demand.DemandOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/market_proposal.ProposalDetails.md b/src/pages/en/docs/golem-js/reference/interfaces/market_proposal.ProposalDetails.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/market_proposal.ProposalDetails.md rename to src/pages/en/docs/golem-js/reference/interfaces/market_proposal.ProposalDetails.md diff --git a/src/pages/docs/golem-js/reference/interfaces/market_service.MarketOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/market_service.MarketOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/market_service.MarketOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/market_service.MarketOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/network_network.NetworkInfo.md b/src/pages/en/docs/golem-js/reference/interfaces/network_network.NetworkInfo.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/network_network.NetworkInfo.md rename to src/pages/en/docs/golem-js/reference/interfaces/network_network.NetworkInfo.md diff --git a/src/pages/docs/golem-js/reference/interfaces/package_package.PackageDetails.md b/src/pages/en/docs/golem-js/reference/interfaces/package_package.PackageDetails.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/package_package.PackageDetails.md rename to src/pages/en/docs/golem-js/reference/interfaces/package_package.PackageDetails.md diff --git a/src/pages/docs/golem-js/reference/interfaces/payment_config.BasePaymentOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/payment_config.BasePaymentOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/payment_config.BasePaymentOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/payment_config.BasePaymentOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/payment_debit_note.DebitNoteDTO.md b/src/pages/en/docs/golem-js/reference/interfaces/payment_debit_note.DebitNoteDTO.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/payment_debit_note.DebitNoteDTO.md rename to src/pages/en/docs/golem-js/reference/interfaces/payment_debit_note.DebitNoteDTO.md diff --git a/src/pages/docs/golem-js/reference/interfaces/payment_invoice.InvoiceDTO.md b/src/pages/en/docs/golem-js/reference/interfaces/payment_invoice.InvoiceDTO.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/payment_invoice.InvoiceDTO.md rename to src/pages/en/docs/golem-js/reference/interfaces/payment_invoice.InvoiceDTO.md diff --git a/src/pages/docs/golem-js/reference/interfaces/payment_payments.PaymentOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/payment_payments.PaymentOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/payment_payments.PaymentOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/payment_payments.PaymentOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/payment_service.PaymentOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/payment_service.PaymentOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/payment_service.PaymentOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/payment_service.PaymentOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/storage_provider.StorageProvider.md b/src/pages/en/docs/golem-js/reference/interfaces/storage_provider.StorageProvider.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/storage_provider.StorageProvider.md rename to src/pages/en/docs/golem-js/reference/interfaces/storage_provider.StorageProvider.md diff --git a/src/pages/docs/golem-js/reference/interfaces/storage_ws_browser.WebSocketStorageProviderOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/storage_ws_browser.WebSocketStorageProviderOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/storage_ws_browser.WebSocketStorageProviderOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/storage_ws_browser.WebSocketStorageProviderOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/task_service.TaskServiceOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/task_service.TaskServiceOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/task_service.TaskServiceOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/task_service.TaskServiceOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/task_work.CommandOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/task_work.CommandOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/task_work.CommandOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/task_work.CommandOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/task_work.WorkOptions.md b/src/pages/en/docs/golem-js/reference/interfaces/task_work.WorkOptions.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/task_work.WorkOptions.md rename to src/pages/en/docs/golem-js/reference/interfaces/task_work.WorkOptions.md diff --git a/src/pages/docs/golem-js/reference/interfaces/utils_logger_logger.Logger.md b/src/pages/en/docs/golem-js/reference/interfaces/utils_logger_logger.Logger.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/utils_logger_logger.Logger.md rename to src/pages/en/docs/golem-js/reference/interfaces/utils_logger_logger.Logger.md diff --git a/src/pages/docs/golem-js/reference/interfaces/utils_yagna_identity.IdentityModel.md b/src/pages/en/docs/golem-js/reference/interfaces/utils_yagna_identity.IdentityModel.md similarity index 100% rename from src/pages/docs/golem-js/reference/interfaces/utils_yagna_identity.IdentityModel.md rename to src/pages/en/docs/golem-js/reference/interfaces/utils_yagna_identity.IdentityModel.md diff --git a/src/pages/docs/golem-js/reference/modules.md b/src/pages/en/docs/golem-js/reference/modules.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules.md rename to src/pages/en/docs/golem-js/reference/modules.md diff --git a/src/pages/docs/golem-js/reference/modules/activity_activity.md b/src/pages/en/docs/golem-js/reference/modules/activity_activity.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/activity_activity.md rename to src/pages/en/docs/golem-js/reference/modules/activity_activity.md diff --git a/src/pages/docs/golem-js/reference/modules/activity_results.md b/src/pages/en/docs/golem-js/reference/modules/activity_results.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/activity_results.md rename to src/pages/en/docs/golem-js/reference/modules/activity_results.md diff --git a/src/pages/docs/golem-js/reference/modules/agreement_agreement.md b/src/pages/en/docs/golem-js/reference/modules/agreement_agreement.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/agreement_agreement.md rename to src/pages/en/docs/golem-js/reference/modules/agreement_agreement.md diff --git a/src/pages/docs/golem-js/reference/modules/agreement_service.md b/src/pages/en/docs/golem-js/reference/modules/agreement_service.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/agreement_service.md rename to src/pages/en/docs/golem-js/reference/modules/agreement_service.md diff --git a/src/pages/docs/golem-js/reference/modules/agreement_strategy.md b/src/pages/en/docs/golem-js/reference/modules/agreement_strategy.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/agreement_strategy.md rename to src/pages/en/docs/golem-js/reference/modules/agreement_strategy.md diff --git a/src/pages/docs/golem-js/reference/modules/error_golem_error.md b/src/pages/en/docs/golem-js/reference/modules/error_golem_error.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/error_golem_error.md rename to src/pages/en/docs/golem-js/reference/modules/error_golem_error.md diff --git a/src/pages/docs/golem-js/reference/modules/events_events.md b/src/pages/en/docs/golem-js/reference/modules/events_events.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/events_events.md rename to src/pages/en/docs/golem-js/reference/modules/events_events.md diff --git a/src/pages/docs/golem-js/reference/modules/executor_events.md b/src/pages/en/docs/golem-js/reference/modules/executor_events.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/executor_events.md rename to src/pages/en/docs/golem-js/reference/modules/executor_events.md diff --git a/src/pages/docs/golem-js/reference/modules/executor_executor.md b/src/pages/en/docs/golem-js/reference/modules/executor_executor.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/executor_executor.md rename to src/pages/en/docs/golem-js/reference/modules/executor_executor.md diff --git a/src/pages/docs/golem-js/reference/modules/golem_network_golem_network.md b/src/pages/en/docs/golem-js/reference/modules/golem_network_golem_network.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/golem_network_golem_network.md rename to src/pages/en/docs/golem-js/reference/modules/golem_network_golem_network.md diff --git a/src/pages/docs/golem-js/reference/modules/job_job.md b/src/pages/en/docs/golem-js/reference/modules/job_job.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/job_job.md rename to src/pages/en/docs/golem-js/reference/modules/job_job.md diff --git a/src/pages/docs/golem-js/reference/modules/market_builder.md b/src/pages/en/docs/golem-js/reference/modules/market_builder.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_builder.md rename to src/pages/en/docs/golem-js/reference/modules/market_builder.md diff --git a/src/pages/docs/golem-js/reference/modules/market_demand.md b/src/pages/en/docs/golem-js/reference/modules/market_demand.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_demand.md rename to src/pages/en/docs/golem-js/reference/modules/market_demand.md diff --git a/src/pages/docs/golem-js/reference/modules/market_error.md b/src/pages/en/docs/golem-js/reference/modules/market_error.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_error.md rename to src/pages/en/docs/golem-js/reference/modules/market_error.md diff --git a/src/pages/docs/golem-js/reference/modules/market_helpers.md b/src/pages/en/docs/golem-js/reference/modules/market_helpers.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_helpers.md rename to src/pages/en/docs/golem-js/reference/modules/market_helpers.md diff --git a/src/pages/docs/golem-js/reference/modules/market_proposal.md b/src/pages/en/docs/golem-js/reference/modules/market_proposal.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_proposal.md rename to src/pages/en/docs/golem-js/reference/modules/market_proposal.md diff --git a/src/pages/docs/golem-js/reference/modules/market_proposals_batch.md b/src/pages/en/docs/golem-js/reference/modules/market_proposals_batch.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_proposals_batch.md rename to src/pages/en/docs/golem-js/reference/modules/market_proposals_batch.md diff --git a/src/pages/docs/golem-js/reference/modules/market_service.md b/src/pages/en/docs/golem-js/reference/modules/market_service.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_service.md rename to src/pages/en/docs/golem-js/reference/modules/market_service.md diff --git a/src/pages/docs/golem-js/reference/modules/market_strategy.md b/src/pages/en/docs/golem-js/reference/modules/market_strategy.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/market_strategy.md rename to src/pages/en/docs/golem-js/reference/modules/market_strategy.md diff --git a/src/pages/docs/golem-js/reference/modules/network_error.md b/src/pages/en/docs/golem-js/reference/modules/network_error.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/network_error.md rename to src/pages/en/docs/golem-js/reference/modules/network_error.md diff --git a/src/pages/docs/golem-js/reference/modules/network_network.md b/src/pages/en/docs/golem-js/reference/modules/network_network.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/network_network.md rename to src/pages/en/docs/golem-js/reference/modules/network_network.md diff --git a/src/pages/docs/golem-js/reference/modules/network_node.md b/src/pages/en/docs/golem-js/reference/modules/network_node.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/network_node.md rename to src/pages/en/docs/golem-js/reference/modules/network_node.md diff --git a/src/pages/docs/golem-js/reference/modules/network_service.md b/src/pages/en/docs/golem-js/reference/modules/network_service.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/network_service.md rename to src/pages/en/docs/golem-js/reference/modules/network_service.md diff --git a/src/pages/docs/golem-js/reference/modules/package_package.md b/src/pages/en/docs/golem-js/reference/modules/package_package.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/package_package.md rename to src/pages/en/docs/golem-js/reference/modules/package_package.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_InvoiceProcessor.md b/src/pages/en/docs/golem-js/reference/modules/payment_InvoiceProcessor.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_InvoiceProcessor.md rename to src/pages/en/docs/golem-js/reference/modules/payment_InvoiceProcessor.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_agreement_payment_process.md b/src/pages/en/docs/golem-js/reference/modules/payment_agreement_payment_process.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_agreement_payment_process.md rename to src/pages/en/docs/golem-js/reference/modules/payment_agreement_payment_process.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_config.md b/src/pages/en/docs/golem-js/reference/modules/payment_config.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_config.md rename to src/pages/en/docs/golem-js/reference/modules/payment_config.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_debit_note.md b/src/pages/en/docs/golem-js/reference/modules/payment_debit_note.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_debit_note.md rename to src/pages/en/docs/golem-js/reference/modules/payment_debit_note.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_error.md b/src/pages/en/docs/golem-js/reference/modules/payment_error.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_error.md rename to src/pages/en/docs/golem-js/reference/modules/payment_error.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_invoice.md b/src/pages/en/docs/golem-js/reference/modules/payment_invoice.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_invoice.md rename to src/pages/en/docs/golem-js/reference/modules/payment_invoice.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_payments.md b/src/pages/en/docs/golem-js/reference/modules/payment_payments.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_payments.md rename to src/pages/en/docs/golem-js/reference/modules/payment_payments.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_service.md b/src/pages/en/docs/golem-js/reference/modules/payment_service.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_service.md rename to src/pages/en/docs/golem-js/reference/modules/payment_service.md diff --git a/src/pages/docs/golem-js/reference/modules/payment_strategy.md b/src/pages/en/docs/golem-js/reference/modules/payment_strategy.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/payment_strategy.md rename to src/pages/en/docs/golem-js/reference/modules/payment_strategy.md diff --git a/src/pages/docs/golem-js/reference/modules/script_command.md b/src/pages/en/docs/golem-js/reference/modules/script_command.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/script_command.md rename to src/pages/en/docs/golem-js/reference/modules/script_command.md diff --git a/src/pages/docs/golem-js/reference/modules/storage_gftp.md b/src/pages/en/docs/golem-js/reference/modules/storage_gftp.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/storage_gftp.md rename to src/pages/en/docs/golem-js/reference/modules/storage_gftp.md diff --git a/src/pages/docs/golem-js/reference/modules/storage_null.md b/src/pages/en/docs/golem-js/reference/modules/storage_null.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/storage_null.md rename to src/pages/en/docs/golem-js/reference/modules/storage_null.md diff --git a/src/pages/docs/golem-js/reference/modules/storage_provider.md b/src/pages/en/docs/golem-js/reference/modules/storage_provider.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/storage_provider.md rename to src/pages/en/docs/golem-js/reference/modules/storage_provider.md diff --git a/src/pages/docs/golem-js/reference/modules/storage_ws_browser.md b/src/pages/en/docs/golem-js/reference/modules/storage_ws_browser.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/storage_ws_browser.md rename to src/pages/en/docs/golem-js/reference/modules/storage_ws_browser.md diff --git a/src/pages/docs/golem-js/reference/modules/task_batch.md b/src/pages/en/docs/golem-js/reference/modules/task_batch.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/task_batch.md rename to src/pages/en/docs/golem-js/reference/modules/task_batch.md diff --git a/src/pages/docs/golem-js/reference/modules/task_error.md b/src/pages/en/docs/golem-js/reference/modules/task_error.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/task_error.md rename to src/pages/en/docs/golem-js/reference/modules/task_error.md diff --git a/src/pages/docs/golem-js/reference/modules/task_process.md b/src/pages/en/docs/golem-js/reference/modules/task_process.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/task_process.md rename to src/pages/en/docs/golem-js/reference/modules/task_process.md diff --git a/src/pages/docs/golem-js/reference/modules/task_service.md b/src/pages/en/docs/golem-js/reference/modules/task_service.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/task_service.md rename to src/pages/en/docs/golem-js/reference/modules/task_service.md diff --git a/src/pages/docs/golem-js/reference/modules/task_task.md b/src/pages/en/docs/golem-js/reference/modules/task_task.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/task_task.md rename to src/pages/en/docs/golem-js/reference/modules/task_task.md diff --git a/src/pages/docs/golem-js/reference/modules/task_work.md b/src/pages/en/docs/golem-js/reference/modules/task_work.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/task_work.md rename to src/pages/en/docs/golem-js/reference/modules/task_work.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_env.md b/src/pages/en/docs/golem-js/reference/modules/utils_env.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_env.md rename to src/pages/en/docs/golem-js/reference/modules/utils_env.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_logger_defaultLogger.md b/src/pages/en/docs/golem-js/reference/modules/utils_logger_defaultLogger.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_logger_defaultLogger.md rename to src/pages/en/docs/golem-js/reference/modules/utils_logger_defaultLogger.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_logger_jsonLogger.md b/src/pages/en/docs/golem-js/reference/modules/utils_logger_jsonLogger.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_logger_jsonLogger.md rename to src/pages/en/docs/golem-js/reference/modules/utils_logger_jsonLogger.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_logger_logger.md b/src/pages/en/docs/golem-js/reference/modules/utils_logger_logger.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_logger_logger.md rename to src/pages/en/docs/golem-js/reference/modules/utils_logger_logger.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_logger_nullLogger.md b/src/pages/en/docs/golem-js/reference/modules/utils_logger_nullLogger.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_logger_nullLogger.md rename to src/pages/en/docs/golem-js/reference/modules/utils_logger_nullLogger.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_logger_pinoLogger.md b/src/pages/en/docs/golem-js/reference/modules/utils_logger_pinoLogger.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_logger_pinoLogger.md rename to src/pages/en/docs/golem-js/reference/modules/utils_logger_pinoLogger.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_runtimeContextChecker.md b/src/pages/en/docs/golem-js/reference/modules/utils_runtimeContextChecker.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_runtimeContextChecker.md rename to src/pages/en/docs/golem-js/reference/modules/utils_runtimeContextChecker.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_types.md b/src/pages/en/docs/golem-js/reference/modules/utils_types.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_types.md rename to src/pages/en/docs/golem-js/reference/modules/utils_types.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_yagna_activity.md b/src/pages/en/docs/golem-js/reference/modules/utils_yagna_activity.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_yagna_activity.md rename to src/pages/en/docs/golem-js/reference/modules/utils_yagna_activity.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_yagna_gsb.md b/src/pages/en/docs/golem-js/reference/modules/utils_yagna_gsb.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_yagna_gsb.md rename to src/pages/en/docs/golem-js/reference/modules/utils_yagna_gsb.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_yagna_identity.md b/src/pages/en/docs/golem-js/reference/modules/utils_yagna_identity.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_yagna_identity.md rename to src/pages/en/docs/golem-js/reference/modules/utils_yagna_identity.md diff --git a/src/pages/docs/golem-js/reference/modules/utils_yagna_yagna.md b/src/pages/en/docs/golem-js/reference/modules/utils_yagna_yagna.md similarity index 100% rename from src/pages/docs/golem-js/reference/modules/utils_yagna_yagna.md rename to src/pages/en/docs/golem-js/reference/modules/utils_yagna_yagna.md diff --git a/src/pages/docs/golem-js/reference/overview.md b/src/pages/en/docs/golem-js/reference/overview.md similarity index 100% rename from src/pages/docs/golem-js/reference/overview.md rename to src/pages/en/docs/golem-js/reference/overview.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/.nojekyll b/src/pages/en/docs/golem-sdk-task-executor/reference/.nojekyll similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/.nojekyll rename to src/pages/en/docs/golem-sdk-task-executor/reference/.nojekyll diff --git a/src/pages/docs/golem-sdk-task-executor/reference/README.md b/src/pages/en/docs/golem-sdk-task-executor/reference/README.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/README.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/README.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor.md b/src/pages/en/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/classes/task.Task.md b/src/pages/en/docs/golem-sdk-task-executor/reference/classes/task.Task.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/classes/task.Task.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/classes/task.Task.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/default-values.md b/src/pages/en/docs/golem-sdk-task-executor/reference/default-values.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/default-values.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/default-values.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/enums/task.TaskState.md b/src/pages/en/docs/golem-sdk-task-executor/reference/enums/task.TaskState.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/enums/task.TaskState.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/enums/task.TaskState.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/interfaces/events.TaskExecutorEventsDict.md b/src/pages/en/docs/golem-sdk-task-executor/reference/interfaces/events.TaskExecutorEventsDict.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/interfaces/events.TaskExecutorEventsDict.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/interfaces/events.TaskExecutorEventsDict.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/interfaces/service.TaskServiceOptions.md b/src/pages/en/docs/golem-sdk-task-executor/reference/interfaces/service.TaskServiceOptions.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/interfaces/service.TaskServiceOptions.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/interfaces/service.TaskServiceOptions.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/interfaces/task.ProviderInfo.md b/src/pages/en/docs/golem-sdk-task-executor/reference/interfaces/task.ProviderInfo.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/interfaces/task.ProviderInfo.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/interfaces/task.ProviderInfo.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/modules.md b/src/pages/en/docs/golem-sdk-task-executor/reference/modules.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/modules.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/modules.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/modules/events.md b/src/pages/en/docs/golem-sdk-task-executor/reference/modules/events.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/modules/events.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/modules/events.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/modules/executor.md b/src/pages/en/docs/golem-sdk-task-executor/reference/modules/executor.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/modules/executor.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/modules/executor.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/modules/service.md b/src/pages/en/docs/golem-sdk-task-executor/reference/modules/service.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/modules/service.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/modules/service.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/modules/task.md b/src/pages/en/docs/golem-sdk-task-executor/reference/modules/task.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/modules/task.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/modules/task.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/modules/types.md b/src/pages/en/docs/golem-sdk-task-executor/reference/modules/types.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/modules/types.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/modules/types.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/modules/utils.md b/src/pages/en/docs/golem-sdk-task-executor/reference/modules/utils.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/modules/utils.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/modules/utils.md diff --git a/src/pages/docs/golem-sdk-task-executor/reference/overview.md b/src/pages/en/docs/golem-sdk-task-executor/reference/overview.md similarity index 100% rename from src/pages/docs/golem-sdk-task-executor/reference/overview.md rename to src/pages/en/docs/golem-sdk-task-executor/reference/overview.md diff --git a/src/pages/docs/golem/index.md b/src/pages/en/docs/golem/index.md similarity index 100% rename from src/pages/docs/golem/index.md rename to src/pages/en/docs/golem/index.md diff --git a/src/pages/docs/golem/migrate/guideline.md b/src/pages/en/docs/golem/migrate/guideline.md similarity index 100% rename from src/pages/docs/golem/migrate/guideline.md rename to src/pages/en/docs/golem/migrate/guideline.md diff --git a/src/pages/docs/golem/migrate/terms.md b/src/pages/en/docs/golem/migrate/terms.md similarity index 100% rename from src/pages/docs/golem/migrate/terms.md rename to src/pages/en/docs/golem/migrate/terms.md diff --git a/src/pages/docs/golem/overview/golem-token.md b/src/pages/en/docs/golem/overview/golem-token.md similarity index 100% rename from src/pages/docs/golem/overview/golem-token.md rename to src/pages/en/docs/golem/overview/golem-token.md diff --git a/src/pages/docs/golem/overview/index.md b/src/pages/en/docs/golem/overview/index.md similarity index 100% rename from src/pages/docs/golem/overview/index.md rename to src/pages/en/docs/golem/overview/index.md diff --git a/src/pages/docs/golem/overview/provider.md b/src/pages/en/docs/golem/overview/provider.md similarity index 100% rename from src/pages/docs/golem/overview/provider.md rename to src/pages/en/docs/golem/overview/provider.md diff --git a/src/pages/docs/golem/overview/requestor-faq.md b/src/pages/en/docs/golem/overview/requestor-faq.md similarity index 100% rename from src/pages/docs/golem/overview/requestor-faq.md rename to src/pages/en/docs/golem/overview/requestor-faq.md diff --git a/src/pages/docs/golem/overview/requestor.md b/src/pages/en/docs/golem/overview/requestor.md similarity index 100% rename from src/pages/docs/golem/overview/requestor.md rename to src/pages/en/docs/golem/overview/requestor.md diff --git a/src/pages/docs/golem/overview/testnet-mainnet.md b/src/pages/en/docs/golem/overview/testnet-mainnet.md similarity index 100% rename from src/pages/docs/golem/overview/testnet-mainnet.md rename to src/pages/en/docs/golem/overview/testnet-mainnet.md diff --git a/src/pages/docs/golem/payload-manifest/computation-payload-manifest.schema.md b/src/pages/en/docs/golem/payload-manifest/computation-payload-manifest.schema.md similarity index 100% rename from src/pages/docs/golem/payload-manifest/computation-payload-manifest.schema.md rename to src/pages/en/docs/golem/payload-manifest/computation-payload-manifest.schema.md diff --git a/src/pages/docs/golem/payload-manifest/index.md b/src/pages/en/docs/golem/payload-manifest/index.md similarity index 100% rename from src/pages/docs/golem/payload-manifest/index.md rename to src/pages/en/docs/golem/payload-manifest/index.md diff --git a/src/pages/docs/golem/payments/golem-token-conversion.md b/src/pages/en/docs/golem/payments/golem-token-conversion.md similarity index 100% rename from src/pages/docs/golem/payments/golem-token-conversion.md rename to src/pages/en/docs/golem/payments/golem-token-conversion.md diff --git a/src/pages/docs/golem/payments/index.md b/src/pages/en/docs/golem/payments/index.md similarity index 100% rename from src/pages/docs/golem/payments/index.md rename to src/pages/en/docs/golem/payments/index.md diff --git a/src/pages/docs/golem/payments/layer-2-payments.md b/src/pages/en/docs/golem/payments/layer-2-payments.md similarity index 100% rename from src/pages/docs/golem/payments/layer-2-payments.md rename to src/pages/en/docs/golem/payments/layer-2-payments.md diff --git a/src/pages/docs/golem/terms.md b/src/pages/en/docs/golem/terms.md similarity index 100% rename from src/pages/docs/golem/terms.md rename to src/pages/en/docs/golem/terms.md diff --git a/src/pages/en/docs/index.jsx b/src/pages/en/docs/index.jsx new file mode 100644 index 000000000..fc2e476c0 --- /dev/null +++ b/src/pages/en/docs/index.jsx @@ -0,0 +1,26 @@ +import Head from 'next/head' +import Link from 'next/link' + +export default function DocsHome() { + return ( +
+ + Documentation Home + + + + +
+

Welcome to the Documentation

+

This is the home page for our documentation.

+ + Get Started + +
+ +
+

© 2023 Your Company Name

+
+
+ ) +} diff --git a/src/pages/docs/providers/configuration/general.md b/src/pages/en/docs/providers/configuration/general.md similarity index 100% rename from src/pages/docs/providers/configuration/general.md rename to src/pages/en/docs/providers/configuration/general.md diff --git a/src/pages/docs/providers/configuration/outbound.md b/src/pages/en/docs/providers/configuration/outbound.md similarity index 100% rename from src/pages/docs/providers/configuration/outbound.md rename to src/pages/en/docs/providers/configuration/outbound.md diff --git a/src/pages/docs/providers/gpu/gpu-golem-live.md b/src/pages/en/docs/providers/gpu/gpu-golem-live.md similarity index 100% rename from src/pages/docs/providers/gpu/gpu-golem-live.md rename to src/pages/en/docs/providers/gpu/gpu-golem-live.md diff --git a/src/pages/docs/providers/index.md b/src/pages/en/docs/providers/index.md similarity index 100% rename from src/pages/docs/providers/index.md rename to src/pages/en/docs/providers/index.md diff --git a/src/pages/docs/providers/maintenance.md b/src/pages/en/docs/providers/maintenance.md similarity index 100% rename from src/pages/docs/providers/maintenance.md rename to src/pages/en/docs/providers/maintenance.md diff --git a/src/pages/docs/providers/provider-faq.md b/src/pages/en/docs/providers/provider-faq.md similarity index 100% rename from src/pages/docs/providers/provider-faq.md rename to src/pages/en/docs/providers/provider-faq.md diff --git a/src/pages/docs/providers/provider-installation.md b/src/pages/en/docs/providers/provider-installation.md similarity index 100% rename from src/pages/docs/providers/provider-installation.md rename to src/pages/en/docs/providers/provider-installation.md diff --git a/src/pages/docs/providers/provider-uninstallation.md b/src/pages/en/docs/providers/provider-uninstallation.md similarity index 100% rename from src/pages/docs/providers/provider-uninstallation.md rename to src/pages/en/docs/providers/provider-uninstallation.md diff --git a/src/pages/docs/providers/wallet/backup.md b/src/pages/en/docs/providers/wallet/backup.md similarity index 100% rename from src/pages/docs/providers/wallet/backup.md rename to src/pages/en/docs/providers/wallet/backup.md diff --git a/src/pages/docs/providers/wallet/restoration.md b/src/pages/en/docs/providers/wallet/restoration.md similarity index 100% rename from src/pages/docs/providers/wallet/restoration.md rename to src/pages/en/docs/providers/wallet/restoration.md diff --git a/src/pages/docs/quickstarts/golem-in-a-browser.md b/src/pages/en/docs/quickstarts/golem-in-a-browser.md similarity index 100% rename from src/pages/docs/quickstarts/golem-in-a-browser.md rename to src/pages/en/docs/quickstarts/golem-in-a-browser.md diff --git a/src/pages/docs/quickstarts/index.md b/src/pages/en/docs/quickstarts/index.md similarity index 100% rename from src/pages/docs/quickstarts/index.md rename to src/pages/en/docs/quickstarts/index.md diff --git a/src/pages/docs/quickstarts/js-quickstart.md b/src/pages/en/docs/quickstarts/js-quickstart.md similarity index 100% rename from src/pages/docs/quickstarts/js-quickstart.md rename to src/pages/en/docs/quickstarts/js-quickstart.md diff --git a/src/pages/docs/quickstarts/no-code-app-deployment.md b/src/pages/en/docs/quickstarts/no-code-app-deployment.md similarity index 100% rename from src/pages/docs/quickstarts/no-code-app-deployment.md rename to src/pages/en/docs/quickstarts/no-code-app-deployment.md diff --git a/src/pages/docs/quickstarts/python-quickstart.md b/src/pages/en/docs/quickstarts/python-quickstart.md similarity index 100% rename from src/pages/docs/quickstarts/python-quickstart.md rename to src/pages/en/docs/quickstarts/python-quickstart.md diff --git a/src/pages/docs/quickstarts/ray-quickstart.md b/src/pages/en/docs/quickstarts/ray-quickstart.md similarity index 100% rename from src/pages/docs/quickstarts/ray-quickstart.md rename to src/pages/en/docs/quickstarts/ray-quickstart.md diff --git a/src/pages/docs/quickstarts/retrievable-task.md b/src/pages/en/docs/quickstarts/retrievable-task.md similarity index 100% rename from src/pages/docs/quickstarts/retrievable-task.md rename to src/pages/en/docs/quickstarts/retrievable-task.md diff --git a/src/pages/docs/reputation/finding-the-best-providers.md b/src/pages/en/docs/reputation/finding-the-best-providers.md similarity index 100% rename from src/pages/docs/reputation/finding-the-best-providers.md rename to src/pages/en/docs/reputation/finding-the-best-providers.md diff --git a/src/pages/docs/reputation/index.md b/src/pages/en/docs/reputation/index.md similarity index 100% rename from src/pages/docs/reputation/index.md rename to src/pages/en/docs/reputation/index.md diff --git a/src/pages/docs/reputation/reputation-api-swagger-ui-v1.md b/src/pages/en/docs/reputation/reputation-api-swagger-ui-v1.md similarity index 100% rename from src/pages/docs/reputation/reputation-api-swagger-ui-v1.md rename to src/pages/en/docs/reputation/reputation-api-swagger-ui-v1.md diff --git a/src/pages/docs/reputation/reputation-api-swagger-ui-v2.md b/src/pages/en/docs/reputation/reputation-api-swagger-ui-v2.md similarity index 100% rename from src/pages/docs/reputation/reputation-api-swagger-ui-v2.md rename to src/pages/en/docs/reputation/reputation-api-swagger-ui-v2.md diff --git a/src/pages/docs/reputation/using-reputation-with-nodejs.md b/src/pages/en/docs/reputation/using-reputation-with-nodejs.md similarity index 100% rename from src/pages/docs/reputation/using-reputation-with-nodejs.md rename to src/pages/en/docs/reputation/using-reputation-with-nodejs.md diff --git a/src/pages/docs/templates/demo.md b/src/pages/en/docs/templates/demo.md similarity index 100% rename from src/pages/docs/templates/demo.md rename to src/pages/en/docs/templates/demo.md diff --git a/src/pages/docs/templates/example-template.md b/src/pages/en/docs/templates/example-template.md similarity index 100% rename from src/pages/docs/templates/example-template.md rename to src/pages/en/docs/templates/example-template.md diff --git a/src/pages/docs/templates/guide-template.md b/src/pages/en/docs/templates/guide-template.md similarity index 100% rename from src/pages/docs/templates/guide-template.md rename to src/pages/en/docs/templates/guide-template.md diff --git a/src/pages/docs/templates/index-template.md b/src/pages/en/docs/templates/index-template.md similarity index 100% rename from src/pages/docs/templates/index-template.md rename to src/pages/en/docs/templates/index-template.md diff --git a/src/pages/docs/templates/tutorial-template.md b/src/pages/en/docs/templates/tutorial-template.md similarity index 100% rename from src/pages/docs/templates/tutorial-template.md rename to src/pages/en/docs/templates/tutorial-template.md diff --git a/src/pages/docs/troubleshooting/dapps/index.md b/src/pages/en/docs/troubleshooting/dapps/index.md similarity index 100% rename from src/pages/docs/troubleshooting/dapps/index.md rename to src/pages/en/docs/troubleshooting/dapps/index.md diff --git a/src/pages/docs/troubleshooting/javascript/index.md b/src/pages/en/docs/troubleshooting/javascript/index.md similarity index 100% rename from src/pages/docs/troubleshooting/javascript/index.md rename to src/pages/en/docs/troubleshooting/javascript/index.md diff --git a/src/pages/docs/troubleshooting/js-requestor/exit-codes.md b/src/pages/en/docs/troubleshooting/js-requestor/exit-codes.md similarity index 100% rename from src/pages/docs/troubleshooting/js-requestor/exit-codes.md rename to src/pages/en/docs/troubleshooting/js-requestor/exit-codes.md diff --git a/src/pages/docs/troubleshooting/js-requestor/index.md b/src/pages/en/docs/troubleshooting/js-requestor/index.md similarity index 100% rename from src/pages/docs/troubleshooting/js-requestor/index.md rename to src/pages/en/docs/troubleshooting/js-requestor/index.md diff --git a/src/pages/docs/troubleshooting/provider/index.md b/src/pages/en/docs/troubleshooting/provider/index.md similarity index 100% rename from src/pages/docs/troubleshooting/provider/index.md rename to src/pages/en/docs/troubleshooting/provider/index.md diff --git a/src/pages/docs/troubleshooting/yagna/index.md b/src/pages/en/docs/troubleshooting/yagna/index.md similarity index 100% rename from src/pages/docs/troubleshooting/yagna/index.md rename to src/pages/en/docs/troubleshooting/yagna/index.md diff --git a/src/pages/ja/docs/creators/common/providers-filesystem.md b/src/pages/ja/docs/creators/common/providers-filesystem.md new file mode 100644 index 000000000..a0c8803dc --- /dev/null +++ b/src/pages/ja/docs/creators/common/providers-filesystem.md @@ -0,0 +1,86 @@ +--- +title: 'Golem concepts: filesystem on a provider' +description: Explore topics related to file system on a VM run on a remote provider to better design your custom image. +pageTitle: VM Filesystem - how the image design impacts my options. +type: Guide +--- + +# Understanding the filesystem in VMs operated on providers + +Your options of what you can do on a provider will depend on how your image is configured. You already know that transferring data to and from a provider is possible only to/from locations within folders that are configured as `VOLUME` in your Dockerfile. ([Read here](/docs/creators/javascript/guides/golem-images) for information about images and how to create one.) + +If you run the command `df -h` on a VM built from this image on a provider, you'll receive an output similar to this: + +``` +Filesystem Size Used Available Use% Mounted on +overlay 128.0M 8.0K 128.0M 0% / +devtmpfs 630.2M 0 630.2M 0% /dev +tmpfs 632.8M 0 632.8M 0% /tmp +tmpfs 632.8M 0 632.8M 0% /dev/shm +mnt0 24.0G 10.2G 13.8G 42% /golem/work +``` + +This example utilized the `golem/examples-outbound:latest` image deployed on one of the providers in the `testnet`. If you run this test yourself, you might get different capacities for `tmpfs` and `mnt0` filesystems as they depend on the resources offered by the provider on which you run the task. + +Take a look at this output to better understand some Golem concepts. + +- The filesystem mounted under ‘/’ is limited to 128 MB of size as it's a filesystem stored in memory and can't be increased. +- Filesystems of ‘tmpfs` type are by default limited to 50% of the provider's allocated memory (more precisely: container's memory) and are stored in the provider's memory. +- The ‘/golem/work’ directory has much more space available, as it has access to disk storage offered by the provider. While this might not be obvious, this folder was defined as the `VOLUME` directory in the Dockerfile, that was used to create the `golem/examples-outbound: latest` image. On this provider, the user can utilize up to 13.8 GB of disk storage. + +Let's make another experiment: if you run the command `ls -l /golem` on a VM built from that image, you'll receive an output similar to this: + +``` + drwxrwxr-x 2 1000 1000 4096 Apr 11 07:41 work +``` + +Note the owner of this directory. + +Let's create a file in this directory and check its permissions: + +``` +touch /golem/work/testfile +ls -l /golem/work +``` + +The output should be: + +``` +-rw-r--r-- 1 1000 1000 0 Apr 11 07:41 testfile +``` + +Now if you try to change the owner of this file: + +``` +chown root /golem/work/testfile +``` + +you will get an error: + +``` +chown: /golem/work/testfile: Operation not permitted" +``` + +as for the provider's security, the features on this filesystem are limited. + +## Important conclusions from these observations + +- The available space for installing extra software in the root location is limited. As a result, although the `outbound` feature allows for the downloading and installation of certain apps, it's recommended to pre-install these applications directly into the image. This approach not only saves space but also speeds up task completion as the necessary software with be inside the cached image. Our recommendation is to adjust the image accordingly to include these applications from the start. + +- You can increase the `tmpfs` partitions up to the limit of the memory available to your VM, however, it will be at the cost of memory available for your application. Note, to do this you need to make sure that the required tools/commands are installed in your image. + +- Not specifying a directory as a `VOLUME` results in the inability to access the disk storage capacity advertised by the provider, thus making it unavailable for your VM. Additionally, without this declaration, the maximum storage capacity for saving outputs in other directories is limited to 50% of the provider's available memory. This limitation is automatically applied to each `tmpfs` by default. + +- When using the `VOLUME` directive, remember that when a Golem VM is started, a new directory is created in the host's file system for each of the defined volumes. Therefore, any previous content (placed there during image creation) will not be available to you. Do not locate any of your data in such directories during image creation. + +- Please remember that `VOLUME` directories are required to transfer data to and from the VM. For example if within the JS SDK you use work context methods like: `downloadFile()` or `uploadFile()`, you must use such a directory as a source/target directory. + +- If your software produces a large amount of data, save the output to a directory defined as a `VOLUME`. + +- The Linux filesystem features on the filesystem marked as VOLUME are limited. + +## A graphical representation + +Take a look at this picture that visualizes topics discussed in this article. + +![Filesystem on a VM](/requestor-vm-comms.jpg) diff --git a/src/pages/ja/docs/creators/common/requestor-provider-interaction.md b/src/pages/ja/docs/creators/common/requestor-provider-interaction.md new file mode 100644 index 000000000..0d25755ed --- /dev/null +++ b/src/pages/ja/docs/creators/common/requestor-provider-interaction.md @@ -0,0 +1,293 @@ +--- +title: How a requestor interacts with providers +description: A description of a typical interaction between a requestor and provider, illustrated with golem-js SDK events. +type: Guide +--- + +# Requestor - provider interactions + +This article is designed to explain some of Golem's concepts related to interactions between requestors and providers. It is illustrated with events that are emitted in the current JS SDK version. While the name of the events might be changed or different in other Golem SDKs, the basic concepts originate from Golem Network internals and stay the same. + +## The basics + +The requestor user defines his task in the form of a requestor script. This is a piece of code, that utilizes one of Golem SDKs to interact with the Golem Network (via Yagna demon). The Yagna service connects the user to the Golem Network and facilitates all his communications with other nodes. +On the provider side there is also a Yagna present, augmented with a provider logic ('ya-provider') that is responsible for fulfilling the provider's obligations: in case of VM payload - running the VM, passing the requestor's commands to it, and issuing billing data. + +## The story + +We have run a simple requestor script employing the Task Model and logged emitted events to show you how internally Golem Network works. The events in the list below are filtered (similar events are removed to make the story more readable) and sometimes reordered to keep related topics in the same section. +For some events we have only listed their names, for others we show some additional details to make this description easier to understand. + +When your requestor script starts, it connects to the yagna demon. To get access to yagna API, it is using the `app-key`. In our tutorials, we use a special 'try_golem' app-key. + +### Allocation + +One of the first actions is to create `Allocation` - a budget that is `reserved` by Yagna from the requestor's wallet for this particular interaction. Allocations serve two purposes. They ensure the requestor user has a declared budget in his wallet to pay to providers, and at the same time, it prevents the requestor from spending more than this amount (in case of his mistake in the script). + +### Demand + +`DemandSubscribed` + +Then the 'Demand' is sent to the network. The demand is a description of the resources and services that the requestor needs, the `payment platform` the requestor can use, together with the information on the image that the requestor intends to run on a provider. + +{% alert level="info" %} + +You can read more about the payment process [here](/docs/golem/payments). + +{% /alert %} + +The Yagna market module matches the demand with the offers from providers. The `offer` is a specification of the provider's resources, services, and accepted payment platforms. The pair of matched demand and offer is called a `proposal`. + +### Proposal + +The Requestor is presented with proposals. In the example below, you can see some detailed information from the offer: the provider's details, its resources, and capabilities. + +```bash +ProposalReceived { + id: 'R-f3886a1dd5c5c5017c2a4df2228da495d6e3283a1a22ba1a2c0970152bd32f33', + parentId: null, + provider: { + id: '0xedd84da61f7348510d9557c2f5067b460ef6588c', + name: 'BHS5-13.h', + walletAddress: '0xedd84da61f7348510d9557c2f5067b460ef6588c' + }, + details: { + transferProtocol: [ 'http', 'https', 'gftp' ], + cpuBrand: 'Intel Core Processor (Haswell, no TSX)', + cpuCapabilities: [ + 'sse3', 'pclmulqdq', 'vmx', + 'ssse3', 'fma', 'cmpxchg16b', + 'pcid', 'sse41', 'sse42', + 'x2apic', 'movbe', 'popcnt', + 'tsc_deadline', 'aesni', 'xsave', + 'osxsave', 'avx', 'f16c', + 'rdrand', 'hypervisor', 'fpu', + 'vme', 'de', 'pse', + 'tsc', 'msr', 'pae', + 'mce', 'cx8', 'apic', + 'sep', 'mtrr', 'pge', + 'mca', 'cmov', 'pat', + 'pse36', 'clfsh', 'mmx', + 'fxsr', 'sse', 'sse2', + 'fsgsbase', 'bmi1', 'avx2', + 'smep', 'bmi2', 'rep_movsb_stosb', + 'invpcid' + ], + cpuCores: 1, + cpuThreads: 1, + memory: 1.2790810316801071, + storage: 14.39749755859375, + publicNet: false, + runtimeCapabilities: [ 'inet', 'vpn', 'manifest-support', 'start-entrypoint' ], + runtimeName: 'vm', + state: 'Initial' + } +} +``` + +Then a negotiation process starts. In actual implementation, each side of the negotiations responds only with half of the `proposal` that contains the content that originates from that party, so the Requestor responds only with the updated `demand` part and the Provider only with the updated `offer` part. This is an automated process, based on the parameters defined by the user in the requestor script and `ya-provider's` configuration. This process is continued until all conditions are agreed upon, or either of the parties disengages i.e. due to the signing an `agreement` with another entity. + +```bash +ProposalResponded { + id: 'R-f3886a1dd5c5c5017c2a4df2228da495d6e3283a1a22ba1a2c0970152bd32f33', + provider: { + id: '0xedd84da61f7348510d9557c2f5067b460ef6588c', + name: 'BHS5-13.h', + walletAddress: '0xedd84da61f7348510d9557c2f5067b460ef6588c' + }, + counteringProposalId: 'R-953214acecebf335ef039eb8f98ef337f5b604885e15a34f69f797c6db7eafbd' +} +``` + +Your requestor negotiates multiple proposals at the same time. Some of them can be rejected by the other party like in the example below. This particular provider was already busy as he already signed an agreement with another requestor. + +```bash +ProposalRejected { + id: 'R-dfb4c352fe12227a22cdedcac146d6b0d56f9dd69ef14da098106f58e20707bf', + parentId: 'R-2cad4a7562beaf13491d554c7536e2d467fc692c447de053e1a5b5aa0c422470', + reason: 'No capacity available. Reached Agreements limit: 1' +} +``` + +### Agreement + +Once all the conditions are agreed upon, the requestor will create an `agreement` based on the latest proposals and send it to the Provider. +The `agreement` is a set of eventually agreed conditions that will define the engagement between the requestor and a provider. + +```bash +AgreementCreated { + id: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + provider: { + id: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + name: 'UK1-9.h', + walletAddress: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92' + }, + validTo: '2024-03-29T15:31:56.366Z', + proposalId: 'R-794d1d8e5230e9707f44cae4f6d49797a0278db4269890c66bd7e91f1f4531f6' +} +``` + +Provider confirms the agreement. + +```bash +AgreementConfirmed { + id: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + provider: { + id: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + name: 'UK1-9.h', + walletAddress: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92' + } +} +``` + +Note that the requestor may have agreements with multiple providers at the same time and distribute its task in parallel to all of them. + +### Activity + +Once the agreement is confirmed by both parties, we can start the deployment of our image to run a VM. At first, the `activity` is created. You can imagine an activity as a representation of a VM instance run on a provider. In theory, you may have more than one activity under the same agreement, but at this moment typical providers offer a single one at the same time. + +```bash +ActivityCreated { + id: 'b284fcf996ed4b8da7cd1012233d23a1', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f' +} +``` + +All the time we can monitor activity status to know if the VM on the provider node is still available and running. Now it is initialized and ready for our commands. + +```bash +ActivityStateChanged { id: 'b284fcf996ed4b8da7cd1012233d23a1', state: 'Initialized' } +``` + +### Scripts + +In the task model, the chunk of work is defined as a task (function). A task is a set of commands that the requestor wants to execute to obtain desired results. +Internally all the commands are organized as `scripts`, that are sent and executed on a provider. There are several commands (depending on the type of the runtime utilized) available for the requestor. For a VM, you can `start`, `deploy`, `run`, `transfer`, and `terminate`. So, as you see, even the initial image deployment is sent and executed as a `script`, but the user does not need to bother about it, as it is all handled by the Golem SDKs. + +```bash +ScriptSent { + activityId: 'b284fcf996ed4b8da7cd1012233d23a1', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f' +} +``` + +The script is then executed on the provider. + +```bash +ScriptExecuted { + activityId: 'b284fcf996ed4b8da7cd1012233d23a1', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + success: true +} +``` + +In the Task model, such a sequence will be repeated to complete all commands for a given task. Then the next task will be run. As we use the same activity (and the same VM) subsequent tasks will inherit the state of the VM from the previous one. + +### Debit Note + +`Debit notes` are notifications regularly sent by providers to requestors that detail current costs and resource usage. In longer agreements, these debit notes may also trigger partial payments for current usage, ensuring providers receive regular payments throughout the contract, rather than solely at the end. +Debit notes must be timely accepted by the requestors, to confirm that they are still present in the network and engaged (this is handled by SDK logic that can be configured by the requestor user). + +Note that Debit Notes are related to particular activities. + +```bash +DebitNoteReceived { + id: '8aaad984-b03a-48d4-bea4-ac49dd4394c3', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + activityId: 'b284fcf996ed4b8da7cd1012233d23a1', + amount: 0.0009088683599, + amountPrecise: '0.000908868359900000', + provider: { + id: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + walletAddress: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + name: 'UK1-9.h' + } +} +``` + +In some cases, the acceptance of the DebitNote can fail. In the example below the acceptance for a debit note is rejected as it was already covered by the invoice payment. This particular case is because both invoices and debit notes are processed asynchronously and the SDK logic takes care to manage it in a proper way to avoid double payments. + +```bash +PaymentFailed { + id: '8aaad984-b03a-48d4-bea4-ac49dd4394c3', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + reason: 'DebitNote 8aaad984-b03a-48d4-bea4-ac49dd4394c3 rejected because the agreement 0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f is already covered with a final invoice that should be paid instead of the debit note' +} +``` + +### Invoices + +The `agreement` can be terminated either by the requestor, if there are no more tasks to be executed with the provider, or by the provider due to the expiration of the agreed duration or the requestor's failure to timely accept a debit note. Upon termination of the `agreement`, the provider will send an invoice. + +```bash +InvoiceReceived { + id: 'ce3c9c5a-d94b-4864-a4f4-9454a33eade6', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + amount: 0.0009088683599, + amountPrecise: '0.000908868359900000', + provider: { + id: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + walletAddress: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + name: 'UK1-9.h' + } +} +``` + +### Payments + +The requestor accepts the payment and the payment driver used by Yagna will handle the processing of the payment. + +```bash +PaymentAccepted { + id: 'ce3c9c5a-d94b-4864-a4f4-9454a33eade6', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + amount: 0.0009088683599, + amountPrecise: '0.000908868359900000', + provider: { + id: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + walletAddress: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + name: 'UK1-9.h' + } +} +``` + +The payment is executed on a blockchain and the GLM transfer and the confirmation is sent to the provider. + +### Closing the interaction + +When the `agreement` is terminated the `activity` is destroyed, so our VM is not running anymore. + +```bash +ActivityDestroyed { + id: 'b284fcf996ed4b8da7cd1012233d23a1', + agreementId: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f' +} +``` + +and agreement is terminated: + +```bash +AgreementTerminated { + id: '0ecd3882e3460d47ff98cb5d2abb9b0ad055ae8be79074614d03102b8a81e45f', + provider: { + id: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92', + name: 'UK1-9.h', + walletAddress: '0x3d34d91eb4ab14b9f4fd8ac8985f82cc9eb28a92' + }, + reason: 'All computations done' +} +``` + +When the requestor script completes all the tasks or when it is terminated, it will unsubscribe its `demand` from the market and release the `allocation` created at the beginning of the process. + +```bash +DemandUnsubscribed { + id: '23bb8fe1d8d64c25bf3ab3f11da0a1ca-9344e7c48829b664bbbce043582cbc888480c6d7d4d105e16c1a6b94272f9810' +} +``` + +{% docnavigation title="See also" %} + +- [Working with Events JS](/docs/creators/javascript/examples/working-with-events) example. + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/dapps/creating-golem-dapps.md b/src/pages/ja/docs/creators/dapps/creating-golem-dapps.md new file mode 100644 index 000000000..92bd05d2d --- /dev/null +++ b/src/pages/ja/docs/creators/dapps/creating-golem-dapps.md @@ -0,0 +1,366 @@ +--- +description: Creating your own decentralized Golem Applications +title: Creating Golem dApps +type: Guide +--- + +# Creating Golem dApps + +## Components specification + +Just as it would be the case with any other platform, you start with a specification of components comprising your application. + +For now, we’re going to assume that everything is run on Golem’s virtual machine (VM) runtime. Although individual Golem providers can run any number of runtime environments, and we even provide Golem Runtime SDK to create your own custom runtimes, the default provider configuration right now includes just two - the VM runtime and the WASM runtime. Additionally, of these two, only the former is directly supported by the Golem Deploy platform at present. + +As the virtual machine image format that the VM runtime operates on is derived from Docker, the decision then comes down to packaging your app into a number of Docker containers. Of course it’s up to an application developer to decide how exactly to proceed here. Still, there are a few criteria that should be considered here. + +While it would, in most cases, be easier to set-up your app as a single image, it is bound to make the application as a whole a lot harder to maintain. Imagine you’d like to replace or update one of the components. In the case of a single image, you’d need to rebuild and re-upload the whole thing instead of just one piece. Secondly, it’s much easier to test and debug each component of your app if they’re logically partitioned than it would be if you had just one large box. + +Another important point to consider is that each VM image is run on a different Golem provider. Having smaller and more specialized images will make it easier for providers to run each one, and it will also make your app easier to scale in the long term. + +The obvious downside is that you’re paying for each running VM image and additionally, there is always a communications overhead incurred when the components connect over the Golem Network. That’s why you should always consider the advantages and disadvantages of both approaches when designing your own decentralized apps for Golem. + +## Preparing Golem VM images + +Golem’s virtual machine runtime uses its own image format, which is derived from Docker’s, and we offer a tool to convert the images from Docker to GVMI (Golem Virtual Machine Image). + +For instructions on how to create a Golem VM image, please refer to: + +[Converting a Docker image to the Golem image Tutorial](/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format) + +What should be kept in mind is that there are still important discrepancies between the VM runtime and Docker’s own execution environment. We’re providing a non-exhaustive list of those in: [Differences between Docker containers and Golem VM runtime](/docs/creators/dapps/docker-containers-vs-golem-vms) + +For a GVMI image to be used by providers, it needs to be published somewhere where it can be downloaded. The easiest way to do this is by uploading it to the Golem image repository. For instructions, please refer to: [Publishing a Golem image](/docs/creators/tools/gvmkit/publishing-custom-images) + +If the image is uploaded to the repository, its hash is the only piece of information needed for the image to be retrieved and used by providers. If it’s available under a different, publicly-available URL, both the image hash and the URL need to be supplied. + +The above is true if the image uses a default set of privileges, or - in other words - if it doesn’t need to access external internet locations. To enable outbound internet access from VM runtimes, the images need to be accompanied by [Manifest files](/docs/creators/dapps/creating-golem-dapps#manifest-files). + +## Manifest files + +To enable some additional features, images may need to be accompanied by manifest files. Currently, the only feature that requires a manifest is outbound network location access. Therefore, if you wish to access any external URLs from within your application, the container from which the connections will originate must be supplied as a manifest file. + +Apart from containing the location of the VM image and its hash, the manifest files specify what operations a given image can invoke and - among others - what network protocols it uses and what external URLs it accesses. + +### Format + +The manifests are JSON files conforming to a specific schema, e.g.: + +```json +{ + "version": "0.1.0", + "createdAt": "2022-12-01T00:00:00.000000Z", + "expiresAt": "2100-01-01T00:00:00.000000Z", + "payload": [ + { + "platform": { + "arch": "x86_64", + "os": "linux" + }, + "urls": [ + "http://girepo.dev.golem.network:8000/docker-gas_scanner_backend_image-latest-91c471517a.gvmi" + ], + "hash": "sha3:05270a8a938ff5f5e30b0e61bc983a8c3e286c5cd414a32e1a077657" + } + ], + "compManifest": { + "version": "0.1.0", + "script": { + "commands": ["run .*"], + "match": "regex" + }, + "net": { + "inet": { + "out": { + "protocols": ["http"], + "urls": ["http://bor.golem.network"] + } + } + } + } +} +``` + +For more detailed information regarding the manifest files, the schema they use and their usage in Golem, please refer to: [Computation Payload Manifest](/docs/golem/payload-manifest). + +### **Manifest signatures** + +While a manifest is needed to enable an image to access _any_ external locations, some locations have been whitelisted so that connecting to them doesn’t require anything besides that. + +For a complete list of those locations, please refer to: + +[ya-installer-resources/whitelist at main · golemfactory/ya-installer-resources](https://github.com/golemfactory/ya-installer-resources/tree/main/whitelist) + +Each provider can freely add new addresses and patterns to the whitelist. For documentation on how to do that, please refer to: + +[Provider outbound configuration](/docs/providers/configuration/outbound) + +If the application wishes to access a URL which matches one of the entries on a whitelist, it only needs to supply that address within the manifest file. + +Locations from outside the above whitelist, additionally require the manifest to be signed using a requestor certificate trusted by a provider. By default, providers trust certificates issued by Golem Factory, but they can clear others at their leisure. + +### **Accessing non-standard ports** + +One important caveat is that specifying a URL in the manifest only enables the image to access a service located under the standard port, e.g. `http://github.com` will only enable requests that access port `80` on GitHub. To be able to query a non-standard port, the manifest must specify that location along with the specific port, e.g.: + +```json +"net": { + "inet": { + "out": { + "protocols": [ + "http" + ], + "urls": [ + "http://bor.golem.network:4242", + "http://bor.golem.network:8080", + ] + } + } + } +``` + +At the moment, the manifests provide no way to specify a port range or a wildcard that would include all the ports on a given address. Therefore, if you need to access any ports other than the default, you must include several lines in the manifest, each with a different port number. + +## Testing the images + +Before deploying the app to Golem, you may wish to test it. + +One way to do this is by bundling it with `docker-compose` and verifying that all of its components work as intended when launched as a whole. Of course, there are currently quite a few differences between Docker and Golem. Therefore, confirming that your application works correctly on the former is not yet a guarantee of success when launched on the latter, but it still remains a great way of ensuring no detail has been missed at this stage. + +### ya-runtime-dbg + +Other than that, each singular image comprising your application may be tested separately using a tool known as `ya-runtime-dbg`. It’s especially useful if you encounter an elusive, hard-to-pinpoint issue when trying to launch your app on Golem. For more information, please refer to: + +[Testing a Golem image tutorial](/docs/creators/javascript/tutorials/testing-golem-image) + +#### Lack of network connectivity in ya-runtime-dbg + +The main issue with testing your apps this way is that `ya-runtime-dbg` doesn’t currently offer a way to expose the network ports of services within the image nor does it allow an app running inside it to access any external network locations. + +## Application descriptor + +Now that your VM images and manifest files are ready, it’s time to combine them into a Golem Deploy application. Golem’s decentralized app descriptors are YAML files, vaguely similar to those used by docker-compose. + +Example app descriptor for a two-layer HTTP + DB application: + +```yaml +meta: + name: "Simple, db-enabled web application." + description: "An example showcasing a trivial web application consisting of a + web server and a database host deployed together on the Golem Network. + " + author: "Golem Factory" + version: "0.1.0" +payloads: + db: + runtime: "vm" + params: + image_hash: "85021afecf51687ecae8bdc21e10f3b11b82d2e3b169ba44e177340c" + http: + runtime: "vm" + params: + image_hash: "c37c1364f637c199fe710ca62241ff486db92c875b786814c6030aa1" +nodes: + db: + payload: "db" + init: + - run: + args: + - "/bin/run_rqlite.sh" + network: "default" + ip: + - "192.168.0.2" + http: + payload: "http" + init: + - run: + args: ["/bin/bash", "-c", "cd /webapp && python app.py --db-address 192.168.0.2 --db-port 4001 initdb"] + - run: + args: ["/bin/bash", "-c", "cd /webapp && python app.py --db-address 192.168.0.2 --db-port 4001 run > /webapp/out 2> /webapp/err &"] + http_proxy: + ports: + - "5000" # specify just the remote port, allow the local port to be automatically chosen + network: "default" + ip: + - "192.168.0.3" + depends_on: + - "db" +networks: + default: + ip: "192.168.0.0/24" +``` + +The schema of the app descriptors is described as part of [GAP-16](https://github.com/golemfactory/golem-architecture/blob/master/gaps/gap-16_golem_deploy/gap-16_golem_deploy.md) on GitHub: + +There are three important root elements of the descriptor, namely `payloads`, `nodes`, and `networks`. + +### Payloads + +The payloads part enumerates all the VM images or other runtime definitions that constitute components of your application. Each of the payloads translates to a demand published on the Golem Network to which any providers eager to run them will respond. + +As mentioned earlier, in case of the VM runtime, the payload may be an image hash or - if your image needs to access external URLs - a base64-encoded manifest. + +### Nodes + +If the payloads could be said to describe the “what” of your app, the nodes part describes the “how”. Each entry translates to a service that’s deployed to a provider. Each service must obviously specify the payload that it uses. + +#### init + +Services need to specify any and all ExeScript commands that must be run in order for a given service to start. Those commands comprise the content of the `init` clause. Currently, only the `run` command is supported by the `dapp-runner`. + +Example initialization ExeScript: + +```yaml +init: + - run: + args: ['/bin/chmod', 'a+x', '/'] + - run: + args: ['/bin/bash', '-c', '/bin/run_web.sh 192.168.0.3 &'] +``` + +#### network and ip + +Most of the applications consisting of more than one node will likely require the individual nodes to be connected to each other. That’s what the `network` and `ip` elements are for. As expected, they specify, respectively, which of the defined networks a given node should be part of and what IP address should be assigned to the node within the network. + +Example definition: + +```yaml +network: "default" + ip: + - "192.168.0.4" +``` + +#### depends_on + +In addition to enumerating the services, you may wish to specify dependencies between them. If e.g. your back-end application assumes that it can connect to a database when it starts, you’ll need the database to be up and running already when you start the back-end. In such a case, your back-end component should specify a `depends_on` element pointing to the DB node. The startup of the back-end will then only be executed once the database is confirmed to have started successfully. + +Example: + +```yaml +depends_on: + - 'api' +``` + +#### http_proxy and tcp_proxy + +Those two components specify the two currently supported ways of exposing a service within your app to the outside world. Both of them open a local port on the requestor machine and route the traffic to your application through that open port. + +Example: + +```yaml +http_proxy: + ports: + - '80' +``` + +You can specify just one port or a colon-separated mapping. If a single number is specified, the given remote port will be mapped to an automatically-chosen local port. On the other hand, specifying another number after a colon will attempt to map the remote port to this specific local port but will fail if it is already taken. + +Once a service is launched and `dapp-runner` succeeds in starting a local proxy, it will emit the following message to the `data` stream: + +```json +{ "cache": { "local_proxy_address": "http://localhost:8080" } } +``` + +You should be able to access your service using that published URL. + +The chief difference between the HTTP proxy and the generic TCP socket proxy is that the first one is protocol-aware and limited to HTTP only. The second one is more versatile and connects to any TCP services (e.g. databases, SSH services, etc) running on the provider nodes. + +The tradeoff is that only the HTTP proxy can be used with external platforms exactly because, in order to correctly map the addresses, the platform must be able to interpret the incoming requests. + +Again, please note that both types of connections are only exposed through ports on the same machine that `dapp-runner` is running on. In the future, we’re planning to support remote relays that will enable connections to services to be made without requiring the requestor’s active participation. + +## Running the application + +### dapp-runner + +The most straightforward way of running your dApp on Golem currently is by using `dapp-runner` directly. Dapp-runner is our reference implementation of the Golem Deploy model, able to take your application descriptor and connect to a Yagna service to first orchestrate deployment of all the components of your app and then supervise their state. + +Extensive information on running and installing the `dapp-runner` can be found in its README: + +[See dapp-runner on GitHub](https://github.com/golemfactory/dapp-runner/). + +### dapp-manager + +While starting apps with the `dapp-runner` is the simplest and most straightforward way of starting and testing your dApps on Golem, it may become cumbersome when you wish to run multiple apps at the same time. + +That’s where `dapp-manager` comes in - it makes it more convenient to launch multiple apps and monitor their states alongside. + +Again, for details on the installation and running of `dapp-manager`, have a look at its documentation in the github repository: + +[See dapp-manager on GitHub](https://github.com/golemfactory/dapp-manager/). + +As an additional perk, using `dapp-manager` enables you to more conveniently interact with running services using `dapp-manager exec` command in case you wish to debug or tweak the service after it has been deployed. + +## Additional tools + +### Connecting to services running on the providers + +As mentioned in the application descriptor section above ([`http_proxy` and `tcp_proxy`](/docs/creators/dapps/creating-golem-dapps#http-proxy-and-tcp-proxy)) by specifying a `http_proxy` or `tcp_proxy` in the application descriptor, you enable a given port within the node to be accessed using a local port on the requestor’s machine. + +#### Local HTTP proxy + +To enable a HTTP proxy, use the `http_proxy` property of a `node` entry, e.g.: + +```yaml +nodes: + http: + # + # (other properties) + # + http_proxy: + ports: + - '80' +``` + +This enables an automatically-chosen local port to be mapped to a remote port. Once the service is completely initialized on the remote node, dapp-runner emits a data message with a location of the mapped port: + +```json +{ "backend": { "local_proxy_address": "http://localhost:8081" } } +``` + +You can then use your browser or any other HTTP-based tool to access the service. Choosing the HTTP proxy has two benefits as compared with the generic TCP proxy. First, it causes requests and responses to be logged by the `dapp-runner` and allows for easier debugging in case of issues. Secondly, and possibly more importantly, it allows the service exposed in this way to be available when the application is deployed on Golem's Portal. + +#### TCP proxy + +As opposed to the HTTP proxy, the TCP proxy opens a generic, two-way connection between the specified remote port and a local port. It is enabled using, e.g.: + +```yaml +nodes: + mongo: + # + # (other properties) + # + tcp_proxy: + ports: + - '27017' +``` + +After the given node has finished its startup, dapp-runner emits a data message giving the location of the mapped port: + +```json +{ "mongo": { "local_tcp_proxy_address": "localhost:8080" } } +``` + +Using a generic TCP proxy enables connections to all kinds of TCP-based services. You can use it to connect directly to a database, an SSH server, or other kinds of services. This may be useful for debugging purposes or maybe because running a database on a provider that you connect to from the outside is exactly what you want to use Golem Deploy framework for. + +### Running commands on the remote nodes + +While developing, testing, or just using your app, you might want to access a shell or execute additional commands on the deployed service nodes. Dapp-manager’s `exec` command serves exactly this purpose. + +#### Usage + +Given a node named `backend`, and assuming the image contains the `/bin/bash` binary you could execute a command this way: + +```bash +$ dapp-manager exec backend -- /bin/bash -c "ls -alh" +``` + +#### Issues + +Because those commands are sent as ExeScripts to the underlying Golem Activity, the main issue currently is that any error while executing such a command is treated as a failure of the activity in question and both the activity and the agreement are immediately terminated by the provider. + +As a work-around, one could e.g. bundle and start an SSH service in your image and connect to it using a [TCP proxy](/docs/creators/dapps/creating-golem-dapps#tcp-proxy). + +For an illustration of such usage, please refer to the following `yapapi` SSH connection example: + +[See SSH example on GitHub](https://github.com/golemfactory/yapapi/tree/master/examples/ssh) diff --git a/src/pages/ja/docs/creators/dapps/docker-containers-vs-golem-vms.md b/src/pages/ja/docs/creators/dapps/docker-containers-vs-golem-vms.md new file mode 100644 index 000000000..26e3f2343 --- /dev/null +++ b/src/pages/ja/docs/creators/dapps/docker-containers-vs-golem-vms.md @@ -0,0 +1,55 @@ +--- +description: Differences between Docker containers and Golem VM runtime +title: Differences between Docker containers and Golem VM runtime +type: Guide +--- + +# Differences between Docker containers and Golem VM runtime + +While Golem’s VM images derive from Docker’s, there are quite a few implementation and design differences that necessitate a careful approach when creating Golem decentralized apps. + +## Cross-container connections + +Golem doesn’t include its own mechanism of mapping host names to IP addresses across the nodes of its virtual private networks. Therefore, the connections between the services need to be specified directly using IP addresses. + +It’s best to parametrize the images so that you can specify the exact connection parameters in the initialization scripts. + +## Volumes cannot contain initial content + +If you specify a location in an image as volume, a shared directory from the host’s filesystem will be mounted there instead of the original location. Therefore, any files and subdirectories within that location won’t be accessible. + +It’s an important point to consider when designing your own images or tweaking existing ones, since the root filesystem is an in-memory one, which may limit its usefulness when it comes to large amounts of data. + +Additionally, volumes are the only locations that can be written-to and read-from using ExeScript `transfer` commands (which are not currently supported by the `dapp-runner`). + +## Volumes use 9p filesystem + +To map the contents of the host directory to a VM volume, the virtual machine runtime uses the `9p` filesystem. It doesn’t support functions that operate directly on filesystem inodes which may cause some tools not to work correctly. + +Currently, the only supported solution is switching the working locations to a location that’s not on a volume. + +## Broken file permissions on the root directory + +The VM runtime overrides the permissions for the root directory of the container. It’s owned by `root` and only includes permission for the root user. If you launch processes as non-root users, as some stock VM images do by default (notably `nginx` and `postgresql`), they won’t be able to access their data directories. + +Specifically, the stock image of the nginx server fails to serve the data files correctly and returns a "404 Not Found" error when accessing otherwise correct paths. + +The solution is to incorporate a `chmod +x /` command at the beginning of your `init` script. + + +## No support for ENTRYPOINT and/or CMD + +Dapp-runner doesn’t currently support executing initialization scripts configured directly in the image with `ENTRYPOINT` and `CMD` clauses. Such support already exists in the VM runtime and will soon be included in the rest of the stack. + +There is a caveat though that running commands this way (either through entrypoint or by scheduling them to run in the background) makes the execution script finish after those commands are launched and their output/error streams are no longer available. + +## No direct support for environment variables + +There’s no way to pass environment variables to commands executed from the application descriptors. The current work-around is to include dotenv files support into the service run inside the container, and initialize the `.env` files in the `init` script - or - to pass those environment variables alongside your commands, e.g.: + +```yaml +init: + - ["/bin/sh", "-c", "YOUR_VAR=123 your command"] +``` + +Direct support for the passing of environment variables is planned soon. diff --git a/src/pages/ja/docs/creators/dapps/hello-world-dapp.md b/src/pages/ja/docs/creators/dapps/hello-world-dapp.md new file mode 100644 index 000000000..d1977fecd --- /dev/null +++ b/src/pages/ja/docs/creators/dapps/hello-world-dapp.md @@ -0,0 +1,425 @@ +--- +description: Create your first "Hello World" dApp on Golem +title: dApp on Golem tutorial +type: Tutorial +--- + +# Hello World dApp + +## What's in it for me? + +By following this tutorial, you'll be able to get more confident about: + +- Preparing a Docker image for your app with the ultimate purpose of deploying it on Golem. +- Converting the VM image to Golem and uploading it to Golem's repository. +- Creating a descriptor reflecting your app using YAML syntax similar to that used by `docker-compose`. +- Deploying your app to Golem using `dapp-runner`. + +## Prerequisites + +To follow this tutorial in full, you need to have Docker installed on your machine. If you don't have it installed, please refer to the [instructions on Docker's website](https://docs.docker.com/get-docker/). + +{% alert level="info" %} + +This step-by-step tutorial will be easier for you to follow if you previously had a chance to [launch the `yagna` service as a requestor](/docs/creators/tools/yagna/yagna-installation-for-requestors) and have any experience building portable web applications on Docker, but you should be able to complete it without any prior experience nevertheless. + +{% /alert %} + +## Choice of tools + +The example that we're going to show you here, uses a very simple Python HTTP server. + +On the other hand, if you're more acquainted with any other language or platform that enables you to easily create a simple HTTP server and pack it into a Docker image, go for it. + +Just as well - if the setup and construction of such a simple app is obvious to you, feel free to jump to **Converting the image to Golem** + +## Environment preparation + +For the sake of completeness, we're including the steps that prepare our Python environment. Again, you're free to do it your way and skip to [Hello World dApp](#hello-world-app): + +### Create and activate the virtual environment + +{% tabs %} + +{% tab label="Linux / MacOS" %} + +```bash +python3 -m venv ~/.envs/hello-dapps +source ~/.envs/hello-dapps/bin/activate +pip install -U pip poetry +``` + +{% /tab %} +{% tab label="Windows" %} + +```shell +python -m venv --clear %HOMEDRIVE%%HOMEPATH%\.envs\hello-dapps +%HOMEDRIVE%%HOMEPATH%\.envs\hello-dapps\Scripts\activate.bat +``` + +{% /tab %} +{% /tabs %} + +### Initialize the project + +{% tabs %} + +{% tab label="Linux / MacOS" %} + +```shell +mkdir -p hello_golem/server_app +cd hello_golem/server_app/ +poetry init --no-interaction --python="^3.9" +``` + +{% /tab %} +{% tab label="Windows" %} + +```shell +mkdir "hello_golem\server_app" +cd hello_golem/server_app/ +poetry init --no-interaction --python="^3.9" +``` + +{% /tab %} +{% /tabs %} + +### Add the requirements + +In our little example here, we'll use `Flask`, a very robust and minimal Python back-end framework. + +```shell +poetry add Flask +``` + +There, we're ready to start coding our app. + +## Hello world app + +{% alert level="info" %} + +If you're lost at any moment, feel free to consult our source of the "Hello World" application available at: [https://github.com/golemfactory/dapp-experiments/tree/main/05_hello_world](https://github.com/golemfactory/dapp-experiments/tree/main/05_hello_world) + +Similarly, instead of coding along, you may just check out the whole thing from the repository: + +```shell +git clone https://github.com/golemfactory/dapp-experiments.git +cd dapp-experiments/05_hello_world +``` + +{% /alert %} + +Fire up your favourite editor or IDE and navigate to the `hello_golem/server_app` directory that we have set up above. + +If you have configured the app using poetry like we did above, you should already see the `pyproject.toml` and `poetry.lock` files. + +In the directory, add `hello_golem.py` and just paste the following few lines which are a slightly modified version of [Flask's original, minimal example](https://flask.palletsprojects.com/en/1.1.x/quickstart/): + +```python +from flask import Flask +app = Flask(__name__) +@app.route('/') +def hello_golem(): + return 'Hello from Golem!' +app.run(host="0.0.0.0") +``` + +The above code achieves the following: + +1. Import the `Flask` engine +2. Define our Flask app +3. Set up the root route for the app +4. Launch the Flask server + +{% alert level="info" %} + +You may wish to customize the "Hello..." message up there, to make your application (and, more importantly, its VM image) unique. Our repository is set up to reject repeated uploads of images with matching signatures so, if you encounter an issue while uploading your application later in this tutorial, please use the image hash that we'll provide you there. +{% /alert %} + +{% alert level="warning" %} + +For local testing, we could have simply used just `app.run()`. That makes the server listen on the local host address (`127.0.0.1`) by default. We need it to bind to all addresses so that it can later work correctly in Golem. +{% /alert %} + +## Local test + +Let's test this app locally, before we start preparing it for Golem. Launch the app: + +```shell +python hello_golem.py +``` + +and then point your browser to [http://127.0.0.1:5000](http://127.0.0.1:5000). + +You should see "Hello from Golem!" which proves that our minimal app is working correctly when launched completely stand-alone. Good! + +## Preparing the Docker image + +We need to start with a Docker image since the only currently-supported way of creating a GVMI (Golem Virtual Machine Image) file is by providing a Docker image for conversion. + +If you'd like to know more about GVMI images and about the conversion process, please refer to: +[Golem Images explained](/docs/creators/javascript/guides/golem-images) + +Let's back-up a little and ensure that we're one directory above `server_app`. + +```shell +cd .. +``` + +To build a docker image, we'll need a file called `Dockerfile` with the following contents: + +```dockerfile +FROM python:3.9-slim +RUN pip install -U pip poetry +RUN mkdir /app +COPY server_app/* /app/ +WORKDIR /app +RUN poetry install --no-root +ENTRYPOINT poetry run python hello_golem.py +``` + +Let's now go through what happens there. + +1). Take a stock Python Docker image (the slim version, we won't need anything more here): + +```dockerfile +FROM python:3.9-slim +``` + +2). Install the needed tools: + +```dockerfile +RUN pip install -U pip poetry +``` + +3). Copy the app contents to the image: + +```dockerfile +RUN mkdir /app +COPY server_app/* /app/ +``` + +4). Install the app's requirements: + +```dockerfile +WORKDIR /app +RUN poetry install --no-root +``` + +5). Finally, set up the Docker's entrypoint: + +```dockerfile +ENTRYPOINT poetry run python hello_golem.py +``` + +### Testing the Docker image + +With the Dockerfile ready, we can test whether the app works inside the container: + +```shell +docker build -t hello-dapps . +docker run -it -p 5000:5000 hello-dapps +``` + +Once again, after the image launches, you may connect to http://127.0.0.1:5000/ with your browser, and you should be able to see the "Hello..." message, which confirms that the app has been correctly packaged and is working as it should. + +## Converting the image to Golem + +To be able to use our newly-created image on Golem, we need to convert it to Golem's custom format and then make the image available to providers. The easiest way to achieve the latter is to upload the image to our image repository. + +### Obtain the `gvmkit-build` tool + +```shell +pip install gvmkit-build +``` + +### Upload the image to the repository + +```shell +gvmkit-build golem-example --push --nologin +``` + +Once the command completes, you should get a line containing the image hash, e.g.: + +``` +image already generated +on 102777844: success. hash link 3032b6e97914eb5ee87d71188180d271f04eb9472b6da0d308943b2f +``` + +The hash there: `3032b6e97914eb5ee87d71188180d271f04eb9472b6da0d308943b2f` is what we're interested in. + +If the command fails because the image has already been uploaded, feel free to use the hash above and follow through with the tutorial. + +## Prepare the Golem dApp descriptor + +Now that we have the image ready, uploaded into the Golem repo, and its hash in hand, we can prepare the descriptor of the application that we're going to launch on Golem. + +For more in-depth information about the dApp descriptors, please consult the [appropriate section of the "Creating Golem dApps" article](/docs/creators/dapps/creating-golem-dapps#application-descriptor). Here, we're just covering the bare minimum. + +Here's what it looks like: + +```yaml +payloads: + hello: + runtime: 'vm' + params: + image_hash: '3032b6e97914eb5ee87d71188180d271f04eb9472b6da0d308943b2f' +nodes: + hello: + payload: 'hello' + init: + - run: + args: + ['/bin/sh', '-c', 'poetry run python hello_golem.py > /dev/null &'] + http_proxy: + ports: + - '5000' +``` + +Let's add it as `hello_golem.yaml` in the `hello_golem` directory. + +There are two obligatory elements in it, the `payload` and `nodes`. + +### The payload + +The payload is the definition of what kind of activity you'd like the providers to run on your behalf. + +In this case, it's just the reference to the VM image we just uploaded. + +```yaml +payloads: + hello: + runtime: 'vm' + params: + image_hash: '3032b6e97914eb5ee87d71188180d271f04eb9472b6da0d308943b2f' +``` + +### The node definition + +A `node` entry defines the parameters of the specific instances of services that we want launched on Golem. + +```yaml +nodes: + hello: + payload: 'hello' + init: + - run: + args: + ['/bin/sh', '-c', 'poetry run python hello_golem.py > /dev/null &'] + http_proxy: + ports: + - '5000' +``` + +A couple of important details here. + +Firstly, given the fact that Docker's `ENTRYPOINT` is not yet supported by the `dapp-runner`, our service definition must contain any and all commands that will start our service in the container. + +Moreover, as the commands included in the `init` must finish before the service can be treated as started, we need to put the service in the background. For this reason, we're launching our service using the shell and adding the ampersand (`&`) to the end of the command. + +One more caveat is that we need to redirect the output stream of the launched app so that it stays running after we exit the shell. + +Lastly, we're adding the `http_proxy` element because our service is an HTTP app which we wish to be able to talk to. There's currently no way for the service to be exposed directly on the provider's own address but we can use the local HTTP proxy functionality to expose a port on our own machine that will forward traffic to the app through the Golem Network. + +## The config file + +There's one more piece of data that we'll need to run our application. It's the configuration of our Golem requestor that we need to supply for the `dapp-runner`. + +Unless you want to customize your set-up, it'll be easiest to just use the default that comes with the `dapp-runner`, which you can get with: + +```shell +curl https://raw.githubusercontent.com/golemfactory/dapp-runner/main/configs/default.yaml > golem_config.yaml +``` + +## Running your app + +### Ensure your yagna service is started + +First, let's make sure that you have your yagna service up and running and if not, execute this in another console session: + +```shell +yagna service run +``` + +{% alert level="info" %} + +If you haven't set-up your yagna service before, please refer to our [Yagna installation instruction](/docs/creators/tools/yagna/yagna-installation-for-requestors). +{% /alert %} + +### Obtain the application key + +Please, run: + +```shell +yagna app-key list +``` + +and copy the value listed in the `key` column. + +If the above command doesn't give you any 32-char keys, just create your app key: + +`shell yagna app-key create requestor` + +and copy the value output by this command. + +### Export your application key to the environment + +{% tabs %} + +{% tab label="Linux / MacOS" %} + +```bash +export YAGNA_APPKEY= +``` + +{% /tab %} +{% tab label="Windows" %} + +```bash +set YAGNA_APPKEY= +``` + +{% /tab %} +{% /tabs %} + +### Install the `dapp-runner` + +{% tabs %} + +{% tab label="Linux / MacOS" %} + +```bash +python3 -m venv --clear ~/.envs/dapp-runner +source ~/.envs/dapp-runner/bin/activate +pip install dapp-runner +``` + +{% /tab %} +{% tab label="Windows" %} + +```shell +python -m venv --clear %HOMEDRIVE%%HOMEPATH%\.envs\dapp-runner +%HOMEDRIVE%%HOMEPATH%\.envs\dapp-runner\Scripts\activate.bat +pip install dapp-runner +``` + +{% /tab %} +{% /tabs %} + +### Run the app + +Now you're ready to start the app on Golem. + +```shell +dapp-runner start --config golem_config.yaml hello_golem.yaml +``` + +Once the app launches, you should see some status messages describing various stages of the deployment. And finally, you should see: + +``` +{"hello": {"local_proxy_address": "http://localhost:8081"}} +``` + +The port may be different on your machine, since it's assigned automatically. Copy the address that you get there and paste that into your browser. + +Assuming everything went well, you've just managed to create and deploy your own decentralized application on Golem. diff --git a/src/pages/ja/docs/creators/dapps/index.md b/src/pages/ja/docs/creators/dapps/index.md new file mode 100644 index 000000000..5dd23b5dc --- /dev/null +++ b/src/pages/ja/docs/creators/dapps/index.md @@ -0,0 +1,78 @@ +--- +description: Deploying long-running, decentralized services on Golem using no-code tools. +title: Deploying long-running, decentralized services on Golem using no-code tools. +type: Introduction +--- + +# Decentralized applications on Golem + +{% alert level="info" %} +Looking for a Quickstart? + + [See how easy it is to run an application on Golem](/docs/creators/dapps/run-a-dapp) + +{% /alert %} + +## Introduction + +Golem is a network which enables its participants to make computing resources available for use by those who wish to use them. From the perspective of requestors, among other uses, it allows services to be requested, deployed, and run on the network’s providers. + +The dApps on Golem project is a solution to deploy multi-layer apps on the Golem Network, without a need to dive into the APIs. Instead, the structure of the application is stored in YAML files, so the process may feel familiar for those of you who have some experience with e.g. docker-compose. + +By a **dApp** - or a decentralized application in the context of Golem - we understand such a combination of services and additional resources within the network, that together constitutes a full application, e.g. a website or a public API, running entirely on the Golem Network. + +Such services or decentralized applications can be run by virtually anyone as long as they have some GLM tokens to pay the providers for their work. + +{% alert level="danger" %} + +Please be aware that the dApps on Golem project is still in early access and should be considered experimental. Please [reach out to us on our community Discord](https://chat.golem.network/) if you'd like to help us improve these tools. + +{% /alert %} + +## Available experiments + +While working with dApps, we created a few applications on top of it, which served us both as a testing ground and as a way to validate our approach. On the other hand, they were also designed to give you, first, a good starting point, and later, a reference, when developing your own, similar apps. + +### ToDo List Application + +![ToDo List App](https://user-images.githubusercontent.com/33448819/223681578-03193431-ed28-46e7-9faf-00bc0ea00613.png) + +This [application](https://github.com/golemfactory/dapp-experiments/tree/main/01_todo_app) showcases utilizing the Golem Network to host a 3-layer application (**React** + **Flask** + **RQLite**) + +### Weather Stats Application + +![Weather Stats App](/weather-stats.png) + +This [application](https://github.com/golemfactory/dapp-experiments/tree/main/02_weather_stats) presents usage of the Golem Network with access to external services (not hosted on Golem) taking advantage of the outbound network connections. + +## Components + +### Golem Services + +Golem **Service model** describes a way to run specific Golem payloads and defines operations that need to be applied on state transitions throughout their lifetime. + +The payloads are the definitions of activities that a requestor wishes to be executed on Golem along with a complete set of parameters needed to initialize those activities. Those parameters can specify, e.g. what runtime and which container image to use or what the CPU or memory specifications are required by the payload. + +An example of such a service could be e.g. a web server that is to be deployed using Golem’s VM runtime with a VM image containing an HTTP service, using a specific initialization script, exposed to the outside world using a specific gateway. + +### Golem Deploy model + +Building upon the foundations of Golem’s Service model, the Golem Deploy model provides a way to describe sets of services that constitute full, multi-layered applications using declarative definitions, which require no programming knowledge and no code to be written. + +Instead, those definitions are constructed using a simple, hierarchical structure expressed as e.g. a YAML file, similar to those used by tools that allow such sets to be deployed either locally or on common cloud providers, e.g. `docker-compose` or `terraform`. + +The model and the schema used are documented in: + +[See GAP-16 on GitHub](https://github.com/golemfactory/golem-architecture/blob/master/gaps/gap-16_golem_deploy/gap-16_golem_deploy.md) + +### Dapp-runner + +Dapp-runner is an initial, reference implementation that allows applications defined as Golem dApps to be deployed and maintained on the Golem Network. It takes one or more application descriptors expressed as YAML files, constructs the desired dApp model for such an application, and executes all operations needed for the services constituting the app to be successfully deployed on Golem. + +[See dapp-runner on GitHub](https://github.com/golemfactory/dapp-runner/) + +### Dapp-manager + +Dapp-manager is a simple CLI tool used to manage and run several separate instances of the `dapp-runner`. So, whereas `dapp-runner` ’s sole responsibility is deployment of a single application, `dapp-manager` can facilitate running several applications while easily monitoring their states using a simple command-line interface. + +[See dapp-manager on GitHub](https://github.com/golemfactory/dapp-manager/) diff --git a/src/pages/ja/docs/creators/dapps/managing-multiple-dapps.md b/src/pages/ja/docs/creators/dapps/managing-multiple-dapps.md new file mode 100644 index 000000000..3409e60da --- /dev/null +++ b/src/pages/ja/docs/creators/dapps/managing-multiple-dapps.md @@ -0,0 +1,301 @@ +--- +description: Manage multiple apps on a single requestor node easily with `dapp-manager`. +title: Managing multiple apps on a single requestor node. +type: Guide +--- + +# dApp Manager + +`dapp-manager` is a purposefully minimalistic manager for decentralized applications running on +Golem. It works together with the [dapp-runner](/docs/creators/dapps/run-a-dapp). + +While the responsibility of the latter is to run a single Golem application (which may consist of multiple services), `dapp-manager` takes care of spawning, interacting with, and stopping the running instances of the `dapp-runner`. + +## Prerequisites + +Ensure you have `curl` available on your system. + +```shell +curl --version +``` + +If not, please install it using the instructions appropriate for your system from [here](https://curl.se/download.html). + +You should have `python` and `pip` installed. + +## Quick start + +### Yagna service + +As the `dapp-manager` uses the `dapp-runner`, which in turn requires a properly configured +[yagna](https://github.com/golemfactory/yagna) service, you'll need to have it set up. + +Please follow the [Yagna installation instruction](/docs/creators/tools/yagna/yagna-installation-for-requestors) tutorial and ensure that your `yagna` is up and running. + +{% alert level="info" %} +Instead of using the autoconfigured app-key of `try_golem` in this tutorial, we will use a unique 32-char app-key. + +{% /alert %} + +Query `yagna` with: + +```bash +yagna app-key list +``` + +If the above command doesn't give you any 32-char keys, just create your app key: + +```bash +yagna app-key create requestor +``` + +and copy the value output by this command. + +Set the `YAGNA_APPKEY` in your environment, e.g. with: + +{% tabs %} + +{% tab label="Linux / MacOS" %} + +```bash +export YAGNA_APPKEY=insert-your-32-char-app-key-here +``` + +{% /tab %} +{% tab label="Windows" %} + +```bash +set YAGNA_APPKEY=insert-your-32-char-app-key-here +``` + +{% /tab %} +{% /tabs %} + +### Python environment + +First, ensure you have Python 3.8 or later: + +{% tabs %} + +{% tab label="Linux / MacOS" %} + +```bash +python3 --version +``` + +{% /tab %} +{% tab label="Windows" %} + +```bash +python --version +``` + +{% /tab %} +{% /tabs %} + +If your Python version is older, consider using [pyenv](https://github.com/pyenv/pyenv-installer) to install and use multiple versions.. + +Once your python interpreter reports a version 3.8 or later, you can set up your virtual +environment: + +{% tabs %} + +{% tab label="Linux / MacOS" %} + +```bash +python3 -m venv ~/.envs/dapp-manager +source ~/.envs/dapp-manager/bin/activate +``` + +{% /tab %} +{% tab label="Windows" %} + +```shell +python -m venv --clear %HOMEDRIVE%%HOMEPATH%\.envs\dapp-manager +%HOMEDRIVE%%HOMEPATH%\.envs\dapp-manager\Scripts\activate.bat +``` + +{% /tab %} +{% /tabs %} + +### dApp manager + +Install `dapp-manager` with a simple: + +```bash +pip install dapp-manager +``` + +## Run an example application + +### Get the sample app + +``` +curl https://raw.githubusercontent.com/golemfactory/dapp-store/81e3f50aba90a84d335a26cb9cc2ea778193be11/apps/todo-app.yaml > app.yaml +``` + +### And the default config file + +``` +curl https://raw.githubusercontent.com/golemfactory/dapp-runner/main/configs/default.yaml > config.yaml +``` + +```bash +dapp-manager start --config config.yaml app.yaml +``` + +The app is started in a background `dapp-runner` process, and you're returned an application ID in +the form of a hexadecimal string. You can use this ID to query the state and other output streams +using `dapp-manager`'s `read` command. + +Most importantly, you may query the `data` stream with: + +```bash +dapp-manager read --follow data +``` + +waiting for the following line: + +```shell +{"web": {"local_proxy_address": "http://localhost:8080"}} +``` + +{% alert level="info" %} + + Your port number (`8080` above) may be different. + +{% /alert %} + +Once you get it, you can access the launched app by following that link. + +In case something goes amiss, `dapp-manager` will output: +`App is not running.` + +Whatever the reason, you can still query the various streams of a terminated dapp by adding the +`--no-ensure-alive` option, e.g.: + +```bash +dapp-manager read --no-ensure-alive stderr +``` + +## Full usage + +```shell +Usage: dapp-manager [OPTIONS] COMMAND [ARGS]... + +Options: + --help Show this message and exit. + +Commands: + autocomplete Enable CLI shell completion for the given shell. + kill Stop the given app forcibly. + list List known app IDs (both active and dead). + prune Remove data for non-running apps. + read Read output from the given app. + start Start a new app using the provided descriptor and config... + stop Stop the given app gracefully. +``` + +### Start + +The `start` command launches a new instance of the `dapp-runner` in a background process and +returns the hexadecimal string that is the identifier of the running `dapp-runner` instance. + +```shell +Usage: dapp-manager start [OPTIONS] DESCRIPTORS... + + Start a new app using the provided descriptor and config files. + +Options: + -c, --config PATH Path to the file containing yagna-specific config. + [required] + --help Show this message and exit. +``` + +Importantly, it requires a config file which contains the parameters used to connect to the `yagna` +service and initialize the requestor engine. + +Of course, it also requires one or more descriptor files that are used by the `dapp-runner` to +deploy the specified applications on Golem. + +### Stop / Kill + +The `stop` and `kill` commands terminate the given `dapp-runner` instance, the main difference +being the signal that's sent to do that. Essentially, `stop` should be enough and should give the +`dapp-runner` a chance to shut the app down gracefully, correctly terminating the services, +closing the agreements, and paying for them. + +In case `stop` is stuck for whatever reason, you might want to resort to `kill` which terminates +the `dapp-runner` immediately without allowing for any graceful shutdown. + +### List + +The `list` command shows the identifiers of all the previously-started apps, whether they're still +running or not. + +### Prune + +`prune` causes `dapp-manager` to remove the data for those apps that it had previously identified as +defunct. Consequently, those apps will no longer appear on the list. + +Unless an app has been explicitly stopped with a `stop` or `kill` command, the `dapp-manager` +will not purge it until it has had a chance to notice the termination, e.g. by issuing a `read` +command to the defunct app. + +### Read + +The `read` command outputs the full contents of the specified stream. There are five streams as +specified by the usage below: + +```shell +Usage: dapp-manager read [OPTIONS] APP_ID [state|data|log|stdout|stderr] + + Read output from the given app. + +Options: + --ensure-alive / --no-ensure-alive + -f, --follow + --help Show this message and exit. +``` + +By default, the stream will only be output if the app is currently running. Otherwise, you'll get +the `App is not running.` message and no stream. + +If you wish to query a stream of a terminated app, add the `--no-ensure-alive` parameter to the +specific `read` command. + +### Shell completion + +This program supports shell completion for all of its commands, as well as existing dApp IDs (where applicable). + +To enable completion, use the `autocomplete` command with your shell of choice: + +- **bash**: + + ```bash + dapp-manager autocomplete bash + ``` + +- **zsh**: + + ```bash + dapp-manager autocomplete zsh + ``` + +- **fish**: + + ```bash + dapp-manager autocomplete fish + ``` + +The completion functions are defined in `dapp_manager/autocomplete/scripts`. + +Should the entrypoint name ever change, those files will need to be updated as well. + +{% alert level="warning" %} + +Completion will **NOT WORK** when the program is invoked with `python -m dapp_manager`. + +Only the installed entrypoint (i.e. `dapp-manager`) is supported. +To have it available, run `poetry install` when using the source version of `dapp-manager`. +{% /alert %} diff --git a/src/pages/ja/docs/creators/dapps/run-a-dapp.md b/src/pages/ja/docs/creators/dapps/run-a-dapp.md new file mode 100644 index 000000000..2e3da57a5 --- /dev/null +++ b/src/pages/ja/docs/creators/dapps/run-a-dapp.md @@ -0,0 +1,9 @@ +--- +description: Quick start to running your first decentralized application on Golem +title: Quickstart to running your first decentralized application +type: Quickstart +--- + +# No-code Quickstart + +{% partial file="quickstarts/no-code-app-deployment.md" /%} diff --git a/src/pages/ja/docs/creators/index.md b/src/pages/ja/docs/creators/index.md new file mode 100644 index 000000000..8566aa49c --- /dev/null +++ b/src/pages/ja/docs/creators/index.md @@ -0,0 +1,69 @@ +--- +title: Golem Docs | How do you want to create? +pageTitle: Golem Docs | How do you want to create? +description: Dive into Golem's comprehensive software documentation for creators. Whether you're working with JS or prefer a no-code approach, our in-depth user guides provide all the information you need to streamline your development process. +type: noicon +--- + +# Welcome to Golem: Power Your Creations + +The Golem Network is place where your innovative ideas transform into reality. Here, you'll harness the collective power of global computing resources. + +## How do you want to create? + +{% marginbottom amount="4" %} +{% /marginbottom %} + +{% grid %} + +{% selectioncard icon="javascript" title="JS SDK" buttonText="Read JS Docs" href="/docs/creators/javascript" %} + +{% /selectioncard %} + +{% selectioncard icon="ray" title="Python with Ray on Golem" buttonText="Read Ray on Golem Docs" href="/docs/creators/ray" %} + +{% /selectioncard %} + +{% selectioncard icon="python" title="No-code Deployment" buttonText="Read no-code Docs" href="/docs/creators/dapps" %} + +{% /selectioncontent %} + +{% /selectioncard %} + +{% selectioncard icon="python" title="Python SDK" buttonText="Read Python Docs" href="/docs/creators/python" %} + +{% /selectioncard %} + +{% /grid %} + +{% marginbottom amount="8" %} +{% /marginbottom %} + +--- + +## How to Acquire GLM + +To bring your creations to life on the Golem Network, you'll need some GLM tokens. These tokens are the backbone of our ecosystem, allowing you to utilize and contribute to the computing power shared across the network. You can obtain our tokens in several ways: + +- **Test Network for Developers**: Specifically designed for new participants in the Golem network and developers experimenting with their projects, this test network introduces "tGLM," a testnet token. tGLM is a simulated version of the Golem token (GLM) used exclusively within the Golem testnet. It's important to note that tGLM holds no real-world value, serving solely for development and testing purposes within the Golem Network. +- **Onboarding Portal**: Visit our [onboarding portal](https://glm.golem.network/) for a guided experience in purchasing GLM tokens. +- **Cryptocurrency Exchanges**: GLM is available on several leading exchanges. Here are the links to these platforms: + - [Binance](https://www.binance.com/) + - [Coinbase](https://www.coinbase.com/) + - [Crypto.com](https://crypto.com/) + - [OKX](https://www.okx.com/) + - [Gate.io](https://www.gate.io/) + - [KuCoin](https://www.kucoin.com/) + - [HTX](https://www.htx.com/) + - [Bithumb](https://www.bithumb.com/) + - For those preferring decentralized exchanges, GLM can also be found on: + - [Uniswap](https://uniswap.org/) + - [Quick Swap](https://quickswap.exchange/) + +--- + +## Get inspired + +Dive into real-world applications and discover how Golem's versatile platform can empower your development journey. Our examples span various use cases, illustrating the flexibility and power of Golem in different scenarios + +Visit the [Awesome Golem repository](https://github.com/golemfactory/awesome-golem) to see a range of projects that bring these capabilities to life. diff --git a/src/pages/ja/docs/creators/javascript/examples/accessing-internet.md b/src/pages/ja/docs/creators/javascript/examples/accessing-internet.md new file mode 100644 index 000000000..ead892e7c --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/accessing-internet.md @@ -0,0 +1,140 @@ +--- +title: Golem JS Task API - Internet Access +description: Learn to access the internet using Golem's JS Task API. Discusses the Outbound feature and includes steps for manifest creation, demand definition, and running Node.js examples. +pageTitle: Utilize Golem's JS Task API for Internet Connectivity - Complete Guide +type: Example +--- + +# JS Task API Examples: accessing the internet + +## Introduction + +In this article, we will present methods that let you access the Internet. + +**Outbound feature** + +For the requestor to be able to use the outbound feature, (initiate a connection to `target_url`), the following minimal conditions must be met: + +- The requestor must request the outbound feature in the demand and include a Computation Manifest there. The manifest must declare the `target_url`. +- The provider offers the service at least for the `target_url`. (So either outbound for unrestricted URLs or the `target_url` is included in the whitelist). + +You can find more information about the feature and the manifest in the following articles: [Accessing the Internet](/docs/creators/javascript/guides/accessing-internet) and [Payload Manifest](/docs/golem/payload-manifest). + +The requestor is responsible for: + +- Manifest creation +- Defining demand for outbound access + +Both examples are accessing urls included in the default whitelist. Click [here](https://github.com/golemfactory/ya-installer-resources/tree/main/whitelist) to view the whitelist. + + + + +## Prerequisites + +Yagna service is installed and running with `try_golem` app-key configured. + +### How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +Next, install `Golem SDK CLI` - a companion tool that will facilitate manifest creation. + +```shell +npm install -g @golem-sdk/cli +``` + +To run the examples provided below, copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +## Basic outbound access + +In this example we will download a file from `ipfs.io`. This is one of the domains included in the whitelist. + +### Manifest creation + +To create a new manifest run: + +```bash +golem-sdk manifest create golem/examples-outbound:latest +``` + +This will create a basic `manifest.json` file. You will use it to inform the provider what GVMI image we will be using. The manifest contains also your application version, application name, and description, all read from your `package.json` file (you can edit this information if you want). + +#### Adding outbound configuration + +The next step is to configure our manifest, so you can access a public URL. The CLI also has a handy command that will take care of that for you: + +```bash +golem-sdk manifest net add-outbound https://ipfs.io +``` + +This has added 'https://ipfs.io' as the URL you want to access from the provider node. The command can be run multiple times to add more URLs or you can pass them all at once. + +Your manifest is ready and stored in the `manifest.json` file. + +### Defining demand for outbound access + +The example below demonstrates how to define the demand that will get access to the Internet. + +Here's the manifest + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/beta/examples/docs-examples/examples/outbound/manifest.json" language="javascript" /%} + +And the requestor code: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/beta/examples/docs-examples/examples/outbound/outbound-basic.mjs" language="javascript" /%} + +Note the most important part: + +```javascript +// Load the manifest file. +const manifest = await readFile(`./manifest.json`) + +// Create and configure a TaskExecutor instance. +const executor = await TaskExecutor.create({ + capabilities: ['inet', 'manifest-support'], + yagnaOptions: { apiKey: 'try_golem' }, + manifest: manifest.toString('base64'), +}) +``` + +First, it is specifying additional requirements to the demand: + +- 'inet' - indicates the script requires outbound service +- 'manifest-support' - indicates, requestor uses a manifest to specify a demand. + +Instead of providing an image tag or hash, it uses a manifest file that describes what will be run on providers. + +Please note the loaded manifest is encoded to base64. + +`yagnaOptions: { apiKey: 'try_golem' }` - defined the api key, to get access to the Yagna service. This particular key is available if you start the yagna according to the procedure provided in the installation example, you can also configure your own unique keys. See [here](/docs/creators/javascript/examples/using-app-keys) for instructions. + +Then you can use the applications that connects to the target `url` specified in the manifest in the standard way: + +```javascript +const result = await ctx.run(`curl ${url} -o /golem/work/example.jpg`) +``` + +## Using outbound to install node.js packages + +Note: This example shows how to use the outbound whitelist to install a npm package on a provider. It is recommended to install additional packages in a directory that is defined as `VOLUME` in the image definition, to avoid filesystem capacity limits. +If you have a large number of packages you should rather install them during the image build phase - you will avoid installing them on each provider separately and get your providers ready in a shorter time. + +Here's the manifest: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/beta/examples/docs-examples/examples/outbound/manifest_npm_install.json" language="javascript" /%} + +And the requestor code: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/beta/examples/docs-examples/examples/outbound/npm-install.mjs" language="javascript" /%} \ No newline at end of file diff --git a/src/pages/ja/docs/creators/javascript/examples/composing-tasks.md b/src/pages/ja/docs/creators/javascript/examples/composing-tasks.md new file mode 100644 index 000000000..14850624c --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/composing-tasks.md @@ -0,0 +1,146 @@ +--- +description: Learn to compose tasks using JS Task API, featuring methods for sequential and batch command execution with practical examples. +title: Composing Tasks - Examples and Methods +pageTitle: Master Task Composition with JS Task API - Sequential & Batch Command Execution +type: Example +--- + +# JS Task API Examples: composing tasks + +## Introduction + +Task Executor methods take a task function as a parameter for each of its methods. +This function is asynchronous and provides access to the WorkContext object, which is provided as one of its parameters. + +A task function may be very simple, consisting of a single command, or it may consist of a set of steps that include running commands or sending data to and from providers. + +Commands can be run in sequence or can be chained in batches. Depending on how you define your batch, you can obtain results of different types. + +The following commands are currently available: + +| Command | Available in node.js | Available in web browser | +| ---------------- | :------------------: | :----------------------: | +| `run()` | yes | yes | +| `runAndStream()` | yes | yes | +| `uploadFile()` | yes | no | +| `uploadJson()` | yes | yes | +| `downloadFile()` | yes | no | +| `uploadData()` | yes | yes | +| `downloadData()` | no | yes | +| `downloadJson()` | no | yes | + +{% alert level="info" %} +This article focuses on the `run()`, `runAndStream()` commands and chaining commands using the `beginBatch()` method. Examples for the `uploadFile()`, `uploadJSON()`, `downloadFile()` commands can be found in the [Sending Data](/docs/creators/javascript/examples/transferring-data) article. +{% /alert %} + +We'll start with a simple example featuring a single `run()` command. Then, we'll focus on organizing a more complex task that requires a series of steps: + +- send a `worker.js` script to the provider (this is a simple script that prints "Good morning Golem!" in the terminal), +- run the `worker.js` on a provider and save the output to a file (output.txt) and finally +- download the `output.txt` file back to your computer. + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +Copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +Some of the examples require a simple `worker.mjs` script that can be created with the following command: + +```bash +echo console.log("Hello Golem World!"); > worker.mjs +``` + +### Running a single command + +Below is an example of a simple script that remotely executes `node -v`. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/composing-tasks/single-command.mjs" language="javascript" /%} + +Note that `ctx.run()` accepts a string as an argument. This string is a command invocation, executed exactly as one would do in the console. The command will be run in the folder defined by the `WORKDIR` entry in your image definition. + +### Running multiple commands (prosaic way) + +Your task function can consist of multiple steps, all run on the `ctx` context. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/composing-tasks/multiple-run-prosaic.mjs" language="javascript" /%} + +To ensure the proper sequence of execution, all calls must be awaited. We only handle the result of the second `run()` and ignore the others. + +{% alert level="info" %} +If you use this approach, each command is sent separately to the provider and then executed. +{% /alert %} + +![Multiple Commands output log](/command_prosaic_log.png) + +### Organizing commands into batches + +Now, let's take a look at how you can arrange multiple commands into batches. +Depending on how you finalize your batch, you will obtain either: + +- an array of result objects or +- ReadableStream + +### Organizing commands into a batch resulting in an array of Promise results + +Use the beginBatch() method and chain commands followed by `.end()`. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/composing-tasks/batch-end.mjs" language="javascript" /%} + +All commands after `.beginBatch()` are run in a sequence. The chain is terminated with `.end()`. The output is a Promise of an array of result objects. They are stored at indices according to their position in the command chain (the first command after `beginBatch()` has an index of 0). + +The output of the 3rd command, `run('cat /golem/input/output.txt')`, is under the index of 2. + +![Commands batch end output logs](/batch_end_log.png) + +### Organizing commands into a batch producing a Readable stream + +To produce a Readable Stream, use the `beginBatch()` method and chain commands, followed by `endStream()`. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/composing-tasks/batch-endstream-chunks.mjs" language="javascript" /%} + +Note that in this case, as the chain ends with ` .endStream()`, we can read data chunks from ReadableStream, denoted as `res`. + +Once the stream is closed, we can terminate our TaskExecutor instance. + +![Commands batch endstream output logs](/batch_endsteram_log.png) + +{% alert level="info" %} + +Since closing the chain with `.endStream()` produces ReadableStream, you can also synchronously retrieve the results: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/composing-tasks/alert-code.mjs" language="javascript" /%} + +{% /alert %} + +### Running commands and collecting output as a stream + +Here are two examples of how to run a command and collect its output as a stream. + +#### Basic runAndStream scenario + +In the first example, we run a command that produces both stdout and stderr outputs that we pass to the console. This command will terminate on its own after ten cycles. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/beta/examples/docs-examples/examples/composing-tasks/streams/stream-onclose.mjs" language="javascript" /%} + +#### runAndStream scenario with timeout defined + +In this example, we show how to use `remoteProcess.waitForExit()` to terminate the process. Note that in the current implementation, the exit caused by timeout will terminate the activity on a provider, therefore the user cannot run another command on the provider. The task executor will instead run the next task on another provider. + + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/beta/examples/docs-examples/examples/composing-tasks/streams/stream-waitforexit.mjs" language="javascript" /%} diff --git a/src/pages/ja/docs/creators/javascript/examples/executing-tasks.md b/src/pages/ja/docs/creators/javascript/examples/executing-tasks.md new file mode 100644 index 000000000..49c162b61 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/executing-tasks.md @@ -0,0 +1,129 @@ +--- +title: Executing Tasks - Examples and Methods +pageTitle: Executing Tasks with Golem's JavaScript API +description: Discover how to execute tasks on Golem JS API with practical examples. Learn to run tasks in parallel, initialize providers, and handle single task executions efficiently. Ideal for Node.js developers using Golem network. + +type: Example +--- + +# JS Task API Examples: executing tasks + +## Introduction + +With Golem JS Task API you can execute just a single task on a single provider or a series of multiple tasks in parallel on many providers. In the case of the latter, you can additionally define how providers should be initialized and how many tasks you want to run simultaneously. + +In this article, the following examples are presented: + +- Running tasks in parallel +- Defining the number of providers working in parallel +- Initializing providers +- Running a single task + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm install @golem-sdk/task-executor +``` + +Copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +## Running tasks in parallel + +If you want to run your tasks in parallel, you can call `.run()` multiple times on the same `TaskExecutor` object. The maximum number of concurrently engaged providers is defined by the `maxParallelTasks` parameter. Providers can be engaged more than once until all tasks are executed. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/executing-tasks/map.mjs" language="javascript" /%} + +{% alert level="warning" %} + +Note that we utilize the `Promise.all()` method to process outputs from `futureResults` which is an iterable of promises. While this approach allowed us to keep the snippet short and simple, there is a pitfall with such an approach. This method rejects when any of the input's promises are rejected, so if any of the tasks fail (after retries) user will not get _any_ results at all. To avoid such a scenario use `Promise.allSettled()` instead. + +{% /alert %} + +In the example, we have an array of 5 elements `[1, 2, 3, 4, 5]` and we `map` over each value to define a separate step for each element in the array. Each step is a command that prints the value of the element to the console. + +![Multiple run map](/map_log.png) + +In the output logs, you can have some interesting observations: + +The provider `sharkoon_379_6` was engaged first. When he had finished his first task he was still the only available provider and he received another task to execute. In the meantime, other providers were successfully engaged and the next tasks were dispatched to them. + +Note that even though provider `sharkoon_379_8` was engaged before provider `10hx4r2_2.h`, the latter completed its task before the former. In the network, different nodes offer varying performance. + +## Defining the number of providers used + +You can set the maximum number of providers to be engaged at the same time. The TaskExecutor will scan available proposals and engage additional providers if the number of actually engaged providers is lower than `maxParallelTasks` and there are still some tasks to be executed. +If you do not define this parameter, a default value of 5 will be used. + +Note that the actual number of engaged providers might be: + +- lower than `maxParallelTasks`, if there are not enough providers available in the network. +- higher, when considering the total number of engaged providers for all the tasks in your job. Providers might get disconnected or simply fail, in which case the TaskExecutor will engage another one to maintain the number of active workers at the level defined by `maxParallelTasks`. + +Below, you can see how to define the maximum number of providers to be engaged. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/executing-tasks/max-parallel-tasks.mjs" language="javascript" /%} + +## Initialization tasks + +Normally, when a larger job is divided into smaller tasks to be run in parallel on a limited number of providers, these providers might be utilized for more than one task. In such cases, each task is executed in the same environment as the previous task run on that provider. To optimize performance, you might decide that some initialization tasks need only be run once per provider. This can be particularly useful if you have to send a large amount of data to the provider. + +This example requires an `action_log.txt` file that can be created with the following command: + +```bash +echo Action log: > action_log.txt +``` + +You can address such a need using the `onActivityReady()` method of the TaskExecutor. Here is an example: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/executing-tasks/on-activity-ready.mjs" language="javascript" /%} + +In the code, we decreased the `maxParallelTasks` value from the default value of 5, to make sure that some of our five tasks will be run on the same provider. + +The `onActivityReady()` method is used to upload a file to a remote computer that will be used to log all future activity run on this provider. The code used in the `onActivityReady()` method contains an additional `console.log` to demonstrate that even if the whole job consists of five tasks, the task function used in `onActivityReady()` will be executed only once per provider. (Unless the provider disengages and is engaged again - in such a situation, its virtual machine would be created anew, and we would upload the file again there). + +Note how we utilized the `ctx` worker context to get the provider name using the `provider.name` property. + +Inside each task function we employed the `beginBatch()` to chain multiple commands - you can see more about this feature in the [Defining Tasks](/docs/creators/javascript/examples/composing-tasks) article. + +![OnActivityReady](/onactivityready.png) + +The log from this example shows that even if the provider `imapp1019_0.h` was eventually +used to execute 4 tasks, it uploaded the log only once. Its output file - downloaded after the last task was executed - contained the following: + +``` +some action log +processing item: 3 +processing item: 4 +processing item: 5 +``` + +This log once again illustrates that providers offer different performance levels. Even though `SBG5-1.h` and `WAW1-16.h` signed agreements before Task 3 was computed on `imapp1019_0.h`, this provider managed to complete task 3, 4 and 5 before the others downloaded the `action_log` file and completed their first task. + +## Single run + +Sometimes you don't need to run tasks in parallel and a single run is sufficient. In such cases, you can use the `run()` method as demonstrated in the example below. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/executing-tasks/single-run.mjs" language="javascript" /%} + +The requestor script runs a single task defined by a task function: `ctx.run("node -v")`. The output of the command is available through `stdout` of the `result` object returned from the `ctx.run()` function: + +Below, you can see the script logs: + +![Single run](/run_log.png 'Requestor script output logs') + +In the logs, we can see that the requestor uses the Holesky network for payments (a test network). The task was executed once on a single provider. + +In the table, we see a summary of the costs (paid here in test GLM), along with the result of the command which outputs the version of the node in the image deployed on the provider. diff --git a/src/pages/ja/docs/creators/javascript/examples/index.md b/src/pages/ja/docs/creators/javascript/examples/index.md new file mode 100644 index 000000000..146eb4c80 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/index.md @@ -0,0 +1,34 @@ +--- +description: Comprehensive list of JavaScript code examples for Golem Network tasks, data transfer, provider selection, and more. +title: JavaScript Code Examples for Golem Network +pageTitle: In-Depth JavaScript Examples for Efficient Golem Network Usage +type: Table of Contents +--- + +JS code examples are organized in articles dedicated to specific topics: + +| Topic | Content | +| :------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------- | +| [Executing tasks](/docs/creators/javascript/examples/executing-tasks) | Illustrate how to execute tasks in parallel on the Golem Network, how to initialize providers, and how to run a single task. | +| [Defining tasks](/docs/creators/javascript/examples/composing-tasks) | Shows how to build tasks from commands, especially how commands can be chained. | +| [Sending data](/docs/creators/javascript/examples/transferring-data) | Shows how to use specific commands dedicated to sending data in the network. | +| [Working with results](/docs/creators/javascript/examples/working-with-results) | Presents the structure of the results depending on the way tasks are defined and explains how to handle failures. | +| [Selecting providers](/docs/creators/javascript/examples/selecting-providers) | Shows how to select providers based on filters, whitelists or blacklists. | +| [Using images](/docs/creators/javascript/examples/working-with-images) | Shows how you can define your custom image. | +| [Accessing the Internet](/docs/creators/javascript/examples/accessing-internet) | Instructions on how to prepare a manifest and specify a demand, so you can reach the internet from the provider node. | +| [Using app-keys](/docs/creators/javascript/examples/using-app-keys) | Shows how to create and use a unique app-key to manage access to Yagna. | +| [Switching to mainnet](/docs/creators/javascript/examples/switching-to-mainnet) | Instructions that will help you run your app on mainnet. | + +Instructions on how to use Golem tools are available here: + +| Topic | Content | +| :------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | +| [Yagna installation for requestors](/docs/creators/tools/yagna/yagna-installation-for-requestors) | Simple instructions on how to install Yagna service and become part of the Golem Network. | +| [Yagna uninstallation for requestors](/docs/creators/tools/yagna/requestor-uninstallation) | Simple instructions on how to uninstall Yagna service. | +| [Managing Golem wallet](/docs/creators/tools/yagna/managing-golem-wallet) | Instructions on how to check your wallet address, monitor status, enable payments on the main network, and obtain test tokens. | +| [Golem wallet backup](/docs/creators/tools/yagna/golem-wallet-backup) | Procedure for how to backup and secure your Golem wallet. | +| [Restoring Golem wallet](/docs/creators/tools/yagna/restoring-golem-wallet) | Procedure for how to restore your wallet after new Yagna installation. | +| [Yagna mostly used commands](/docs/creators/tools/yagna/yagna-mostly-used-commands) | Instructions on how to use most frquently used yagna commands for developers. | +| [Gvmkit-build installation (image conversion tool)](/docs/creators/tools/gvmkit/gvmkit-build-installation) | How to install the tool that can convert Docker image into Golem format (+ instructions on how to run it without installation). | +| [Converting Docker image to Golem format](/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format) | Instructions on how to convert Docker image into Golem format. | +| [Publishing custom images](/docs/creators/tools/gvmkit/publishing-custom-images) | Information on how to make your image available for providers: both "hash" and "tag" naming conventions covered. | diff --git a/src/pages/ja/docs/creators/javascript/examples/selecting-providers.md b/src/pages/ja/docs/creators/javascript/examples/selecting-providers.md new file mode 100644 index 000000000..85b959e29 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/selecting-providers.md @@ -0,0 +1,101 @@ +--- +title: JS Task API - Provider Selection Example +pageTitle: Provider Selection in Golem JS Task API - Best Practices and Examples +description: Learn to select providers in Golem's JS Task API with criteria like hardware requirements, whitelist/blacklist, and cost-effective filters, including practical Node.js examples. +type: Example +--- + +# JS Task API Examples: selecting providers + +## Introduction + +You can select providers using different criteria, i.e. defining requirements in a demand or applying filters on providers' proposals. You can: + +- Select a provider based on minimal requirements for remote computer + CPU, disk storage, RAM. +- Select a provider based on the whitelist/blacklist. +- Select a provider based on the proposed costs using a custom filter. + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm install @golem-sdk/task-executor +``` + +Copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +## Filtering providers based on minimal requirements: + +You can define minimal requirements for an environment provided by a node by stating a minimal number of: + +- CPU cores `minCpuCores`, +- RAM `minMemGib`, +- disk space `minStorageGib` or +- CPU threads `minCpuThreads`. + +You can do this in the TaskExecutor options: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/selecting-providers/demand.mjs" language="javascript" /%} + +{% alert level="warning" %} +Be careful, filtering is done internally by Yagna and if your requirements turn out to be too demanding you will not receive any proposals from providers and your requestor script will terminate after the timeout. +{% /alert %} + +![Job timeout log](/timeout_log.png) + +## Selecting providers based on the whitelist + +In some situations, you might need your tasks to be executed on a certain provider or exclude specific providers. If you know providers' IDs or names you can use the `proposalFilter` option and use one of the predefined filters: + +- `ProposalFilters.whiteListProposalIdsFilter()`, +- `ProposalFilters.blackListProposalIdsFilter()`, +- `ProposalFilters.whiteListProposalNamesFilter()`. +- `ProposalFilters.blackListProposalNamesFilter()` + +All these filters will accept an array with IDs, or names of the providers, which should be accepted or excluded. + +{% alert level="info" %} + +For this example, you might need to update the provider's list in the `whiteListsIds`. +Go to the [Golem Network Stats](https://stats.golem.network/network/providers/online) and scroll the list to find a provider working on `Testnet`. Then click on its name and copy its ID. + +{% /alert %} + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/selecting-providers/whitelist.mjs" language="javascript" /%} + +{% alert level="info" %} +You can read provider names from `ctx` workContext or from the proposal. We will look into proposals in the next section. +{% /alert %} + +## Selecting providers based on the proposed costs using a custom filter + +In this example, we will show a custom filter that can be used to select the best provider. We will use it to filter based on the price, but it can be used to filter by any other attribute that is included in the provider proposals or even scan the market to see what is proposed. + +The whole process begins with requestor demand. The network will respond with proposals from active providers. Proposals are then negotiated until an agreement is reached. Once the requestor and provider sign the agreement, activity can be started and TaskExecutor can execute them. + +Let's see how to use it: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/selecting-providers/custom-price.mjs" language="javascript" /%} + +Note that `customFilter` is a function that accepts a `proposal` object as its parameter and should return `true` or `false` depending on the decision based on the proposal properties. + +Our custom function collects pricing data until we have a set of 5 proposals. Then it accepts proposals only if the price is lower than average from the last five proposals. + +Provider price is calculated as the product of prices defined per specific usage counter. + +The counters are defined in `golem.com.usage.vector` property and the prices are defined in `golem.com.pricing.model.linear.coeffs`. The last element in the price coeffs array is a fixed element of the total price (one can consider it the one-time price for deployment). + +Note that the sequence of the counters is not fixed, therefore we need to find the index of the specific counter. In our examples, we take into account only the price related to the usage of the total environment (as our example task has a very short execution time). diff --git a/src/pages/ja/docs/creators/javascript/examples/switching-to-mainnet.md b/src/pages/ja/docs/creators/javascript/examples/switching-to-mainnet.md new file mode 100644 index 000000000..2335e2c03 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/switching-to-mainnet.md @@ -0,0 +1,45 @@ +--- +title: JS Task API - Switching from Testnet to Mainnet in practical examples +description: Learn how to switch from testnet to mainnet for executing tasks on the Golem Network using the JS SDK, with a focus on requestors and the use of Polygon. +pageTitle: Transition to Golem Mainnet for Enhanced Task Execution - Best Practices and Examples +type: Example +--- + +# JS Task API Examples: switching to mainnet + +## Introduction + +This section is aimed mainly at **requestors** wishing to switch from running simple test tasks on our `testnet` to launching production payloads utilizing the vast number of providers on the `mainnet`. + +By default, the JS SDK will execute tasks on the `testnet`. It is a development network with a limited amount of providers and limited amounts of computational resources available. If you would rather need a larger amount of providers to compute on, you should switch to the mainnet. + +In this article, we will show how to run your tasks on Polygon. + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +Copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +## Running your tasks on the Polygon Network + +In this example, we create the TaskExecutor with additional parameters that indicate we intend to run our task on the Polygon platform. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/switching-to-mainnet/run-on-polygon.mjs" language="javascript" /%} + +In the script output, you can see that now the network is a `Polygon`. diff --git a/src/pages/ja/docs/creators/javascript/examples/transferring-data.md b/src/pages/ja/docs/creators/javascript/examples/transferring-data.md new file mode 100644 index 000000000..7f0c5270c --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/transferring-data.md @@ -0,0 +1,127 @@ +--- +title: JS Task API - Data Transfer Methods in Golem Network +description: Explore methods for file and JSON data transfer between providers and remote computers using the Golem Network's JS Task API, with practical examples and environment-specific commands. +pageTitle: Data Transfer Techniques in Golem Network - JS Task API Examples +type: Example +--- + +# JS Task API Examples: transferring data + +## Introduction + +In this article, we will present methods that let you send files to and from a provider as well as send JSON to a remote computer. + +{% alert level="warning" %} +Look at the table below to check what particular methods are available in each environment. +{% /alert %} + +The following commands are currently available: + +| Command | Available in node.js | Available in web browser | +| ---------------- | :------------------: | :----------------------: | +| `run()` | yes | yes | +| `uploadFile()` | yes | no | +| `uploadJson()` | yes | yes | +| `downloadFile()` | yes | no | +| `uploadData()` | yes | yes | +| `downloadData()` | no | yes | +| `downloadJson()` | no | yes | + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +To run the examples provided below, copy the code supplied there into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +## Uploading a file to the provider + +In this example, we calculate the `md5` hash of the example script `worker.mjs`, send it to a remote computer, and calculate the `md5` hash of the file in the remote location. Finally, we print both values for comparison. + +{% alert level="info" %} + +This example requires a simple `worker.mjs` script that can be created with the following command: + +```bash +echo console.log("Hello Golem World!"); > worker.mjs +``` + +{% /alert %} + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/transferring-data/upload-file.mjs" language="javascript" /%} + +![Uploadfile output log](/uplaodfile_log.png) + +## Downloading a file from the provider + +In this example, we create a file on a remote computer, list its content to a result object, and finally download it to compare its content with the result obtained remotely. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/transferring-data/download-file.mjs" language="javascript" /%} + +![Downloadfile output log](/downloadFile_log.png) + +## Uploading JSON to provider + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/transferring-data/upload-json.mjs" language="javascript" /%} + +![DownloadJSON output logs](/uploadJSON_log.png) + +## Uploading data to and from the provider (in a browser) + +In this example, we demonstrate how to use the `uploadData()` and `downloadData()` methods that allow you to send and receive data when you run your requestor script from a browser. The code below realizes the following job: let the user select an image file and a text, then send it to the provider where it utilizes ImageMagick to combine the image and text to create a meme. The result is displayed in the browser window. + +The example utilizes a basic HTML boilerplate that defines UI components: + +- a form to select the background image for the meme and user text. +- the `Generate meme` button to trigger the task +- the result frame where the output meme will be displayed +- log section - where the logs are displayed. + +{% alert level="warning" %} + +To run this example you must use Yagna version 0.13 or higher and run it using the `--api-allow-origin` parameter. +The example code should be saved as the `index.html` file and served by i.e. `http-server`. See [Web Quickstart](/docs/creators/javascript/quickstarts/golem-in-a-browser) for instructions. + +{% /alert %} + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/transferring-data/transfer-data-in-browser.html" language="javascript" /%} + +The `.uploadData(fileData, inputImage)` method is used to copy the user-provided data to the location defined by `inputImage`. The file is read from a disk by the `readFile()` function. + +The `.downloadData(outputImage)` method downloads the data which is accessible in the `data` attribute of the respective result object. The `setResponse()` function is used to update the `src` attribute of the dom element devised to display the output. + +Other functions are explained in the [Web Quickstart](/docs/creators/javascript/quickstarts/golem-in-a-browser) article. + +## Uploading JSON to and from the provider (in a browser) + +In this example, we demonstrate how to use the `uploadJson()` and `downloadJson()` methods that allow you to send and receive JSON data when you run your requestor script from a browser. The code below realizes the following job: let the user define the JSON object `{ "input": "Hello World" }`, then send it to the provider. On the remote computer, JSON is saved as `/golem/work/input.json`. Next the attribute `input` is replaced into `output` with `sed` command and saved as `/golem/work/output.json`. Finally, the file is downloaded with the `downloadJson()` method. The output of the command contains the JSON as `data` attribute. + +The example utilizes a basic HTML boilerplate that defines UI components: + +- the `Run` button to trigger the task +- the result frame where the content of output attribute of the JSON will be displayed +- log section - where the logs are displayed. + +{% alert level="warning" %} + +To run this example you must use Yagna version 0.13 or higher and run it using the `--api-allow-origin` parameter. See [Web Quickstart](/docs/creators/javascript/quickstarts/golem-in-a-browser) for instructions. + +{% /alert %} + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/transferring-data/upload-json-in-browser.html" language="javascript" /%} + +All other functions are explained in the [Web Quickstart](/docs/creators/javascript/quickstarts/golem-in-a-browser) article. diff --git a/src/pages/ja/docs/creators/javascript/examples/using-app-keys.md b/src/pages/ja/docs/creators/javascript/examples/using-app-keys.md new file mode 100644 index 000000000..08bc3576f --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/using-app-keys.md @@ -0,0 +1,120 @@ +--- +description: Guide on using app-keys with JS Task API in Yagna REST API, including creating, listing, and integrating unique keys for secure access. +title: Using app-keys +pageTitle: Secure Your Yagna REST API Access - JS Task API App-Key Integration Examples +type: Example +--- + +# JS Task API Examples: using app-keys + +## Introduction + +To use Yagna REST API, your application must identify itself by api-key. +In our examples we utilize the `try_golem` key, which is automatically created if you have the `YAGNA_AUTOCONF_APPKEY` variable set in the terminal where you start the Yagna service. + +The `try_golem` api-key is easy to read and remember, and useful for quickstarts and testing examples. However, normally you should rather use unique 32-char api-keys to better protect access to your requestor and its wallet. + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +Copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +### Creating unique app-keys + +You can generate a unique api-key with the `yagna` command: + +```bash +yagna app-key create requestor +``` + +In the command above `requestor` is the name of the key. The output is the 32-char app-key. + +### Listing available app-keys + +You can list available app-keys in your `yagna` instance with: + +```bash +yagna app-key list +``` + +You can identify your key by `name` and copy the value from the `key` column. + +### Using app-key in JS requestors scripts + +Once you have created an app-key you can use it in your requestor script replacing `insert-your-32-char-app-key-here` with the actual key. + +{% alert level="info" %} +Note that from the `yagna` perspective we are talking about an application accessing its API, therefore `yagna` uses the `app-key` term, while from an application's perspective they obtain the access to REST API, and therefore they have `apiKey` attribute. +{% /alert %} + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/using-app-keys/index.mjs" language="javascript" /%} + +### Using app-key from environment variable + +There is yet another option to set the `apiKey`. By default, the JS SDK will try to read the value from the `YAGNA_APPKEY` environment variable and set it as the `apiKey`. + +To assign an app-key value to the `YAGNA_APPKEY` environment variable use this command: + +{% tabs %} + +{% tab label="linux / macOS" %} + +```bash +export YAGNA_APPKEY=insert-your-32-char-app-key-here +``` + +{% /tab %} +{% tab label="Windows" %} + +```bash +set YAGNA_APPKEY=insert-your-32-char-app-key-here +``` + +{% /tab %} +{% /tabs %} + +and then remove the following line from the example script: + +```js +yagnaOptions: { + apiKey: 'insert-your-32-char-app-key-here' +} +``` + +### Using YAGNA_AUTOCONF_APPKEY environment variable + +When the Yagna service starts, if the environment variable `YAGNA_AUTOCONF_APPKEY` has been set, its value will be used to create an autoconfigured app-key. However, this app-key isn't permanent; it will vanish upon restarting the service unless the `YAGNA_AUTOCONF_APPKEY` variable is set again. While this approach is handy for tutorials and demonstrations, for regular use it's recommended to have a distinct app-key. This provides better management over access to your Yagna REST API. + +{% tabs %} + +{% tab label="linux / macOS" %} + +```bash +export YAGNA_AUTOCONF_APPKEY=insert-your-desired-app-key-here +``` + +{% /tab %} +{% tab label="Windows" %} + +```bash +set YAGNA_AUTOCONF_APPKEY=insert-your-desired-app-key-here +``` + +{% /tab %} +{% /tabs %} diff --git a/src/pages/ja/docs/creators/javascript/examples/working-with-events.md b/src/pages/ja/docs/creators/javascript/examples/working-with-events.md new file mode 100644 index 000000000..41e87a5f6 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/working-with-events.md @@ -0,0 +1,46 @@ +--- +title: Managing Events +description: Learn to receive events to get better control of your Tasks. +pageTitle: Mastering Event Management in Golem SDK JavaScript API +type: Example +--- + +# JS Task API Examples: working with events + +## Introduction + +This example will show you available event types and how to subscribe the certain types of events and extract their details. + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +Copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +## Working with events + +You can use events to react to specific actions. The following example shows how to subscribe to different types of events and extract their details. + +In the Task Executor context, you can have two types of events: + +- `golemEvents` that are common for all libraries using `golem-js` and +- Task Executor specific events like: `taskStarted` or `taskCompleted`. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/beta/examples/docs-examples/examples/executing-tasks/observing-events.mjs" language="javascript" /%} + +The complete list of golemEvents and their documentation is available [here](/docs/golem-js/reference/modules/events_events). diff --git a/src/pages/ja/docs/creators/javascript/examples/working-with-images.md b/src/pages/ja/docs/creators/javascript/examples/working-with-images.md new file mode 100644 index 000000000..ec4737c88 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/working-with-images.md @@ -0,0 +1,72 @@ +--- +title: Utilizing Custom Golem Images in Requestor Scripts +description: Learn to integrate custom Golem images into requestor scripts with practical examples, covering hash and tag usage for requestor scripts. +pageTitle: Integrate Custom Golem Images in Your Scripts - Practical Examples and Tips +type: Example +--- + +# Examples of how to use your own Golem image in a requestor script + +## Introduction + +Golem images defines a remote environment where you execute your tasks inside. They are identified either by their `tag` or by a `hash`. You can read more about Golem images in [Golem Images Explained](/docs/creators/javascript/guides/golem-images) guide. + +## Prerequisites + +Ensure you have the Yagna service installed and running, with `try_golem` as your configured app-key. + +## Running the Examples + +Let's create a project folder, start a Node.js project, and add the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm install @golem-sdk/task-executor +``` + +Paste the code in `index.mjs` located in the project folder, then run: + +```bash +node index.mjs +``` + +## Ways to Use Golem images + +### Using a Hash + +A hash, in relation to Golem images, serves as a distinctive identifier formed from the image's content. They are complex, elongated strings and can become cumbersome to handle and recall, particularly in sizable projects housing various images and versions. Without tags, hashes fall short in conveying information relevant to the image's purpose or version. Due to these factors, using tags, which are readable and understandable, is generally the favored approach for dealing with images. + +To illustrate the use of a hash, we can take a look at the code from the [Quickstart Example](/docs/creators/javascript/quickstarts/quickstart) + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/working-with-images/hash.mjs" language="javascript" /%} + +Consider the hash `529f7fdaf1cf46ce3126eb6bbcd3b213c314fe8fe884914f5d1106d4` in the code snippet, showcasing the initialization of the TaskExecutor: + +```js +const executor = await TaskExecutor.create({ + package: '529f7fdaf1cf46ce3126eb6bbcd3b213c314fe8fe884914f5d1106d4', + yagnaOptions: { apiKey: 'try_golem' }, +}) +``` + +If you've rolled out a custom Golem image and uploaded it to the registry, you can substitute this hash (`529 [...] 1106d4`) with your image's gvmkit-build-generated hash. If you've tagged it, you can use that tag like in the next example. + +### Using a tag + +Tags are helpful for managing different versions of your Golem images. They make specific versions easier to identify, track, and deploy. Instead of dealing with complex hash identifiers, you may use meaningful and understandable tag names. They provide an opportunity for intuitive naming systems, enhancing project structure and promoting effective team collaboration. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/working-with-images/tag.mjs" language="javascript" /%} + +{% docnavigation title="Next steps" %} + +- [Custom Golem image creation step by step tutorial](/docs/creators/javascript/tutorials/building-custom-image) + +{% /docnavigation %} + +{% docnavigation title="See also" %} + +- [golemfactory/gvmkit-build-rs repository](https://github.com/golemfactory/gvmkit-build-rs). + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/examples/working-with-results.md b/src/pages/ja/docs/creators/javascript/examples/working-with-results.md new file mode 100644 index 000000000..e7fda8d3b --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/examples/working-with-results.md @@ -0,0 +1,109 @@ +--- +title: Managing Task Results +description: Learn to manage task results in various scenarios using the Golem SDK JavaScript API, including handling single and multi-command tasks, and dealing with command failures. +pageTitle: Mastering Task Result Management in Golem SDK JavaScript API +type: Example +--- + +# JS Task API Examples: working with results + +## Introduction + +This example will show you how the task result can be managed by code in different ways for different use-cases. + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## How to run examples + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +{% alert level="info" %} + +Some of the examples require a simple `worker.mjs` script that can be created with the following command: + +```bash +echo console.log("Hello Golem World!"); > worker.mjs +``` + +{% /alert %} + +Copy the code into the `index.mjs` file in the project folder and run: + +```bash +node index.mjs +``` + +## Single command task + +Let's look at the simple example: we will run a task that consists of single command and will print the content of the result object: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/working-with-results/single-command.mjs" language="javascript" /%} + +In this example, our task consists of a single command: `node -v`. `ctx.run()` which returns an object that is then passed to the `result` variable and printed. + +Index refers to the sequential number of a command (we have just one, and counting starts from 0), +`status` of the result is "ok" which indicates the command was completed successfully, and the actual results of the command are under `stdout`. + +![Result ](/result_log.png) + +## Multi-command task + +When you run your tasks in a batch that is concluded with `.end()`: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/working-with-results/multi-command-end.mjs" language="javascript" /%} + +you will receive an array of result objects: + +you will receive an array of result objects: + +![results logs](/result_batch_log.png) + +In case you end your batch with the `endStream()` method: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/working-with-results/multi-command-endstream.mjs" language="javascript" /%} + +Each `data` chunk will contain a result object, in the sequence that the commands were in within the batch: + +![results output logs](/batch_result_endstream_1.png) +![results output logs](/batch_result_endstream_2.png) + +## What to do if your command fails? + +When your command fails, the ExeUnit (the component responsible for running your image on the remote computer) will terminate all remote processes. As a result, the entire task will be terminated. + +What will happen in such a case depends on the way your task is composed. Let's see it in examples. + +In the below case, the user's commands are chained in a batch. An error occurs as the user tries to download the `output.txt` file from `/golem/output/` folder while the file was created in the `golem/input` folder. +This command will raise an error and the whole task will be terminated. The next command, listing the content of `/golem/` folder, will not be executed at all. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/working-with-results/multi-command-fail.mjs" language="javascript" /%} + +![Batch failure output log](/bad_result_single_log.png) + +While the user will receive the error message, the output is only for the failing command, not for all commands in the task. + +The level of detail in the message depends on the type of method that causes the error. + +In the case of the data transfer method, you will receive a message describing the cause of the error. + +Let's see another example: + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/examples/working-with-results/single-command-fail.mjs" language="javascript" /%} + +![Single failure output log](/bad_result_log_3.png) + +In the case of the failure in the `run()` method, we receive the result object with following attributes: + +- `result: 'Error'`, +- `stdout: null`, +- `stderr: 'node: bad option: -w\n',` - the command output +- `message: 'ExeScript command exited with code 9', the exit code of the command that failed.` - message from the system. The `node.js` exit code 9 means: `Exit Code 9, Invalid Argument: This is employed when an unspecified option was given`. diff --git a/src/pages/ja/docs/creators/javascript/guides/accessing-internet.md b/src/pages/ja/docs/creators/javascript/guides/accessing-internet.md new file mode 100644 index 000000000..eeba75001 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/accessing-internet.md @@ -0,0 +1,66 @@ +--- +title: Guide to accessing the Internet from Golem providers +description: Explore outbound networking in Golem, enabling internet access from providers. Learn about whitelists, certificates, and setting up computation manifests for efficient task execution. +pageTitle: Outbound Networking in Golem - Internet Access for Providers +type: Guide +--- + +# Accessing the Internet from Golem providers + +When you execute your tasks on a provider you might need some data from outside the Golem Network. You can transfer it from your requestor, but in some cases, it is more convenient to transfer it from another location on the Internet. Such traffic initiated from providers, are in Golem terms called: outbound networking. + + + +## Outbound Networking + +Let’s take a look at outbound networking. The feature allows requestors to initiate traffic to the Internet from the payload running on a provider, and it is designed in a way to protect providers from malicious operations performed on the node. + +The availability of the feature depends on the configuration of the provider’s node. A Provider can limit the access to internet sites, by adjust their outbound rules to: + +- No outbound +- Only to whitelisted addresses +- Open for everything + +Furthermore, a provider can distinguish groups of users and configure the access above for: + +- Any requestor +- Payloads that are signed by an entity trusted by the provider. +- Requestors that have a partner certificate from an entity trusted by the Provider + +Note that the `whitelist` allows for another dimension of “freedom” as providers can modify the whitelist independently. At this moment the whitelist is shared by all the rules defined on the given provider. + +While the options requiring certificates are designed for advanced use cases, most of the requestors will use whitelisted locations. + +### Getting access to the Outbound feature + +For the requestor to be able to use the outbound feature, (initiate a connection to a `target_url`), the following minimal conditions must be met: + +- The requestor must request the outbound feature capability in the demand and include a Computation Manifest there. The manifest must declare the `target_url`. +- The provider offers the service for the `target_url` specified. (So either outbound for unrestricted URLs or the `target_url` is included in the whitelist). + +Note that if the provider requires additional conditions to be met (i.e. payload is certified, or the requestor is recognized as a “partner”), the requestor must fulfill these criteria and modify his demand accordingly by providing signed artifacts and certificates. + +#### Creation of the Computation Manifest + +As we explained above, to use outbound networking, the requestor must include a Computation Manifest in the demand. It is a kind of declaration that is attached to the demand, that serves the purpose of informing the Provider what kind of payload the requestor wants to run on the provider’s node. Requestor actions are verified vs. declaration and any connections not declared will be blocked. The demand is created automatically by the SDK based on the parameters provided in your requestor's scripts. Minimally, it is just a `package` that identifies the image to be run on a provider. To use the outbound feature, developers must also create a Payload Manifest and attach it to the demand. + +The JS SDK provides a tool, `golem-sdk-cli`, to facilitate the creation of the Payload Manifest. You can find instructions on how to download the tool and create a Payload Manifest [here](/docs/creators/javascript/guides/golem-sdk-cli). + +Next, you need to indicate in the requestor script that you intend to use the `outbound` feature. You need to provide your Payment Manifest and (optionally) a certificate and signature that will prove that the payload was audited. + +You can find an example of how to request the outbound service and attach a Payload Manifest in this [example](/docs/creators/javascript/examples/accessing-internet). + +### The whitelist + +The default set of URLs that providers may allow your application to use is available ([here](https://github.com/golemfactory/ya-installer-resources/tree/main/whitelist)). Note providers can modify the content of the list. + + + +{% docnavigation title="Next steps" %} + +- See our [tutorial](/docs/creators/javascript/tutorials/accessing-internet) on how to create a manifest and use it in the requestor script to reach the 'github.com' from a provider. + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/guides/error-handling.md b/src/pages/ja/docs/creators/javascript/guides/error-handling.md new file mode 100644 index 000000000..876baa1b1 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/error-handling.md @@ -0,0 +1,126 @@ +--- +description: A brief introduction to error handling in Golem JS SDK for application developers. +title: Error handling in Golem JS SDK +type: Guide +--- + +# Error Handling in the Golem JS SDK + +## Introduction + +This article will explain the basics of error handling in Golem JS SDK. + +## Golem Network + +When engaging with the Golem Network, it's critical to anticipate and plan for various scenarios. Errors can occur at any stage, from initializing your application to executing tasks and eventually cleaning up. Understanding these potential pitfalls is key to building robust applications on Golem. + +Below we'll discuss a few of the most common errors you may encounter and how to handle them. + +## Basic Error Handling structure + +A typical application will consist of a few parts: + +- Setting up the SDK +- Executing work on Golem +- Cleaning up + +Each of these parts can throw an error, and you should handle them accordingly. + +If your application is a simple script, you can use a `try/catch` block to handle errors, similarly to how its done in most of the examples: + +```javascript +import { TaskExecutor } from '@golem-sdk/task-executor' + +async function main() { + const executor = await TaskExecutor.create({ + package: 'golem/alpine:latest', + midAgreementPaymentTimeoutSec: 10, + debitNotesAcceptanceTimeoutSec: 10, + }) + + try { + const results = await executor.run(async (ctx) => { + const res1 = await ctx.run('echo "Hello"') + const res2 = await ctx.run('echo "World"') + return `${res1.stdout}${res2.stdout}` + }) + console.log(results) + } catch (err) { + console.error('An error occurred during execution:', err) + } finally { + await executor.shutdown() + } +} + +main().catch((err) => { + console.error('An error occurred during execution:', err) +}) +``` + +As you can see, we use a `try/catch` block to handle errors that may occur during the execution of the `run` method. +We also use a `finally` block to make sure that the executor is shut down properly. + +The shutdown process releases all the resources used by the executor, terminates all the running tasks and waits for all transactions to be finalized. +This is really important, especially during development where your code might be unstable. +If your code fails, and you don't pay for the resources you used, you will be banned from executing tasks on Golem. + +You might also notice the `TaskExecutor.create()` is outside the `try/catch` block. +This is because the create process won't allocate any resources on Golem, so there won't be any consequences if your application quits at this point. +However, it is good practice to handle errors here as well. +Depending on your use-case, you may want to handle some specific exception situations in a try/catch block +or as it is the case here, handle the error higher up in the call chain. + +## Error handling in tasks + +Context commands, like `run()` will not throw on error. +They will return a result object instead that contains the result of the command. +You can check the `result` property to see if the command was successful or not. + +Example: + +```typescript +async function worker(ctx: WorkContext) { + const result = await ctx.run('commmand-that-does-not-exist "Hello"') + if (result.result === ResultState.Ok) { + console.log('Command executed successfully') + } else { + console.error('Command failed:', result.stderr) + } +} +``` + +If you are performing operations that can throw an error, you should wrap them in a `try/catch` block, +else you'll trigger a retry of the task (see below). + +### Error propagation from run + +Exceptions thrown from within a task worker function will be intercepted by the task executor. + +By default, a retry mechanism will relaunch the task on a different provider. +This is done to ensure that the task is executed, even if the first provider fails. + +If you run out of retries (the number is configurable), the exception will be rethrown from the `run` method, +and you will have the opportunity to handle it. + +## Signal handling + +On unix systems, your application may receive a signal from the operating system. +This can happen for example when you press `Ctrl+C` in your terminal. + +By default, the SDK takes over handling `SIGINT` (`Ctrl+C`), `SIGTERM`, `SIGBREAK` and `SIGHUP` signals. +When a signal is received, the SDK will try to gracefully shut down the executor. + +{% alert level="info" %} +During that time, the TaskExecutor will likely log warnings and errors about activities being interrupted. This is normal behaviour. +{% /alert %} + +If you want to handle signals yourself, you can disable the default behaviour by setting the `skipProcessSignals` option to `false` when creating the executor. +If you do so, you will be responsible for shutting down the executor when a termination signal is received. + +```typescript +const executor = await TaskExecutor.create({ + skipProcessSignals: true, +}) +``` + +--- diff --git a/src/pages/ja/docs/creators/javascript/guides/golem-images-faq.md b/src/pages/ja/docs/creators/javascript/guides/golem-images-faq.md new file mode 100644 index 000000000..d8b159099 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/golem-images-faq.md @@ -0,0 +1,59 @@ +--- +description: FAQs on converting Docker images to .gvmi for Golem, including volume handling, storage limitations, and file management in Golem's VM runtime. +title: Golem VM Runtime - Docker Image Conversion FAQs +pageTitle: Golem VM Runtime - FAQs on Docker Image Conversion and Management +type: Guide +--- + +# Frequently asked questions + +## Why is it necessary to convert from a Docker image to .gvmi? + +The most important reason for this is to reduce the size of the image being transferred. When converting to `.gvmi` all redundant layers from the Docker image are discarded and the filesystem itself gets compressed using [`squashfs`](https://www.kernel.org/doc/html/latest/filesystems/squashfs.html). + +This results in a substantial size difference between the two images. For example, as of the time of writing this answer, the Docker image built as part of [Creating a custom Golem image](/docs/creators/javascript/tutorials/building-custom-image) tutorial is about `650 MB` in disk size. After conversion, the resulting `.gvmi` file weighs around `50 MB`. That's a 13x size difference! + +But why do we need this? Most importantly, to reduce the setup time for providers downloading a new image. If a provider node does not have the specific image in their cache yet then it will need to download it as the first step to performing some computations. + +## Are there any requirements when preparing a Dockerfile for Golem's VM runtime? + +If you intend to transfer files to and from the provider, there is one strict requirement: **at least one volume** directory must be specified using the `VOLUME` command. + +Besides the above, a number of commands are currently **not supported** by `gvmkit-build` converter. These are: + +* `CMD` +* `ENTRYPOINT` +* `ENV` +* `PORTS` + +## When building my image, I copied some files to one of the volumes. Why can't I see them when I run the image? + +When a `.gvmi` image is started by the VM runtime, an **empty host directory is mounted** under each of its directories declared as **volumes** (`VOLUME` command in the `Dockerfile`). + +If there is anything stored in the image under the volume directory it gets "shadowed" by the mounted host directory. + +## My VM has run out of storage space while running, why is that? + +In a running Golem VM, the storage space outside of volumes (declared through Docker's `VOLUME` command) is **limited to `128 MB`** of size stored in RAM using [`tmpfs`](https://www.kernel.org/doc/html/latest/filesystems/tmpfs.html). + +This only applies to files created once the VM is running. Anything that was included in the image during the build process stays available (the VM's filesystem is an overlay). + +Any larger files and chunks of data should be transferred to the VM's volumes. Since these directories are mounted from the host operating system they are only limited by the provider's storage space. + +## I cannot reproduce a problem when I run the Docker image locally. What should I do? + +In general, it's better to test the `.gvmi` image itself rather than the base Docker image. This guarantees that all Golem-specific conditions (filesystem characteristics, for example) are included. Also, testing with the VM runtime is as close to the provider's environment as possible. + +You can learn more about testing the VM runtime locally in the [Testing a Golem image](/docs/creators/javascript/tutorials/testing-golem-image) article. + +## My application's use case requires large files being processed by the providers. What is the best way to approach this? + +This is related to the answer given to 'My VM has run out of storage space' topic above. + +There you are two options here: + +1. If the files are **static** (that is: they are always the same) then you can include them in the VM image itself while building it. You can learn more about that in: [Golem image explained](/docs/creators/javascript/guides/golem-images). +2. If the files are **dynamic** (that is: they may differ between task executions) then your best option is to transfer the files as a command within the requestor agent. Make sure you use a **volume directory as the destination**. + + + diff --git a/src/pages/ja/docs/creators/javascript/guides/golem-images.md b/src/pages/ja/docs/creators/javascript/guides/golem-images.md new file mode 100644 index 000000000..9de40ae8d --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/golem-images.md @@ -0,0 +1,93 @@ +--- +title: Comprehensive Guide to Golem VM Images +description: A detailed guide on Golem VM images, covering their creation, conversion, and usage within the Golem Network, with insights on Docker integration and best practices. +type: Guide +--- + +# Golem VM images and their usage explained + +## Golem VM Image + +A Golem VM image is a virtual medium that contains libraries, tools, configurations, dependencies, and settings that are required to execute your tasks or services on a remote computer. The image is used to bootstrap the environment (VM) where those components are executed. + +### Execution environment + +Golem's virtual machine runtime is currently the primary execution environment. This runtime allows provider nodes to run Docker-like images defined by Golem application developers. + +A runtime is a binary used by the `yagna` service on provider nodes. A given runtime is responsible for deploying a certain type of payload (we have separate runtimes for VMs and for WASM code). In the case of Golem VMs, the runtime used is `ya-runtime-vm`. + +## Golem image creation + +Golem VM images are based on Docker images that are converted using the gvmkit-build tool to the `GVMI` file format. The conversion brings a visible advantage to users. By using SquashFS we're significantly reducing the size of the images, thus saving file space and shortening the time needed to transfer the images to provider nodes. Another benefit is running images in VMs instead of running them as Docker containers, which provides a separation of providers and requestor data and processes. + +The general process of creating a Golem image looks like this: + +- Define the image content in Docker format +- Build a Docker image from the Dockerfile +- Convert to Golem image using gvmkit-build ([example](/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format)) + +See our [Create Golem Image Tutorial](/docs/creators/javascript/tutorials/building-custom-image) on how to use the tool. + +## Publishing the image + +Once your image is built and tested, you can push it to a remote repository so that it becomes available to providers within the Golem Network. Golem manages a freely-accessible repository that everybody can push into without any special requirements. + +## Golem image use + +Any images that you intend to specify in your demand must be publicly available, so that the providers can download and deploy them. +Therefore, you either need to publish them to our registry or host it yourself in a publicly-accessible location. + +Within our registry, the images can be identified by their image hash or their tag name. +The type of identifier depends on the way you publish your image and is driven by intended usage. + +If you intend to use your image just for testing, it is enough to use the hashes and upload the images anonymously to the registry. +On the other hand, if you intend to work on a more complex project, where you would like to use several different versions of your image or collaborate with other developers - you should consider creating an account in the registry and use tags to describe your images. Both cases are illustrated in our examples. + +- Publishing the image anonymously. ([example](/docs/creators/tools/gvmkit/publishing-custom-images#publishing-custom-golem-image-to-the-registry-hash-based)) +- Publishing the image using tags. ([example](/docs/creators/tools/gvmkit/publishing-custom-images#publishing-custom-golem-image-to-the-registry-tag-based)) +- Using the tag or hash in a requestor script. ([example](/docs/creators/javascript/examples/working-with-images)) + +## Dockerfile command support + +All the Docker commands that are related to the definition of the image content are supported. So if you can build a Docker image from your Dockerfile, you should be able to convert it to a Golem image. + +Please take into account the following points: + +### VOLUME + +If your application requires transferring files to and/or from the provider node, you'll need to specifically define a place (or places) in the container's file system that will be used for file transfers. These places are called volumes. + +Additionally, in the case of large files, it is recommended to generate and store them in directories defined using the VOLUME clause. In such cases, they are stored on the host's disk drive and do not consume the storage available in RAM. + +{% alert level="warning" %} + +When you define the image (in Dockerfile), do not copy your files into folders that are defined as volumes. When a Golem virtual machine is started, **a new directory** is created in the host's file system for each of the defined volumes. This directory is then made available inside the VM under its specified path (for example: /golem/input). + +{% /alert %} + +### WORKDIR + +This will define the default directory to be used in shell commands sent to a remote computer once the VM is running. + +### ENTRYPOINT, CMD + +Because of how Golem's VM execution unit works, Docker's `ENTRYPOINT` and `CMD` statements are effectively ignored. You need to pass the relevant initialization commands as part of the task sent to a remote computer as a part of your task function or use the `beforeEach()` method. See examples. + +## File system content + +When you engage a provider, it launches an execution unit (a runtime) to run your VM image. + +In Golem terms, such a singular launch on a provider is called an Activity. Activities are utilized to execute requestor tasks. Unless an activity is terminated, all subsequent tasks scheduled on the same provider use the same activity - meaning the same VM container with its history. Therefore, within the lifecycle of the Activity, the state of the file system is maintained. One consequence is that any file system changes - be it updates to volumes or other locations within the VM - performed within a single execution of a task, will still be present when subsequent tasks get executed. + +{% docnavigation title="Next steps" %} + +- [Installing gvmkit-build](docs/creators/tools/gvmkit/gvmkit-build-installation) + +{% /docnavigation %} + +{% docnavigation title="See also" %} + +- [Creating custom Golem Image](/docs/creators/javascript/tutorials/building-custom-image) Step-by-step tutorial +- [Golem Images FAQ](/docs/creators/javascript/guides/golem-images-faq) + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/guides/golem-sdk-cli.md b/src/pages/ja/docs/creators/javascript/guides/golem-sdk-cli.md new file mode 100644 index 000000000..39493d172 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/golem-sdk-cli.md @@ -0,0 +1,154 @@ +--- +description: Comprehensive guide on Golem JS SDK CLI, covering installation, features, Golem Manifest creation, and internet access configuration. +title: Comprehensive Guide to Golem JS SDK CLI +pageTitle: Golem JS SDK CLI - Installation, Features, and Configuration +type: Guide +--- + +# Golem JS SDK CLI tool and its usage explained + +Golem SDK CLI is a companion tool for the [Golem SDK](https://github.com/golemfactory/golem-js). It is developed in parallel with the SDK, and new features are added as the SDK evolves or new use cases emerge. + +## Installing / Getting started + +Golem SDK CLI is available as an NPM package. + +Install using npm: + +```shell +npm install -g @golem-sdk/cli +``` + +Install using yarn: + +```shell +yarn global add @golem-sdk/cli +``` + +To check if the installation was successful, run: + +```shell +golem-sdk --version +``` + +After installation, the CLI is ready to be used. + +## Features + +### Create a new Golem Application + +The fastest way to get started with Golem Network is to use `golem-sdk new` to create a new application from a template. + +```shell +golem-sdk new +``` + +You will be asked a series of questions about your application and the CLI will use your answers to generate a new Golem Application. + +The first question will be the project name. The CLI will use it to create a new directory for your application in the current directory. You can use the `--path` option to override this behaviour. + +Note: The command will abort if the directory already exists. + +You can provide all the needed information from command line too. Type `golem-sdk new --help` to see the list of available options. + +### Golem Manifest + +[Golem Manifest](/docs/golem/payload-manifest) is a JSON document that describes your Golem application. While it is not necessary for simple applications, you will need it if you want to access advanced features of the Golem SDK, like [access to the Internet](/docs/creators/javascript/guides/accessing-internet). + +The `golem-sdk` CLI allows users to create and update the manifest file. By default, it assumes the manifest is available in a `manifest.json` file in the current folder. If you want to point to a different file, use the --manifest (or -m) option. + +#### Creating a Golem Manifest + +To create a new Golem Manifest with the `golem-sdk` CLI, run: + +```shell +golem-sdk manifest create [--image-hash hash] +``` + +The `image` argument should identify the GVMI image used by your application. The tools accept a few formats which are explained in the table below. You can learn more about Golem images [here](/docs/creators/javascript/guides/golem-images). + +If you have a `package.json` file in your project, the tool will use the `name`, `version`, and `description` fields from the file to fill in the fields in the manifest. Otherwise, you will need to provide them manually. + +##### Image + +The manifest needs to contain the image URL pointing to the GVMI download location and its hash to validate its integrity. +To facilitate the process of creating a manifest, `golem-sdk` accepts multiple forms of image argument, where some of them will automatically resolve the URL and/or hash. +Please consult the table below for more details: + +| Argument format | Example | Is `--image-hash` required? | Notes | +| ---------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------ | +| Image tag | `golem/node:latest` | No, it will be automatically resolved. | Image hash is fetched from [https://registry.golem.network]. It is the recommended method. | +| Image hash | `3d6c48bb4c192708168d53cee4f36876b263b7745c3a3c239c6749cd` | No, it is resolved from the image argument. | Image URL will point to [https://registry.golem.network] | +| URL to registry.golem.network | `http://registry.golem.network/v1/image/download?tag=golem-examples/blender:2.80` | No, it is automatically resolved. | | +| URL to arbitrary download location | `https://example.com/my-image` | Yes, image-hash is required. | Image is calculated by the gvmkit-build conversion tool. | + +If the hash is not provided or resolved, you will get a warning that the manifest will not be usable until you provide it manually. + +#### Adding outbound URLs + +For your application to access the Internet from the Golem network, the manifest must include the outbound URLs the application will be using. + +The default set of URLs that providers may allow your application to use is available ([here](https://github.com/golemfactory/ya-installer-resources/tree/main/whitelist)). Note providers can modify the content of the list. + +##### Example: Simple use + +This command will update the manifest file with the provided URL: + +```shell +golem-sdk manifest net add-outbound https://golem.network +``` + +You can use this command multiple times to add additional URLs to the manifest or pass many URLs in a single run: + +##### Example: Multiple URLs + +This command will update the manifest file with all the URLs provided. + +```shell +golem-sdk manifest net add-outbound https://golem.network https://github.com +``` + +#### Signing the manifest + +If the provider has set up an audited-payload rule for URLs not on the whitelist, you can gain access to these URLs. However, they must be declared in the manifest, and the manifest is signed by the key linked with the certificate accepted by the provider. + +To sign the manifest, run: + +```shell +golem-sdk manifest sign -k +``` + +If your private key is encrypted, you will need to provide the correct passphrase (`-p` or `--passphrase` option). +This command will produce a signature file (by default `manifest.sig`) that you will need to use in your application. + +#### Verifying the signature + +You can verify the manifest signature with your certificate using the following command: + +```shell +golem-sdk manifest verify +``` + +By default, it will use `manifest.pem` as the certificate file and `manifest.sig` as the signature file. You can change that by using the `--certificate-file` and `--signature-file` options. + +On success, it will print the following message: + +`Manifest matches signature.` + +It is important to use this command to make sure the key you are using is compatible with your certificate. + +{% docnavigation title="Next steps" %} + +- See our [tutorial](/docs/creators/javascript/tutorials/accessing-internet) on how to create a manifest and use it in the requestor script to reach the 'github.com' from a provider. + +- If you see a feature missing or a possible Golem SDK user experience improvement we could implement, please open an [issue](https://github.com/golemfactory/golem-sdk-cli/issues) or a pull request. + +{% /docnavigation %} + +{% docnavigation title="See also" %} + +- [Golem SDK](https://github.com/golemfactory/golem-js) - Typescript + NodeJS API for Golem. +- [Yagna](https://github.com/golemfactory/yagna) - An open platform and marketplace for distributed computations. +- [Golem Discord](https://chat.golem.network) + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/guides/index.md b/src/pages/ja/docs/creators/javascript/guides/index.md new file mode 100644 index 000000000..880336dbe --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/index.md @@ -0,0 +1,20 @@ +--- +description: Golem JS Guides +title: Golem JS Guides +type: Table of Contents +--- + +The Guides section contains articles that explain concepts, introduce terms, and provide a broad overview of particular topics. + +| Title | Content description | +| ----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [Introduction to the Golem Network and Task Model](/docs/creators/javascript/guides/task-model) | This is a short introduction to the Golem Network concepts explaining basic terms like `yagna`, `image`, `requestor`, and `provider`. It also clarifies the basic components of applications running on the Golem Network and introduces the Task Model supporting our Task API. You can also find a list of major features provided by TASK API. | +| [Working with Golem images](/docs/creators/javascript/guides/golem-images) | This guide explains what are: the Golem image, the process of creating a custom one, and how you refer to the image in your code. | +| [Moving your apps to mainnet](/docs/creators/javascript/guides/switching-to-mainnet) | A guide explaining what you need to do, and consider, to switch from testnet to the production network. | +| [Retrievable tasks (Job API)](/docs/creators/javascript/guides/retrievable-tasks) | A guide explaining how to use the Job API to run tasks on the network and get access to their state, results and error messages after they have been started. | + +{% docnavigation title="See also" %} + +- [Golem overview](/docs/golem/overview) in General Info section + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/guides/retrievable-tasks.md b/src/pages/ja/docs/creators/javascript/guides/retrievable-tasks.md new file mode 100644 index 000000000..9a0fd970f --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/retrievable-tasks.md @@ -0,0 +1,220 @@ +--- +title: Retrievable tasks (Job API) +description: Explore the Job API on Golem Network, offering enhanced control over task states, results, and error messages, ideal for complex tasks needing persistent data handling. +pageTitle: Job API in Golem Network - Advanced Task Control and State Management + +type: Guide +--- + +# Retrievable tasks (Job API) + +## Introduction + +The [Task Model](/docs/creators/javascript/guides/task-model) is a great way to get started with Golem Network. It allows you to run tasks on the network in a simple and straightforward way - you just need to call the `run()` method and await the promise. However, it has some limitations. With more complex and time-consuming tasks, you may want to have access to the state, results and/or error messages of the task outside the function scope. This is where the Job API comes in handy. + +## Job API + +The Job API is very good at three things: + +- **Retrieving the state of the task** - you can check if the task is still running, or if it has finished and get the results or error message. +- **Cancelling a running task** - you can cancel a running task at any time. +- **Reacting to task state changes** - you can easily add callbacks that will be called when the task state changes (e.g. when the task begins execution on the provider, or when it finishes). + +{% alert level="info" %} +To see the Job API in action, take a look at [this quickstart](/docs/creators/javascript/quickstarts/retrievable-task). To see how this API is used in a real-world scenario, check out [the express tutorial](/docs/creators/javascript/tutorials/rest-api-with-express) +{% /alert %} + +## Usage + +### `GolemNetwork` object + +The starting point for interacting with the Job API is the `GolemNetwork` object. This singular client establishes a connection to yagna and manages the global configuration utilized by every job. Here's how you can create it: + +```javascript +import { GolemNetwork } from '@golem-sdk/golem-js' + +const golemClient = new GolemNetwork({ + yagna: { + apiKey: 'try_golem', + }, + activity: { + activityExecuteTimeout: 1000 * 60 * 60, + }, + work: { + activityPreparingTimeout: 1000 * 60 * 5, + }, + // ... other configuration options +}) +await golemClient + .init() + .then(() => { + console.log('Connected to the Golem Network!') + }) + .catch((error) => { + console.error('Failed to connect to the Golem Network:', error) + }) +``` + +### Creating a job + +The `Job` object represents a single self-contained unit of work that can be executed on the Golem Network. It's created by calling the `createJob()` method on the `GolemNetwork` object. Here's how you can create a job and begin its execution: + +```javascript +const job = golemClient.createJob({ + package: { + imageTag: "golem/alpine:latest", + minStorageGib: 8, + minCpuCores: 4, + minMemGib: 8, + }, + // ... other configuration options +}); + +job.startWork(async (ctx) => { + const response = await ctx.run("echo 'Hello, Golem!'"); + return response.stdout; +}); + +const result = await job.waitForResult(); +``` + +### Cancelling a job + +While the job is running, you can cancel it at any time by calling the `cancel()` method: + +```javascript +const job = golem.createJob({ + package: { + imageTag: "golem/alpine:latest", + }, +}); + +job.startWork(async (ctx) => { + const response = await ctx.run("echo 'Hello, Golem!'"); + return response.stdout; +}); + +await job.cancel(); +``` + +### Listening to job state changes + +The job object exposes an `EventEmitter` that emits whenever the job state changes. Here's how you can listen to these events: + +```javascript +const job = golem.createJob({ + package: { + imageTag: "golem/alpine:latest", + }, +}); + +job.events.addListener("started", () => { + console.log("Job started event emitted"); +}); +job.events.addListener("success", () => { + console.log("Job success event emitted"); +}); +job.events.addListener("ended", () => { + console.log("Job ended event emitted"); +}); +job.startWork(async (ctx) => { + const response = await ctx.run("echo 'Hello, Golem!'"); + return response.stdout; +}); + + +const result = await job.waitForResult(); +``` + +Here's a list of all the events emitted by the job object: + +- `created` - emitted immediately after the job is created and initialization begins. +- `started` - emitted when the job finishes initialization and work begins. +- `success` - emitted when the job completes successfully and cleanup begins. +- `error` - emitted when the job fails and cleanup begins. +- `canceled` - emitted when the job is canceled by the user. +- `ended` - emitted when the job finishes cleanup after success, error or cancellation. + +### Getting the job state + +You can get the current job state by accessing the `state` property: + +```javascript +const job = golem.createJob({ + package: { + imageTag: "golem/alpine:latest", + }, +}); + +console.log("Job state before work starts:", job.state); + +job.startWork(async (ctx) => { + const response = await ctx.run("echo 'Hello, Golem!'"); + return response.stdout; +}); + + +const result = await job.waitForResult(); + +console.log("Job state after work ends:", job.state); +``` + +Here's a list of all the possible job states: + +- `new` - demand for the job has been created and is waiting for a provider to pick it up. +- `pending` - the job has been picked up by a provider and is in progress. +- `done` - the job has finished successfully. +- `rejected` - an error occurred while trying to run the job. + +### Getting the job results or error message + +`waitForResult()` is not the only way to get the job results or error message. You can also access them directly by accessing the `result` and `error` properties: + +```javascript +const job = golem.createJob({ + package: { + imageTag: "golem/alpine:latest", + }, +}); + +job.startWork(async (ctx) => { + const response = await ctx.run("echo 'Hello, Golem!'"); + return response.stdout; +}); + +try { + const result = await job.waitForResult(); + console.log("Job finished with result:", result); + // or + console.log("Job finished with result:", job.result); +} catch (error) { + console.error("Job failed with error:", job.error); +} +``` + +### Retrieving the job by ID + +You can retrieve the job by ID by calling the `getJobById()` method on the `GolemNetwork` object: + +```javascript +const job = golem.createJob({ + package: { + imageTag: "golem/alpine:latest", + }, +}); + +job.startWork(async (ctx) => { + const response = await ctx.run("echo 'Hello, Golem!'"); + return response.stdout; +}); +const jobId = job.id; + +// ... later in the code + +const sameJobAgain = golemClient.getJobById(jobId); +const results = await sameJobAgain.waitForResult(); +``` + +## When not to use the Job API + +The Job API is great for running isolated tasks that may take a long time to complete. However, it's not a good fit for scenarios where you need to run multiple short-lived tasks in parallel. For these scenarios, you should use the [Task Model](/docs/creators/javascript/guides/task-model) instead. \ No newline at end of file diff --git a/src/pages/ja/docs/creators/javascript/guides/switching-to-mainnet.md b/src/pages/ja/docs/creators/javascript/guides/switching-to-mainnet.md new file mode 100644 index 000000000..a70803159 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/switching-to-mainnet.md @@ -0,0 +1,127 @@ +--- +description: Master the transition from Golem testnet to mainnet with our in-depth guide. Learn all about payment platforms, Ethereum vs Layer-2, wallet security and funds acquisition while enhancing your Mainnet Golem experience. +title: Using Golem on the mainnet +type: Guide +--- + +# Using Golem on Mainnet + +## Introduction + +{% alert level="warning" %} + +This section is aimed mainly at **requestors** wishing to switch from running simple test tasks on our development subnet (testnet) to launching production payloads utilizing the vast number of providers on the public subnet. + +{% /alert %} + +If you are a requestor: + +- You need to configure your requestor agent to negotiate Polygon or Ethereum as a payment platform. You can find a JS example [here](/docs/creators/javascript/examples/switching-to-mainnet). + +Okay, so while technically we now know how to hand out tasks to providers on paid networks, in the context of running **Golem on the mainnet**, a few important questions remain largely unanswered: + +- How to **choose a payment platform** - Ethereum vs Layer-2 +- How to **monitor the status of your wallet** +- How to **secure access to the funds** in your Golem wallet if things go haywire? +- How do you **get funds to your requestor** so you can use them to pay for the tasks? +- How do you **get funds out of a Golem node** if you don't need them there anymore? + +## Ethereum vs Layer-2 + +The most important decision you need to make when it comes to Golem payments (both between Requestors <-> Providers, as well as getting funds in and out of Golem Network) is whether to use Ethereum or its Layer-2 scaling sidechain: Polygon. + +While direct, on-chain transactions using ERC-20-based tokens have long become the daily bread for the Ethereum mainnet and constitute a significant part of more than a million transactions passing through the chain each day, current ETH's price and the average gas fees make it extremely hard to use as a mean of exchange. This is because Golem payments will usually be orders of magnitude smaller than the typical transaction fee on Ethereum. + +Of course, if you're willing to accept that disproportion, you may continue to use the Ethereum mainnet payments but for the majority of Golem users, **Polygon** will be the preferred platform both when paying for tasks and receiving payments for their execution. + +For more information regarding Layer 2 and Polygon, please refer to our introduction to [Layer 2 payments](/docs/golem/payments/layer-2-payments): + +## How to monitor the status of your wallet + +There are a number of `yagna` commands that will enable you to monitor the status of your wallet. They will let you verify the address of the wallet, check the status, and enable payments from it. Their usage is illustrated [here](/docs/creators/tools/yagna/managing-golem-wallet) + +## Securing your Golem wallet + +Golem provides a procedure to backup your wallet in a secure way, as well as to restore it to the new Yagna installation. + +Please follow the instructions provided in [Golem wallet backup](/docs/creators/tools/yagna/golem-wallet-backup) and [Restore Golem wallet](/docs/creators/tools/yagna/restoring-golem-wallet) tutorials. + +## Getting funds to your requestor + +Golem Network payments are done on Blockchain with GLM tokens. Consequently, to enable such payments you will need: + +- GLM tokens to pay the Provider +- Native token of the chosen blockchain to pay for the gas a.k.a. transaction fees + +Ethereum's native token is ETH, whereas Polygon Network has MATIC. + +### On test network + +You can top up your wallet with the following command: + +```bash +yagna payment fund +``` + +### On paid network + +{% alert level="info" %} + +It may be useful to export your Golem wallet address to an external application that enables transactions on the internet. You can find instructions on how to back up and restore your wallet and export wallet address [here](/docs/creators/tools/yagna/golem-wallet-backup). + +{% /alert %} + +#### Acquiring MATIC/ETH and GLM tokens directly via the Golem Onboarding Portal + +1. Visit our [Onboarding Portal](https://glm.golem.network/) +2. Click **Get Started** or **Get GLM** button +3. Follow the instructions provided by the Portal + +#### Acquiring MATIC/ETH and GLM tokens from Yagna context via the Golem Onboarding Portal + +1. For the Polygon network, enter the following command into your Terminal window (Yagna has to be running in the background): +```bash +yagna payment fund --network=polygon +``` +Alternatively for the Ethereum network, enter the following command: +```bash +yagna payment fund --network=mainnet +``` +2. Follow the instructions presented on the newly opened Web Page of your default browser + +#### Acquiring MATIC directly on Polygon and converting some of them to GLMs + +1. Find an exchange platform that enables you to buy MATIC for FIAT i.e. [Ramp](https://ramp.network/) +2. Buy MATICs on Polygon +3. Swap some of MATICs to GLMs on [quickswap](https://quickswap.exchange) or [uniswap](https://uniswap.org/) + +#### Acquiring MATIC or GLM tokens on Polygon from Ethereum Mainnet + +**Go to** [**Polygon Website**](https://wallet.polygon.technology) + +1. Select **Proof of Stake** and then **Native Bridge** (in the Wallet Features section) +2. Connect your wallet +3. Choose the token you want to get and follow the instructions + +### Swapping GLM tokens for MATIC on Polygon + +**Go to** [**Polygon Website**](https://wallet.polygon.technology) + +1. Select **Proof of Stake** and then **Swap** (in the Wallet Features section) +2. Connect your wallet +3. Choose the token you want to get and follow the instructions + +### Using Golem Onboarding portal + +Another way is to use our [Onboarding portal](https://glm.golem.network) where you will be assisted through the whole process. + +## Getting your funds out of the Golem node + +You can consider one of the following options: + +- swapping GLM tokens to MATIC and selling them directly on a trading platform or +- bridging them to Ethereum Mainnet + +{% alert level="info" %} +It is easier to access your ERC-20 tokens by exporting your wallet (in Ethereum wallet v3 format) and then importing it into MetaMask. +{% /alert %} diff --git a/src/pages/ja/docs/creators/javascript/guides/task-model.md b/src/pages/ja/docs/creators/javascript/guides/task-model.md new file mode 100644 index 000000000..6852d347e --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/guides/task-model.md @@ -0,0 +1,129 @@ +--- +description: Introduction to Golem Network and Task model +title: Introduction to Golem Network and Task model +type: Guide +--- + + +# Introduction to Golem Network and Task model + +## Introduction + +This article will explain Golem Network and details around the Task model. + +## Golem Network + +Golem Network is a p2p network that consists of many nodes. Each node is a system with a __Yagna__ service running on it. The nodes that offer their resources to others are called __providers__. The nodes that hire resources are called __requestors__. + +To get things done (the Job) in the Network, you need to define it, split it into task(s), and send it to the network using the Yagna service. This is done using a __requestor script__ (or simply __Golem app__) that will utilize Golem JS SDK. You also need to define the software environment in which you will run your tasks on a provider. This is done by specifying a software package in the form of a Docker-like __image__. + +Let's get familiar with other terms that will help you navigate through Golem docs and find relevant information more easily. + +A most simple operation, like running a command or sending a file, is called a __command__. We __compose__ tasks from commands. Tasks are __executed__ on __providers__ a.k.a. __remote computers__. + +So, to run your app on Golem Network, you need: + +* A Yagna service that will let you connect to the Golem Network. +* A Docker-like [Image](/docs/creators/javascript/guides/golem-images), that constitutes an environment in which you will run your commands. +* A [requestor script](/docs/creators/javascript/tutorials/quickstart-explained), in which you will define tasks and execute them. + +The script will use Task API provided by JS SDK lib, so let’s get familiar with the Task model. + + +## Task model + +You can use the Golem Network resources to do a Job. A simple Job is just a single Task that you want to execute on the remote computer. In fact, to take full advantage of the network you should split your Job into many Tasks. + +A single Task will be run on a single provider. If you can divide your Job into many smaller independent fragments, they will be processed in parallel on multiple providers. The Task API will spawn them on available providers for you. + +Tasks are defined as functions that implement Worker Interface. Each task function may be a single command (like: `echo “Hello World”`) but may consist of multiple, separate steps, including sending files to and from the provider. We provide examples showing the usage of API in different scenarios. + +Tasks are run in the context that is defined by an image. Images are defined using Dockerfiles and then converted to Golem format using Golem's provided tool. In our examples, we use Golem standard images, but we also provide tutorials on how to prepare your image. + +## Main Task API features: + +{% alert level="info" %} +Click on the links to go to the usage examples. +{% /alert %} + + +### Orchestrating task execution + +Task executor may run: + +* a single task on a single provider (`.run()` method). +* a batch of tasks on multiple providers (call `.run()` method multiple times). The maximum number of concurrently engaged providers is defined by the user; providers can be engaged more than once until all tasks are executed. +* An initializing command runs once per engaged provider (`.beforeEach()`). It allows for the preparation of workers before processing the main batch of tasks. + +See examples [here](/docs/creators/javascript/examples/executing-tasks). + + +### Composing task + +Tasks are defined by task functions. The simplest function contains just a single `run()` call on worker context `ctx`. You can run commands in sequence or chain them into batches. In this section you will be provided with examples showing how to: + +* Run a single command on a remote computer (`.run()` method). +* Organize a set of commands into a batch: (`.beginBatch()` method) with 2 different output types: + * Promise (`.end()` method) + * ReadableStream (`.endStream()` method) + +See examples [here](/docs/creators/javascript/examples/composing-tasks). + +### Sending data to and from providers + +Users can send: + +* files to remote computer (`.uploadFile()` method) (node.js) +* files from remote computer (`.downloadFile()` method) (node.js) +* json to remote computer (`.uploadJson()` method) +* data to remote computer (`.uploadData()` method) (web browser and node.js) +* data from remote computer (`.downloadData()` method) (web browser) + + +The user must define a VOLUME within an image definition, to indicate a folder designed to contain files on a remote computer to enable data transfer. + +See examples [here](/docs/creators/javascript/examples/transferring-data). + +### Processing results + +Each command (run, uploadFile) produces a result object that contains stdout, stderr of the respective step run. Users can use this output to manage program flow. + +The way you can process results depends on the method you compose tasks and how tasks are composed. +It also defines how the potential failures on the provider side are handled by the JS SDK. + +See examples [here](/docs/creators/javascript/examples/working-with-results). + + +### Defining minimal requirements for the provider system / selecting providers. + +Users can define minimal requirements for the provider's system (like memory, storage, CPU Threads, and CPU cores) via dedicated parameters provided by the `TaskExecutor.create()` method. + +JS SDK provides the user with several built-in filters: `whiteListProposalIdsFilter()`, `blackListProposalIdsFilter()`, `whiteListProposalNamesFilter()`, `blackListProposalNamesFilter()` that can be used to select or exclude certain providers. + +The user can also define his filter using the custom `proposalFilter`. + +See examples [here](/docs/creators/javascript/examples/selecting-providers). + + +### Switching to the mainnet + +By default, JS SDK will execute your task in testnet. This is a development network where you cannot expect performance and capacity. However, you pay in test GLM. If you would rather utilize the larger pool of providers, you should switch to the main network. + +See example [here](/docs/creators/javascript/examples/switching-to-mainnet). + +{% docnavigation title="Next steps" %} + +See our [JS Examples](/docs/creators/javascript/examples) + + +{% /docnavigation %} + + +{% docnavigation title="See also" %} + +You can explore our [tutorials](/docs/creators/javascript/tutorials) to see how to use these features in a defined scenario. + +{% /docnavigation %} + + + diff --git a/src/pages/ja/docs/creators/javascript/index.md b/src/pages/ja/docs/creators/javascript/index.md new file mode 100644 index 000000000..3769f1546 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/index.md @@ -0,0 +1,22 @@ +--- +description: Create your task application on Golem +title: JS SDK Introduction +type: Introduction +--- + +# Create your task application using Task API + +Welcome to the docs page for Golem JS SDK. + +The core of JS SDK is the **@golem-sdk/golem-js** library that enables interaction with the Golem Network. Your JS scripts can be run in Node.js and web browsers. We provide a documentation package that helps quickly understand and use the Golem Network and the essential tools. + +You can start your journey with Golem and create great decentralized apps the way that suits your style and preference: + +| Title | Description | +| :----------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Quickstarts | If you like to start with something quick and simple - select one of our [Quickstarts](/docs/creators/javascript/quickstarts). They contain instructions that show how to run our apps quickly. | +| Tutorials | If you prefer to learn how to write apps on Golem through practical use cases - try one of our [tutorials](/docs/creators/javascript/tutorials). In the [Running tasks in parallel tutorial](/docs/creators/javascript/tutorials/running-parallel-tasks) you will create an app that recovers passwords using the `hashcat` utility. You will learn how to split the job into multiple smaller tasks and run them in parallel on the Golem Network. You will also create a custom image with the software dedicated to the task and run the app on the network. | +| Guides | If you prefer to begin by understanding the Golem Network concept and have an overview of the Task API model - check out the [Guides](/docs/creators/javascript/guides) section. You can also find an explanation of Golem images and how to create custom ones. | +| JS Examples | If you want to explore Task API features through examples that illustrate how to use our API - go directly to [JS Examples](/docs/creators/javascript/examples). You will find ready-to-run examples with explanations that will help you add these new features to your apps. | +| Tools instructions | Contains instructions on how to install and use [Yagna](/docs/creators/tools/yagna) (this is the piece that makes you part of the Golem Network) and [`gvmkit-build`](/docs/creators/tools/gvmkit) (a tool that allows you to create your custom Golem images) and other important components of building and running Golem apps. | +| API Reference | We also provide a reference where you can explore details of the [API](/docs/golem-js/reference/overview). | diff --git a/src/pages/ja/docs/creators/javascript/quickstarts/golem-in-a-browser.md b/src/pages/ja/docs/creators/javascript/quickstarts/golem-in-a-browser.md new file mode 100644 index 000000000..83031293b --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/quickstarts/golem-in-a-browser.md @@ -0,0 +1,10 @@ +--- +description: Learn how to set up a Golem requestor agent in your browser, including Yagna service configuration and running scripts in a web context. +title: Browser-Based Golem Requestor Quickstart +pageTitle: Implementing Golem Requestor Agents in Web Browsers - Quickstart +type: Quickstart +--- + +# Requestor in browser Quickstart + +{% partial file="quickstarts/golem-in-a-browser.md" /%} diff --git a/src/pages/ja/docs/creators/javascript/quickstarts/index.md b/src/pages/ja/docs/creators/javascript/quickstarts/index.md new file mode 100644 index 000000000..960542c1f --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/quickstarts/index.md @@ -0,0 +1,13 @@ +--- +description: List of Golem JS Quickstarts +title: Golem JS Quickstarts +type: Table of Contents +--- + +We provide some Quickstart examples to help you start your journey with Golem: + +| Title | Content description | +| --------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [Golem JS Quickstart](/docs/creators/javascript/quickstarts/quickstart) | If you're looking to quickly get started with Golem using node.js, check out the JS Quickstart which will take you through the setup steps and have you running your first app in less than 10 minutes. Just click on the link provided to give it a try. This is a simple example yet a good starting point for exploring Golem features or building your more advanced scripts aimed at executing tasks on the Golem Network. | +| [Golem in browser Quickstart](/docs/creators/javascript/quickstarts/golem-in-a-browser) | Will guide you on how to operate a requestor agent through your web browser. | +| [Retrievable task (Job API)](/docs/creators/javascript/quickstarts/retrievable-task) | In this guide, you will learn how to use the Job API to retrieve the status and results of a task after it has been started. | diff --git a/src/pages/ja/docs/creators/javascript/quickstarts/quickstart.md b/src/pages/ja/docs/creators/javascript/quickstarts/quickstart.md new file mode 100644 index 000000000..872eb9662 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/quickstarts/quickstart.md @@ -0,0 +1,10 @@ +--- +title: Node.js Development on Golem Network +pageTitle: Easily Build JavaScript Apps Using Golem Network - Node.js Quickstart +description: Learn to build JavaScript applications with this quickstart for the Golem Network, featuring installation steps, code examples, and easy integration. +type: Quickstart +--- + +# Golem JS Quickstart + +{% partial file="quickstarts/js-quickstart.md" /%} diff --git a/src/pages/ja/docs/creators/javascript/quickstarts/retrievable-task.md b/src/pages/ja/docs/creators/javascript/quickstarts/retrievable-task.md new file mode 100644 index 000000000..6ceb5a398 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/quickstarts/retrievable-task.md @@ -0,0 +1,8 @@ +--- +title: Golem Network Job API - Executing and Retrieving Long-Running Tasks +pageTitle: Efficiently Run and Retrieve Long-Duration Tasks on Golem Network - A Step-by-Step Quickstart +description: Learn to execute and retrieve results of long-duration tasks on the Golem Network with our comprehensive Quickstart, ideal for Node.js environments. +type: Quickstart +--- + +{% partial file="quickstarts/retrievable-task-quickstart.md" /%} diff --git a/src/pages/ja/docs/creators/javascript/react/api-reference-overview.md b/src/pages/ja/docs/creators/javascript/react/api-reference-overview.md new file mode 100644 index 000000000..3ca75b344 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/api-reference-overview.md @@ -0,0 +1,18 @@ +--- +title: React SDK API Overview +description: Overview of the Golem React SDK +type: React Reference +--- + +# React SDK API Overview + +This section contains short descriptions of all the components and hooks available in the React SDK. Click on the name of the component or hook to see the full documentation. + +| Component or hook | Description | +| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| [YagnaProvider](/docs/creators/javascript/react/yagna-provider) | This component provides context for the Golem React SDK. It's required to wrap your app with this component if you want to use the SDK. | +| [useYagna](/docs/creators/javascript/react/use-yagna) | This hook provides information about the Yagna connection status. | +| [useExecutor](/docs/creators/javascript/react/use-executor) | This hook allows you to initialize and manage a task executor. | +| [useTask](/docs/creators/javascript/react/use-task) | This hook allows you to run a single task on the Golem Network | +| [useInvoices](/docs/creators/javascript/react/use-invoices) | This hook allows you to search through all invoices known to your Yagna node. | +| [useHandleInvoice](/docs/creators/javascript/react/use-handle-invoice) | This hook allows you to handle invoices (currently only paying them is supported). | diff --git a/src/pages/ja/docs/creators/javascript/react/getting-started.md b/src/pages/ja/docs/creators/javascript/react/getting-started.md new file mode 100644 index 000000000..8bd1f3a43 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/getting-started.md @@ -0,0 +1,109 @@ +--- +title: React SDK Introduction - Installation, Configuration, and Usage +description: Comprehensive guide to installing and configuring the React SDK for Golem, including prerequisites, installation steps, and a practical example to connect with Yagna. +type: Introduction +--- + +# Get started with the React SDK + +## Prerequisites + +Before you get started, make sure you have installed [yagna](/docs/creators/tools/yagna/yagna-installation-for-requestors) and [created an app-key](/docs/creators/javascript/examples/using-app-keys#creating-unique-app-keys) + +{% alert level="info" %} + +The React SDK is designed to work with the yagna version 0.13.0 or above. If you have an older version installed, please update it before proceeding. + +{% /alert %} + +## Installation + +To add the SDK to an existing react project simply install it using your favorite package manager: + +{% tabs %} + +{% tab label="npm" %} + +```bash +npm install @golem-sdk/react +``` + +{% /tab %} +{% tab label="yarn" %} + +```bash +yarn add @golem-sdk/react +``` + +{% /tab %} +{% tab label="pnpm" %} + +```bash +pnpm add @golem-sdk/react +``` + +{% /tab %} +{% tab label="bun" %} + +```bash +bun add @golem-sdk/react +``` + +{% /tab %} + +{% /tabs %} + +## Configuring the SDK + +Then make sure to wrap your app with the `YagnaProvider` component: + +```jsx + + + +``` + +This provides context for the rest of the SDK. See the [YagnaProvider API reference](/docs/creators/javascript/react/yagna-provider) for the list of all available configuration options. + +## Connecting to Yagna + +Yagna blocks all requests from external origins by default. To allow the SDK to communicate with it you need start Yagna with `--api-allow-origin=''` flag. For example: + +```shell +yagna service run --api-allow-origin='http://localhost:3000' +``` + +## Putting it all together + +Now that you have the SDK installed and configured, you can start using it in your app. Let's start with a simple example that displays the connection status to Yagna: + +```jsx +function YagnaStatus() { + const { isConnected, setYagnaOptions } = useYagna() + const inputRef = useRef(null) + if (isConnected) { + return Connected to Yagna! + } + return ( +
+
Enter your app key to connect to Yagna
+ + +
+ ) +} +``` + +Add this component to your application and refresh the page. Enter your app-key and if you have set up everything correctly you should see "Connected to Yagna!". + +{% docnavigation title="Next steps" %} + +To learn more about the SDK, check out the [API reference](/docs/creators/javascript/react/api-reference-overview). + +If you'd like to see the SDK in action before you start using it, check out the [example application](/docs/creators/javascript/react/#example-application). + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/react/index.md b/src/pages/ja/docs/creators/javascript/react/index.md new file mode 100644 index 000000000..504c96400 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/index.md @@ -0,0 +1,47 @@ +--- +title: React SDK Introduction +description: Introduction to the Golem React SDK +type: Introduction +--- + +# React SDK Introduction + +Welcome to the docs page for Golem React SDK. Before you get started, make sure you have read the [Introduction to the Task Model](/docs/creators/javascript/guides/task-model) to get familiar with the Golem Network and the task model. + +## Who is this SDK for? + +The Golem React SDK is for developers who want to build React applications that interact with the Golem Network directly, without having to write any backend code. It is a wrapper around the [Golem JavaScript SDK](/docs/creators/javascript/quickstarts/quickstart) that provides React hooks and components for common tasks such as connecting to Yagna, initializing executors, running tasks, etc. It's important to keep in mind that the React SDK is meant to be used with your user's local yagna installation. If you want to build a web app that interacts with the Golem Network without requiring your users to deal with yagna, you should use the [Golem JavaScript SDK](/docs/creators/javascript/quickstarts/quickstart) instead. + +## What can I build with this SDK? + +The Golem React SDK provides a set of React hooks and components that make it easy to perform common tasks such as: + +- Connecting to Yagna - use the [useYagna](/docs/creators/javascript/react/use-yagna) hook to connect display the connection status and reconnect to Yagna if the connection is lost. +- Running tasks on the network - use the [useExecutor](/docs/creators/javascript/react/use-executor) hook to initialize and terminate executors and the [useTask](/docs/creators/javascript/react/use-task) hook to run tasks on the network. +- Listing and handling invoices - use the [useInvoices](/docs/creators/javascript/react/use-invoices) hook to list invoices and the [useHandleInvoice](/docs/creators/javascript/react/use-handle-invoice) hook to handle invoices. + +{% docnavigation title="API reference" %} + +If you want to learn more about each of the hooks and components provided by the SDK, check out the [API reference](/docs/creators/javascript/react/api-reference-overview). + +{% /docnavigation %} + +## Example application + +To help you get started we have created an example application that uses every hook and component provided by the SDK. You can find the source code for the example app on [GitHub](https://github.com/golemfactory/golem-sdk-react/tree/master/examples/react-with-vite). Feel free to clone the repository and play around with the code. Follow the instructions in the README to run the app locally. + +To see the example app in action, you can also visit the [live demo](https://golem-react-showcase.vercel.app/). + +## GitHub repository + +The source code for the SDK along with an example app is available on [GitHub](https://github.com/golemfactory/golem-sdk-react) and we welcome contributions. + +## Reporting issues + +If you encounter any issues with the SDK please report them on [GitHub](https://github.com/golemfactory/golem-sdk-react/issues) or [Discord](https://chat.golem.network). + +{% docnavigation title="Next steps" %} + +To get started with the SDK, check out the [Getting started](/docs/creators/javascript/react/getting-started) guide. + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/react/use-executor.md b/src/pages/ja/docs/creators/javascript/react/use-executor.md new file mode 100644 index 000000000..20c5a0ee8 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/use-executor.md @@ -0,0 +1,75 @@ +--- +title: useExecutor +description: React hook for managing a single TaskExecutor +type: React Reference +--- + +# useExecutor + +`useExecutor` is a hook that manages a single [TaskExecutor](/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor). Use this hook to initialize and later terminate an executor. To run tasks you should use the [useTask](/docs/creators/javascript/react/use-task) hook. It returns an object with the following properties: + +| Name | Description | +| -------------- | ---------------------------------------------------------------------------------------------------------------------- | +| executor | The [TaskExecutor](/docs/golem-sdk-task-executor/reference/classes/executor.TaskExecutor) instance. | +| isInitializing | Boolean indicating whether the executor is being initialized. A new executor cannot be initialized while this is true. | +| error | Error object containing information about the error that occurred while initializing the executor. | +| initialize | A function to initialize a new executor | +| terminate | A function to terminate the executor (calls `TaskExecutor.end()` under the hood) | +| isInitialized | Boolean indicating whether the executor is initialized. This is always equal to `!!executor`. | +| isTerminating | Boolean indicating whether the executor is being terminated. | + +## Parameters + +The hook accepts two configuration objects, one for the executor itself (package, demand specification, budget, etc) and one for the extra behavior (e.g. whether to add a `beforeunload` event listener to prevent the user from accidentally closing the tab while the executor is running). + +| Name | Description | +| ----------------------- | ------------------------------------------------------------------------------------------- | +| options (required) | [ExecutorOptions](/docs/golem-sdk-task-executor/reference/modules/executor#executoroptions) | +| extraOptions (optional) | See below | + +### Extra options + +| Name | Description | +| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| addBeforeUnloadHandler (optional) | Boolean indicating whether to add a `beforeunload` event listener to prevent the user from closing the tab while the executor is running. Defaults to `true`. | + +## Example + +```jsx +function MyComponent() { + const { + executor, + initialize, + isInitialized, + isInitializing, + terminate, + error, + } = useExecutor( + { + package: 'golem/alpine:latest', + }, + { + addBeforeUnloadHandler: true, + } + ) + if (isInitializing) { + return
Initializing executor...
+ } + if (error) { + return
Error: {error.toString()}
+ } + if (!isInitialized) { + return ( +
+ +
+ ) + } + return ( +
+ + +
+ ) +} +``` diff --git a/src/pages/ja/docs/creators/javascript/react/use-handle-invoice.md b/src/pages/ja/docs/creators/javascript/react/use-handle-invoice.md new file mode 100644 index 000000000..63026f5a2 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/use-handle-invoice.md @@ -0,0 +1,63 @@ +--- +title: useHandleInvoice +description: React hook for handling a single invoice +type: React Reference +--- + +# useHandleInvoice + +`useHandleInvoice` is a hook that allows you to handle (accept) a single invoice. It returns an object with the following properties: + +| Name | Description | +| ------------- | ------------------------------------------------------------------------------------------------------- | +| acceptInvoice | A function that accepts the invoice. | +| isLoading | Boolean indicating whether the invoice is being accepted. | +| error | The error explaining why the last attempt to accept the invoice failed. | +| isAccepted | Boolean indicating whether the invoice has been accepted. | +| reset | A function that resets the state of the hook (sets `isAccepted` to `false` and `error` to `undefined`). | + +## Parameters + +This hook accepts two parameters: + +| Name | Description | +| ------------------ | --------------------------------------------------------------------------------------------------------------------------- | +| invoice (required) | The id of the invoice to handle (you can get it from the [useInvoices](/docs/creators/javascript/react/use-invoices) hook). | +| options (optional) | see below | + +### Options + +| Name | Description | +| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | +| onAccepted (optional) | A function that will be called when the invoice is accepted. This is a good place to display a success message to the user. | +| onRejected (optional) | A function that will be called when the invoice is rejected. This is a good place to display an error message to the user. | +| allocationTimeoutMs (optional) | The timeout for the allocation in milliseconds. Defaults to 60 seconds. | + +## Example + +```jsx +function MyComponent({ id, status }) { + const { acceptInvoice, isAccepted, isLoading } = useHandleInvoice(id, { + onAccepted: () => { + showToast(`Invoice accepted! 💸`, { type: 'success' }) + }, + onRejected: () => { + showToast(`There was an error accepting the invoice 😥`, { + type: 'error', + }) + }, + }) + return ( +
+

{id}

+

{status}

+ +
+ ) +} +``` diff --git a/src/pages/ja/docs/creators/javascript/react/use-invoices.md b/src/pages/ja/docs/creators/javascript/react/use-invoices.md new file mode 100644 index 000000000..641217e3e --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/use-invoices.md @@ -0,0 +1,87 @@ +--- +title: useInvoices +description: React hook for searching invoices +type: React Reference +--- + +# useInvoices + +`useInvoices` is a hook that allows you to search through all invoices known to the connected yagna instance. Under the hood it uses [SWR](https://swr.vercel.app/) so you get all the benefits of caching and revalidation. It's also possible to configure that behavior by passing the `swrConfig` parameter. It returns an object with the following properties: + +| Name | Description | +| ------------ | ---------------------------------------------------------------------------------------------- | +| invoices | Array of Invoices (see below) | +| isLoading | Boolean indicating whether the invoices are being fetched. | +| error | Error object containing information about the error that occurred while fetching the invoices. | +| isValidating | Boolean indicating whether the invoices are being revalidated. | +| refetch | A function that can be used to manually trigger a refetch. | + +## Invoice object type + +| Name | Type | +| --------------- | ------------------------------------------------------------------------------- | +| invoiceId | String | +| issuerId | String | +| recipientId | String | +| payeeAddr | String | +| payerAddr | String | +| paymentPlatform | String | +| timestamp | String | +| agreementId | String | +| activityIds | Array of Strings | +| amount | String | +| paymentDueDate | String | +| status | One of `ISSUED` `RECEIVED` `ACCEPTED` `REJECTED` `FAILED` `SETTLED` `CANCELLED` | + +## Parameters + +This hook accepts a single configuration object with the following properties: + +| Name | Description | +| --------------------------- | ---------------------------------------------------------------------------------------- | +| after (optional) | Only return invoices with a timestamp greater than this value. | +| limit (optional) | Maximum number of invoices to return. Default is 50. | +| statuses (optional) | Array of statuses to filter by. | +| providerIds (optional) | Array of provider IDs to filter by. | +| minAmount (optional) | Only return invoices with an amount greater than or equal to this value. | +| maxAmount (optional) | Only return invoices with an amount less than or equal to this value. | +| providerWallets (optional) | Array of provider wallets to filter by. | +| invoiceIds (optional) | Array of invoice IDs to filter by. If provided, all other search parameters are ignored. | +| paymentPlatforms (optional) | Array of payment platforms to filter by. | +| swrConfig (optional) | [SWR configuration object](https://swr.vercel.app/docs/api#options) | + +## Example + +```jsx +function MyComponent() { + const { invoices, isLoading, error, refetch } = useInvoices({ + limit: 10, + statuses: ['RECEIVED'], + after: new Date('2021-01-01'), + }) + if (isLoading) { + return
Loading...
+ } + if (error) { + return
Error: {error.toString()}
+ } + return ( +
+
    + {invoices.map((invoice) => ( +
  • + {invoice.invoiceId} - {invoice.status} +
  • + ))} +
+ +
+ ) +} +``` + +{% docnavigation title="See also" %} + +- [useHandleInvoice](/docs/creators/javascript/react/use-handle-invoice) + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/react/use-task.md b/src/pages/ja/docs/creators/javascript/react/use-task.md new file mode 100644 index 000000000..1ddaf7572 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/use-task.md @@ -0,0 +1,46 @@ +--- +title: useTask +description: React hook for managing a single Task on the Golem Network +type: React Reference +--- + +# useTask + +`useTask` is a hook that manages a single task on the Golem Network. It returns an object with the following properties: + +| Name | Description | +| --------- | -------------------------------------------------------------------------------------------- | +| run | The [worker function](/docs/golem-js/reference/modules/task_work#worker) that runs the task. | +| isRunning | Boolean indicating whether the task is running. | +| error | The error which caused the task to fail. | +| result | The result of the task. | + +## Parameters + +This hook takes the [TaskExecutor](/docs/golem-sdk-task-executor/reference/modules/executor#executoroptions) instance, initialized by the [useExecutor](/docs/creators/javascript/react/use-executor) hook. + +| Name | Description | +| ------------------- | ------------------------------------------------------------------------------------------------------ | +| executor (required) | The [TaskExecutor](/docs/golem-sdk-task-executor/reference/modules/executor#executoroptions) instance. | + +## Example + +```jsx +function MyComponent({ executor }) { + const { isRunning, error, result, run } = useTask(executor) + const onClick = () => + run(async (ctx) => { + return (await ctx.run('echo', ['Hello world!'])).stdout + }) + return ( +
+ + {isRunning &&
Task is running...
} + {error &&
Task failed due to {error.toString()}
} + {result &&
Task result: {result}
} +
+ ) +} +``` diff --git a/src/pages/ja/docs/creators/javascript/react/use-yagna.md b/src/pages/ja/docs/creators/javascript/react/use-yagna.md new file mode 100644 index 000000000..5d5ab00da --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/use-yagna.md @@ -0,0 +1,44 @@ +--- +title: useYagna +description: React hook for connecting to Yagna +type: React Reference +--- + +# useYagna + +`useYagna` is a hook that provides information about the Yagna connection status. If the connection cannot be established, the hook will retry using an [exponential backoff](https://en.wikipedia.org/wiki/Exponential_backoff) algorithm. It returns an object with the following properties: + +| Name | Description | +| --------------- | -------------------------------------------------------------------------------------------- | +| isConnected | Boolean indicating whether the connection to Yagna is established. | +| isLoading | Boolean indicating whether the connection to Yagna is being established. | +| error | Error object containing information about the error that occurred while connecting to Yagna. | +| reconnect | A function that can be used to reconnect to Yagna. | +| setYagnaOptions | A function that can be used to set the app-key and base path for Yagna. | +| isAppKeySet | Boolean indicating whether the app-key for Yagna is set. | +| appKey | The current app-key for Yagna. | +| basePath | The current url for Yagna. | + +## Parameters + +This hook doesn't accept any parameters. + +## Example + +```jsx +function MyComponent() { + const { isConnected, appKey, setYagnaOptions } = useYagna() + const inputRef = useRef(null) + return ( +
+
Connected to Yagna: {isConnected ? 'yes' : 'no'}
+ + +
+ ) +} +``` diff --git a/src/pages/ja/docs/creators/javascript/react/yagna-provider.md b/src/pages/ja/docs/creators/javascript/react/yagna-provider.md new file mode 100644 index 000000000..0cf490f0b --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/react/yagna-provider.md @@ -0,0 +1,37 @@ +--- +title: YagnaProvider +description: React component that provides context for the Golem React SDK +type: React Reference +--- + +# YagnaProvider + +`YagnaProvider` is a React component that provides context for the rest of the Golem React SDK. It should be used as a wrapper for your app. + +## Props + +The component accepts a single prop `config` which is an object with the following properties: + +| Name | Description | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| yagnaAppkey (optional) | Your 32-character Yagna app-key. If you haven't genereated one already use the command `yagna app-key create ` to generate one. If you don't provide an app-key here, you can set it later using the `useYagna` hook. | +| yagnaUrl (optional) | The URL of the Yagna service. Defaults to `http://127.0.0.1:7465`. If you don't provide a URL here, you can set it later using the `useYagna` hook. | +| swrKey (optional) | The key used to prefix all SWR cache keys. Defaults to "golem-sdk" | + +## Example + +```jsx +// your app entry point +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./App.tsx"; +import { YagnaProvider } from "@golem-sdk/react"; + +ReactDOM.createRoot(document.getElementById("root")!).render( + + + + + , +); +``` diff --git a/src/pages/ja/docs/creators/javascript/tutorials/accessing-internet.md b/src/pages/ja/docs/creators/javascript/tutorials/accessing-internet.md new file mode 100644 index 000000000..afd7af990 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/tutorials/accessing-internet.md @@ -0,0 +1,203 @@ +--- +title: Enabling Internet Access for Requestor Tasks on Golem Network +description: Step-by-step tutorial for Golem requestors to enable internet access in tasks, detailing manifest creation and provider security. +pageTitle: Golem Requestors' Tutorial on how to access Internet for Tasks +type: Tutorial +--- + +## Introduction + +In this tutorial, you will learn how to quickly access the internet when running code on the Golem network. You will get familiar with the concept of Golem manifest, outbound, and some security policies that are in place to protect the providers from malicious code. + +## Prerequisites + +- Yagna service installed and running with the `try_golem` app-key configured ([see instructions](/docs/creators/tools/yagna/yagna-installation-for-requestors)). + +## Overview + +In this tutorial, you will create a requestor script that will download a code from the `ipfs.io` site to a provider. To achieve the goal you will use the outbound feature. + +The ipfs.io URL was selected as a target URL for the example, as it is included in the default provider’s whitelist. You can check [here](https://github.com/golemfactory/ya-installer-resources/tree/main/whitelist) for other entries. Please note that a provider can choose to add, remove, or completely wipe the whitelist. + +As the requestor needs to list all URLs they want to access in a manifest file, you need to create one and provide it when creating a new TaskExecutor. There is a CLI tool that we will use to create this manifest. + +You can read more about outbound feature [here](/docs/creators/javascript/guides/accessing-internet). + +Let’s code. + +## Initialize the project + +First, create a project directory and navigate there: + +```bash +mkdir outbound-example +cd outbound-example +``` + +Then initialise the project and install JS SDK. + +```bash +npm init +npm install @golem-sdk/task-executor +``` + +Next, install `Golem SDK CLI` - a companion tool that will facilitate manifest creation. + +```shell +npm install -g @golem-sdk/cli +``` + +## Manifest creation + +Once you have the project, open a terminal and run: + +```bash +golem-sdk manifest create golem/examples-outbound:latest +``` + +This will create a basic `manifest.json` file. You will use it to inform the provider what GVMI image we will be using. The manifest contains also your application version, application name, and description, all read from your `package.json` file (you can edit this information if you want). + +### Adding outbound configuration + +The next step is to configure our manifest, so you can access a public URL. The CLI also has a handy command that will take care of that for you: + +```bash +golem-sdk manifest net add-outbound https://ipfs.io +``` + +This has added `https://ipfs.io` as the URL you want to access from the provider node. The command can be run multiple times to add more URLs or you can pass them all at once. + +Now our manifest is ready, you can start coding the application. + +### Requestor script + +The application will be very simple. It will use `curl` to download an example image from IPFS to demonstrate how to enable and access the internet from the Golem SDK. + +Let’s start with a simple boilerplate, copy the following code to a javascript file: + +```javascript +import { TaskExecutor } from '@golem-sdk/task-executor' +import { readFile } from 'fs/promises' +;(async function main() { + const executor = await TaskExecutor.create({}) + + try { + // Your code goes here + } catch (err) { + console.error('The task failed due to', err) + } finally { + await executor.shutdown() + } +})() +``` + +The snippet above is using async/await to synchronize asynchronous calls, for simplicity and compatibility, we wrap all the code into an asynchronous main function. +The next thing to do is to correctly initialize the `TaskExecutor``. For this purpose, let's use the manifest file we’ve just created. + +At the top of the main function replace the executor initialization with the following: + +```javascript +// Load the manifest file. +const manifest = await readFile(`./manifest.json`) + +// Create and configure a TaskExecutor instance. +const executor = await TaskExecutor.create({ + capabilities: ['inet', 'manifest-support'], + yagnaOptions: { apiKey: 'try_golem' }, + manifest: manifest.toString('base64'), +}) +``` + +This is the most important part. +First, it is specifying additional requirements to the demand: + +- 'inet' - indicates the script requires outbound service +- 'manifest-support' - informs, that it will use manifest to specify a demand. + +Instead of providing an image tag or hash, it uses a manifest file that describes what will be run on providers. + +Please note the loaded manifest is encoded to base64. + +`yagnaOptions: { apiKey: 'try_golem' }` - defined the api key, to get access to the Yagna service. This particular key is available if you start the yagna according to the procedure provided in the installation example, you can also configure your unique keys. See [here](/docs/creators/javascript/examples/using-app-keys) for instructions. + +In this example, you will simply fetch an example file from IPFS using the `curl` command, available in our GVMI image. So first let’s save the URL near the top of the file (just after the imports): + +```javascript +import { TaskExecutor } from '@golem-sdk/task-executor' +import { readFile } from 'fs/promises' + +const url = + 'https://ipfs.io/ipfs/bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly' +``` + +And finally, let’s execute some code on the provider. You will run a single task on the provider, using the TaskExecutor.run() function. To make this work, put the following code in the try/catch block: + +```javascript +await executor.run(async (ctx) => { + const result = await ctx.run(`curl ${url} -o /golem/work/example.jpg`) + + console.log((await ctx.run('ls -l')).stdout) + if (result.result === 'Ok') { + console.log('File downloaded!') + } else { + console.error('Failed to download the file!', result.stderr) + } +}) +``` + +And that’s it! Now, make sure your yagna service is running and you can start this script. + +This is how the entire file should look like: + +```javascript +import { TaskExecutor } from '@golem-sdk/task-executor' +import { readFile } from 'fs/promises' + +const url = + 'https://ipfs.io/ipfs/bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly' + +;(async function main() { + // Load the manifest. + const manifest = await readFile(`./manifest.json`) + + // Create and configure a TaskExecutor instance. + const executor = await TaskExecutor.create({ + capabilities: ['inet', 'manifest-support'], + yagnaOptions: { apiKey: 'try_golem' }, + manifest: manifest.toString('base64'), + }) + + try { + await executor.run(async (ctx) => { + const result = await ctx.run(`curl ${url} -o /golem/work/example.jpg`) + + console.log((await ctx.run('ls -l')).stdout) + if (result.result === 'Ok') { + console.log('File downloaded!') + } else { + console.error('Failed to download the file!', result.stderr) + } + }) + } catch (err) { + console.error('The task failed due to', err) + } finally { + await executor.shutdown() + } +})() +``` + +You can run it now. In the output, you should see “File downloaded!” between log lines and the output of the `ls -l` command showing th size of the fole downloaded . That means the code works. + +{% docnavigation title="Next steps" %} + +- Another [outbound example](https://github.com/golemfactory/golem-js/tree/master/examples/external-request) + +{% /docnavigation %} + +{% docnavigation title="See also" %} + +- Default Golem [whitelist](https://github.com/golemfactory/ya-installer-resources/tree/main/whitelist) + +- More on the [Payload Manifest](/docs/golem/payload-manifest) + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/tutorials/building-custom-image.md b/src/pages/ja/docs/creators/javascript/tutorials/building-custom-image.md new file mode 100644 index 000000000..fbb9ca9a2 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/tutorials/building-custom-image.md @@ -0,0 +1,146 @@ +--- +title: Docker to Golem Image Conversion and Usage Tutorial +description: Step-by-step tutorial on creating a Docker image, converting it to a Golem-compatible format (GVMI, .gvmi), and integrating it into a requestor script. +type: Tutorial +--- + +## Introduction + +This article will go through the process of creating a Dockerfile, building a Docker image, then converting it to a Golem image and using it in a requestor script. + +## Prerequisites + +- Have Docker installed and Docker service available. If you don't have Docker installed follow these [instructions](https://www.docker.com/products/docker-desktop) +- Gvmkit-build installed ([see instructions](/docs/creators/tools/gvmkit/gvmkit-build-installation)) +- Yagna service installed and running with the `try_golem` app-key configured ([see instructions](/docs/creators/tools/yagna/yagna-installation-for-requestors)) + +## Creating the Dockerfile + +This is the simple `Dockerfile` we are going to use, using the `Node` base image, creating one volume, and setting the working directory. Simply create a file with the name `Dockerfile`, without any file extension, and paste the following contents: + +```dockerfile +FROM node:latest +WORKDIR /golem/work +VOLUME /golem/work +COPY Dockerfile /golem/info/description.txt +COPY Dockerfile /golem/work/info.txt +``` + +Note we copy the Dockerfile content into 2 different locations: + +- to /golem/info (this folder is not defined as VOLUME) +- and to /golem/work (this folder is defined as VOLUME) + +## Building the Docker image + +To build the Docker image from the `Dockerfile`, we can run the following command in the same directory (`.`) as the Dockerfile to build an image tagged `golem-node`: + +{% tabs %} +{% tab label="Linux" %} + +```bash +docker build -t golem-node . +``` + +{% /tab %} +{% tab label="macOS" %} + +```bash +docker build --platform linux/amd64 -t golem-node . +``` + +{% /tab %} +{% tab label="Windows" %} + +```bash +docker build -t golem-node . +``` + +{% /tab %} +{% /tabs %} + +The output should look like this: + +![Terminal output of building a docker image](/image_tutorial_build.png) + +{% alert level="info" %} + +Note that the image won't be turned into a file in the same directory. The location of the actual Docker image file depends on the Docker and your operating system version. Please consult the Docker manual for additional information. + +{% /alert %} + +## Converting from Docker to Golem and uploading it to the registry + +Now when you have a Docker image built, we can convert it to a Golem image. To save time, we will also upload it to the registry with the same command. To do this, you need to run the appropriate command that uses `gvmkit-build` to convert and push the image `golem-node` to the registry. + +{% alert level="info" %} + +If you do not have `gvmkit-build` installed please follow [installation intructions](/docs/creators/tools/gvmkit/gvmkit-build-installation). You can also use it without installation using `npx` or `pipx` commands. + +{% /alert %} + +{% tabs %} +{% tab label="JavaScript" %} + +```bash +gvmkit-build golem-node --push --nologin +``` + +{% /tab %} +{% tab label="Python" %} + +```bash +gvmkit-build golem-node --push --nologin +``` + +{% /tab %} +{% /tabs %} + +After running the command, you will see an output that looks like this: + +![Image showing the output of the command](/image_tutorial_upload.png) + +The hash is found after the `image link`, which in this case gives us the hash `8b238595299444d0733b41095f27fadd819a71d29002b614c665b27c`. If you ever lose your hash, you can always recover/re-generate it by running the same command again. + +## Using the image in a requestor script + +Let's use the newly created image in a requestor script and ensure this is the one we have just made. + +We need to prepare our environment: + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +We can now create our `index.mjs` requestor file, with the `package: "8b238595..."` matching our image hash. + +{% tabs %} +{% tab label="JavaScript" %} + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/tutorials/building-custom-image/index.mjs" language="javascript" /%} + +{% /tab %} +{% /tabs %} + +In the script, we specify that our task should use the newly created image (indicated by `hash`: `8b238595...`). We try to run two commands. The first one prints the content of the `decription.txt` file (it is a copy of the Dockerfile used to create the image). The second command should list the content of the /golem/work folder. We copied some files there as well (check the content of the `description.txt` file), but as /golem/work is defined as VOLUME and created as new when VM is started, this folder will be empty. + +## Running the script + +Run the following command after ensuring the Yagna service is running and configured correctly: + +`node index.mjs` + +You have successfully created and used your Golem image in a requestor script! + +![Image showing successfull use of a golem image in a script](/image_tutorial_upload.png) + +Note that the content of the `description.txt` file that was created in the /golem/info folder is accessible, while the /golem/work folder is empty. + +{% docnavigation title="Next steps" %} + +- Try your image in one of [examples](/docs/creators/javascript/examples)! + +{% /docnavigation %} diff --git a/src/pages/ja/docs/creators/javascript/tutorials/index.md b/src/pages/ja/docs/creators/javascript/tutorials/index.md new file mode 100644 index 000000000..bba72c842 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/tutorials/index.md @@ -0,0 +1,18 @@ +--- +description: List of the Golem JS SDK tutorials. +title: JS SDK Tutorials +type: Table of Contents +--- + +# Golem JS Tutorials + +JS tutorials are designed for developers who want to learn Golem concepts by a practical realization of proposed project challenges. +Here is a list of available tutorials and their content: + +| Tutorial | What will you achieve | What will you learn | Level | +| :-------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------- | +| [Quickstart Explained](/docs/creators/javascript/tutorials/quickstart-explained) | You will build the Quickstart example step by step. | You will learn the basic structure of the requestor script necessary to run a simple task on the Golem Network and how to modify the Quickstart example to fit your needs. | easy | +| [Parallel processing](/docs/creators/javascript/tutorials/running-parallel-tasks) | You will create a tool to recover passwords using the `hashcat` tool used in the password recovery process run in parallel on computers in the network. | You will learn how to compose complex tasks consisting of several steps and how to run tasks in parallel and process the results. You will also create your custom image. | easy | +| [Web example explained](/docs/creators/javascript/tutorials/running-in-browser) | Create a simple web page that will enable you to trigger tasks on the Golem Network in the browser context and display results and logs. | How to use the API directly from the browser context. It is useful when incorporating the Golem Network as a computation engine for your web app. | easy | +| [Creating custom Golem image](/docs/creators/javascript/tutorials/testing-golem-image) | You will create your own custom image. | How to create a Docker image, install the Golem conversion tool, and convert and publish your custom image. | easy, docker service required | +| [REST API example with Express.js](/docs/creators/javascript/tutorials/rest-api-with-express) | You will create a simple REST API that will allow you to send some text to the Golem Network and get back a text-to-speech result in the form of a WAV file. | How to use the Job API in a real-world scenario. | easy | diff --git a/src/pages/ja/docs/creators/javascript/tutorials/quickstart-explained.md b/src/pages/ja/docs/creators/javascript/tutorials/quickstart-explained.md new file mode 100644 index 000000000..41b5d67e0 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/tutorials/quickstart-explained.md @@ -0,0 +1,130 @@ +--- +title: Node.js Application Development on Golem Network +description: Learn to create a JavaScript application using the Golem Network with our tutorial where we explain the Quickstart example and steps for setting up Node.js projects and utilizing Task Executors. +pageTitle: Mastering Node.js on Golem Network - Interactive Tutorial for Developers +type: Tutorial +--- + +# JS Quickstart Explained + +## Introduction + +This tutorial will utilize the same example found in [Quickstart](/docs/creators/javascript/quickstarts/quickstart) and include thorough explanations. + +## Prerequisites + +Yagna service is installed and running with the `try_golem` app-key configured. + +## Setting up the project + +Create a project folder, initialize a Node.js project, and install the `@golem-sdk/task-executor` library. + +```bash +mkdir golem-example +cd golem-example +npm init +npm i @golem-sdk/task-executor +``` + +## JS script structure + +The basic structure of the script: + +```js +import { TaskExecutor } from '@golem-sdk/task-executor' +;(async () => { + //... Function body in here +})() +``` + +Here we do two things: + +- import TaskExecutor from @golem-sdk/task-executor and +- create IIAFE (Immediately Invoked Async Function Expression). It has an async function declaration because TaskExecutor provides async methods. + +## Utilizing Task Executor instance + +Inside the function body, there will be a sequence of 3 steps, that constitute the simplest Task Executor lifecycle. Task Executor is a primary object provided by our Task API. + +```js +import { TaskExecutor } from '@golem-sdk/task-executor' +;(async () => { + // 1. Create Task Executor Instance + const executor = await TaskExecutor.create({ + package: '529f7fdaf1cf46ce3126eb6bbcd3b213c314fe8fe884914f5d1106d4', + yagnaOptions: { apiKey: 'try_golem' }, + }) + + try { + // 2. Run the task + const result = + await executor.run(/*taskToRunOnProvider to be provided here */) + console.log('Task result:', result) + } catch (err) { + console.error('An error occurred:', err) + } finally { + // 3. Finish Task Executor + await executor.shutdown() + } + + console.log('Task result:', taskResult) +})() +``` + +In (1) we create a TaskExecutor Instance using a factory method. In this example, we use the minimal set of parameters: namely the hash indicating the image with Node.js installed - the image we will deploy on the provider and api-key value - a key that will give us access to `yagna` REST API. `yagna` is a service that connects us to the network. +We use api-key that was generated in the process of [Yagna installation](/docs/creators/tools/yagna/yagna-installation-for-requestors) + +```js +const executor = await TaskExecutor.create({ + package: '529f7fdaf1cf46ce3126eb6bbcd3b213c314fe8fe884914f5d1106d4', + yagnaOptions: { apiKey: 'try_golem' }, +}) +``` + +Next (2) we run the task. Here we use a run method that accepts a task function as its argument. We will define the task function in a moment. We store the result of the `executor.run()` in the `result` variable. + +There are other methods that allow you to execute tasks. They are briefly presented in [Task API Guide](/docs/creators/javascript/guides/task-model#main-task-api-features) and explained in [examples](/docs/creators/javascript/examples) section. + +```js +const result = await executor.run(taskToRunOnProvider) +``` + +Finally (3) we gracefully finish task executor: + +```js +await executor.shutdown() +``` + +## Defining task function + +Let’s see how the task is defined and replace the `taskToRunOnProvider` placeholder we used in the previous step. + +The task is defined as a function that implements the Worker interface. This function will get its parameter `workerContext` from the executor. It is an object that lets you run your commands in the scope of one task on one provider. + +```js +const taskToRunOnProvider = async (ctx) => // task is defined here; +``` + +Our task in this example is simple and consists of a single command: namely `node -v`. We will use the async method `run()` of workerContext `ctx`. The output of this method is a `Promise` of a `result` object, once it is resolved it contains the output of the command we run, available as a `stdout` property. + +```js +const taskToRunOnProvider = async (ctx) => (await ctx.run('node -v')).stdout +``` + +The output of the task function is passed to `executor.run()` and assigned to taskResult. +Finally, we print it to the console. + +{% codefromgithub url="https://raw.githubusercontent.com/golemfactory/golem-sdk-task-executor/master/examples/docs-examples/quickstarts/quickstart/requestor.mjs" language="javascript" /%} + +## Summary + +We had created the simplest requestor script, that ran a single command on a remote computer. +To achieve it we had: + +- imported @golem-sdk/task-executor lib +- utilized Immediately Invoked Async Function Expression +- created Task Executor +- defined a task as a function that runs our command +- finally read the command result from the result object and provide it to the user + +In this example, we ran a simple command (node -v) in a shell on the remote computer. You can run other executable programs in more interesting scenarios. See other examples for more advanced use cases. diff --git a/src/pages/ja/docs/creators/javascript/tutorials/rest-api-with-express.md b/src/pages/ja/docs/creators/javascript/tutorials/rest-api-with-express.md new file mode 100644 index 000000000..bf25c29de --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/tutorials/rest-api-with-express.md @@ -0,0 +1,376 @@ +--- +title: Creating a Text-to-Speech API with Express.js and Golem Network +pageTitle: Build a REST API for Text-to-Speech Conversion Using Express.js and Golem Network - Step-by-Step Tutorial +description: Learn to build a REST API with Express.js utilizing the Golem Network for text-to-speech processing. A practical tutorial. +type: Tutorial +--- + +# REST API example with Express.js + +This tutorial will guide you through the process of creating a REST API with Express.js that uses the Golem Network to process data. The goal is to show you how to use the [Job API](/docs/creators/javascript/guides/retrievable-tasks) in a real-world scenario. + +## What will you build? + +You will create a simple REST API that will allow you to send some text to the Golem Network and get back a text-to-speech result in the form of a WAV file. + +## Prerequisites + +This tutorial assumes that you have already installed Yagna and have it running in the background. If you haven't done so yet, please follow the instructions in [this tutorial](/docs/creators/tools/yagna/yagna-installation-for-requestors) before proceeding. + +## Setting up the project + +First, create a new directory for your project and initialize a new Node.js project in it: + +```bash +mkdir golem-express +cd golem-express +npm init -y +npm install @golem-sdk/golem-js express +``` + +## Creating the API + +Let's start by creating a new file called `index.mjs` and pasting the following code into it: + +```js +import express from 'express' + +const app = express() +const port = 3000 + +app.use(express.text()) + +app.get('/', (req, res) => { + res.send('Hello World!') +}) + +app.listen(port, () => { + console.log(`Example app listening at http://localhost:${port}`) +}) +``` + +Start your app by running `node index.mjs` and run `curl http://localhost:3000` in another terminal window. You should see the following output: + +```bash +Hello World! +``` + +So far, so good! Stop the app by pressing `Ctrl+C` and let's move on to the next step. + +## Connecting to the Golem Network + +Now let's connect to the Golem Network. First, import the `GolemNetwork` class from `@golem-sdk/golem-js` and create a new instance of it. + +```js +import { GolemNetwork } from '@golem-sdk/golem-js' + +const golemClient = new GolemNetwork({ + yagna: { + apiKey: 'try_golem', + }, +}) +await golemClient + .init() + .then(() => { + console.log('Connected to the Golem Network!') + }) + .catch((error) => { + console.error('Failed to connect to the Golem Network:', error) + process.exit(1) + }) +``` + +Let's also add a handler for the `SIGINT` signal so that we can close the connection to the Golem Network and cancel all running jobs when the user presses `Ctrl+C`: + +```js +process.on('SIGINT', async () => { + // cancel and cleanup all running jobs + await golemClient.close() + process.exit(0) +}) +``` + +## Creating a retrievable task + +Now it's time for the fun part! Let's add a new endpoint to our API that will take some text from the request body and create a new job on the Golem Network. To do that, we will use the `createJob()` method. This method will give us a `Job` object that we can use to get the state of the job and its results later. On the provider side, we will run the `espeak` command to convert the text to speech, save it to a `.wav` file and download that file to your local file system with the `downloadFile()` method. We will give the file a random name to avoid collisions. + +The image we will use is `severyn/espeak:latest`, provided by one of our community members. It contains the `espeak` command, which we will use to convert the text to speech. If you're feeling adventurous, [you can create your own image](/docs/creators/tools/gvmkit/converting-docker-image-to-golem-format#building-your-docker-image) and install [espeak](https://espeak.sourceforge.net/) on it. + +```js +app.post('/tts', async (req, res) => { + if (!req.body) { + res.status(400).send('Missing text parameter') + return + } + const job = golemClient.createJob({ + package: { + imageTag: 'severyn/espeak:latest', + }, + }) + + job.startWork(async (ctx) => { + const fileName = `${Math.random().toString(36).slice(2)}.wav` + await ctx + .beginBatch() + .run(`espeak "${req.body}" -w /golem/output/output.wav`) + .downloadFile('/golem/output/output.wav', `public/${fileName}`) + .end() + return fileName + }) + res.send(`Job started! ID: ${job.id}`) +}) +``` + +The `Job` api makes it easy to react to events that happen during the execution of the job. Let's update our code and add some event handlers to log the events to the console: + +```js +app.post('/tts', async (req, res) => { + if (!req.body) { + res.status(400).send('Missing text parameter') + return + } + const job = golemClient.createJob({ + package: { + imageTag: 'severyn/espeak:latest', + }, + }) + + job.events.on('created', () => { + console.log('Job created') + }) + job.events.on('started', () => { + console.log('Job started') + }) + job.events.on('error', () => { + console.log('Job failed', job.error) + }) + job.events.on('success', () => { + console.log('Job succeeded', job.results) + }) + + job.startWork(async (ctx) => { + const fileName = `${Math.random().toString(36).slice(2)}.wav` + await ctx + .beginBatch() + .run(`espeak "${req.body}" -w /golem/output/output.wav`) + .downloadFile('/golem/output/output.wav', `public/${fileName}`) + .end() + return fileName + }) + res.send(`Job started! ID: ${job.id}`) +}) +``` + +## Getting the job state + +Now let's add another endpoint that will allow us to get the state of the job. We can get the job by its ID with the `getJobById()` method. Then we can simply return the state of the job to the user. + +```js +app.get('/tts/:id', async (req, res) => { + const job = golemClient.getJobById(req.params.id) + if (!job) { + res.status(404).send('Job not found') + return + } + res.send("Job's state is: " + job.state) +}) +``` + +## Getting the job results + +Finally, let's add an endpoint that will allow us to get the results of the job. Here we will use the `getJobById()` method again to get the job by its ID. In case the job is still running, we will wait for it to finish with the `waitForResult()` method. Then we will get the results of the job with the `results` property and return them to the user. + +Let's also serve the files in the `/public` directory so that the user can access them. We will use the `express.static()` method for that. + +```js +// serve files in the /public directory +app.use('/results', express.static('public')) + +app.get('/tts/:id/results', async (req, res) => { + const job = golemClient.getJobById(req.params.id) + if (!job) { + res.status(404).send('Job not found') + return + } + if (job.state !== JobState.Done) { + await job.waitForResult() + } + + const results = await job.results + res.send( + `Job completed successfully! Open the following link in your browser to listen to the result: http://localhost:${port}/results/${results}` + ) +}) +``` + +## Testing the app + +We're done with the code! Let's start the app and test it. + +First, let's start the server: + +```bash +node index.mjs +``` + +### Sending a POST request + +Open a new terminal window. Let's send a POST request to the `/tts` endpoint. Feel free to replace `Hello Golem` with any text you want: + +```bash +curl \ +    --header "Content-Type: text/plain" \ +    --request POST \ +    --data "Hello Golem" \ +    http://localhost:3000/tts +``` + +You should see the output: + +```bash +Job started! ID: +``` + +Make sure to write down the job ID, as we will need it in the next step. + +### Sending a GET request to get the job state + +Now let's send a GET request to the `/tts/` endpoint to get the state of the job: + +```bash +curl http://localhost:3000/tts/ +``` + +You should see the output: + +``` +pending +``` + +Wait a few seconds and send the same request again. You should see the output: + +``` +done +``` + +### Sending a GET request to get the job results + +Finally, let's send a GET request to the `/tts//results` endpoint to get the results of the job: + +```bash +curl http://localhost:3000/tts//results +``` + +You should see the output: + +``` +Job completed successfully! Open the following link in your browser to listen to the result: http://localhost:3000/results/ +``` + +Open the link in your browser, and you should hear the text you sent to the API! + +Congratulations! You have just created a REST API that uses the Golem Network to process data! 🎉 + +## Full code + +Here's the full code of the `index.mjs` file: + +```js +import express from 'express' +import { GolemNetwork, JobState } from '@golem-sdk/golem-js' + +const app = express() +const port = 3000 + +app.use(express.text()) + +const golemClient = new GolemNetwork({ + yagna: { + apiKey: 'try_golem', + }, +}) + +await golemClient + .init() + .then(() => { + console.log('Connected to the Golem Network!') + }) + .catch((error) => { + console.error('Failed to connect to the Golem Network:', error) + process.exit(1) + }) + +app.post('/tts', async (req, res) => { + if (!req.body) { + res.status(400).send('Missing text parameter') + return + } + const job = golemClient.createJob({ + package: { + imageTag: 'severyn/espeak:latest', + }, + }) + + job.events.on('created', () => { + console.log('Job created') + }) + job.events.on('started', () => { + console.log('Job started') + }) + job.events.on('error', () => { + console.log('Job failed', job.error) + }) + job.events.on('success', () => { + console.log('Job succeeded', job.results) + }) + + job.startWork(async (ctx) => { + const fileName = `${Math.random().toString(36).slice(2)}.wav` + await ctx + .beginBatch() + .run(`espeak "${req.body}" -w /golem/output/output.wav`) + .downloadFile('/golem/output/output.wav', `public/${fileName}`) + .end() + return fileName + }) + res.send(`Job started! ID: ${job.id}`) +}) + +app.get('/tts/:id', async (req, res) => { + const job = golemClient.getJobById(req.params.id) + if (!job) { + res.status(404).send('Job not found') + return + } + res.send("Job's state is: " + job.state) +}) + +// serve files in the /public directory +app.use('/results', express.static('public')) + +app.get('/tts/:id/results', async (req, res) => { + const job = golemClient.getJobById(req.params.id) + if (!job) { + res.status(404).send('Job not found') + return + } + if (job.state !== JobState.Done) { + await job.waitForResult() + } + + const results = await job.results + res.send( + `Job completed successfully! Open the following link in your browser to listen to the result: http://localhost:${port}/results/${results}` + ) +}) + +app.listen(port, () => { + console.log(`Example app listening at http://localhost:${port}`) +}) + +process.on('SIGINT', async () => { + // cancel and cleanup all running jobs + await golemClient.close() + process.exit(0) +}) +``` diff --git a/src/pages/ja/docs/creators/javascript/tutorials/running-in-browser.md b/src/pages/ja/docs/creators/javascript/tutorials/running-in-browser.md new file mode 100644 index 000000000..514a6a049 --- /dev/null +++ b/src/pages/ja/docs/creators/javascript/tutorials/running-in-browser.md @@ -0,0 +1,260 @@ +--- +description: Step-by-step tutorial on integrating Golem network with a browser, covering installation, setup, and script execution. +title: Golem in browser Quickstart explained +type: Tutorial +--- + +# Golem in browser Quickstart explained + +## Introduction + +In this tutorial, you will create a simple web page that will trigger your requestor script and display the results and output logs in the browser window. + +In the Quickstart, the js script is in an external file. In this tutorial we will keep both HTML and js script in the same file. + +## Prerequisites + +Before proceeding, you'll need to install and launch the Yagna service, version 0.13.0 or later. Installation instructions can be found through the manual Yagna installation guide available [here](/docs/creators/tools/yagna/yagna-installation-for-requestors). + +In addition, you need to start Yagna with a parameter that allows you to handle REST API requests with a CORS policy. You can do this by running the following command: + +{% tabs %} + +{% tab label="MacOS / Linux" %} + +```shell +yagna service run --api-allow-origin='http://localhost:8080' +``` + +{% /tab %} +{% tab label="Windows" %} + +```shell +yagna service run --api-allow-origin=http://localhost:8080 +``` + +{% /tab %} +{% /tabs %} + +{% alert level="warning" %} + +The `--api-allow-origin` value should be set to the URL where your web application will be served. +In this example, we will use `http-server`. + +{% /alert %} + +## Setting up the project + +```bash +mkdir web_golem +cd web_golem + +``` + +next + +```shell +npm install --global http-server +``` + +This will install the `http-server` utility to host our web page, where we will run our Golem app. + +## HTML page + +Next, we'll create the main `index.html` file with a minimal layout: + +```html + + + + + WebRequestor Task API + + +

WebRequestor - Hello World

+
+
+

Options

+
+
+ + +
+
+ + +
+
+

Actions

+
+
+ +
+
+
+

Results

+
    +
    +
    +
    +
    +

    Logs

    +
      +
      +
      +
      + + + + +``` + +In this layout, there are three elements: + +- A "Echo Hello World" button, which executes the script on Golem +- A "Results" container, which displays the results +- A "Logs" container, which displays the API logs + +Take note of the ` +``` + +### Task Executor + +When the user presses the `Echo Hello World` button, the `run()` function will be invoked. The body of this function should contain the typical sequence necessary to run TaskExecutor. We will first create it, then execute the task function, and finally, we will end it. + +Note that the `create()` method received an additional 3 parameters: + +- `package` identifies the image that we want to run on a provider, +- `apiKey` is the key that enables our script to use the Yagna REST API, +- `logger` is a function that the SDK will use for logging. We'll define it short + +```html + +``` + +The body of the `executor.run()` method is identical as in the case of the Node.js executor script: +It is a task function that receives a worker context. It is designed to execute the command `echo 'Hello World'`. The `ctx.run()` method returns a `Promise` which resolves to a result object. This object has a `stdout` property that holds the output of our command. + +The result is passed as an input parameter of the `appendResults()` function that will be responsible for displaying the result on the screen. + +## Getting results + +Now let's create the `appendResults()` function which will put the output of our application into the designated `results` container. + +```html + +``` + +## Getting logs + +The TaskExecutor offers an optional `logger` parameter. It will accept an object that implements the [Logger](/docs/golem-js/reference/interfaces/utils_logger_logger.Logger) interface. The `logger` will utilize an `appendLog` function to add applicable records to the log storage area. + +```html + +``` + +## Run the script + +Now that we have all the necessary components defined, the code between `