├── .DS_Store ├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── .gitpod.yml ├── .vite └── deps_temp_801fad7e │ └── package.json ├── CONTRIBUTING.md ├── README.md └── docs ├── .gitignore ├── .prettierignore ├── .yarnrc.yml ├── deploy.mjs ├── languages ├── README.md ├── def.js ├── strings │ ├── en.json │ ├── es.json │ ├── id.json │ └── zh.json └── utils.js ├── package.json ├── src ├── .vuepress │ ├── client.js │ ├── components │ │ ├── FeaturedContributors.vue │ │ ├── I18NRouterLink.vue │ │ ├── Navbar.vue │ │ ├── Onboarding.vue │ │ ├── Page.vue │ │ ├── PageMeta.vue │ │ ├── Sidebar.vue │ │ ├── ToggleLanguageButton.vue │ │ ├── ToggleSidebarButton.vue │ │ └── Topbar.vue │ ├── composables │ │ ├── useContributors.js │ │ └── useI18N.js │ ├── config.js │ ├── layouts │ │ └── Layout.vue │ ├── public │ │ ├── Permaweb_Cookbook.ico │ │ ├── code.svg │ │ ├── cookbook.png │ │ ├── cookbook.svg │ │ ├── encryption-diagram.png │ │ ├── entity-relationship-diagram.png │ │ ├── guides.svg │ │ ├── hello_world.svg │ │ ├── key.svg │ │ ├── logo.svg │ │ ├── private-drive-schema.png │ │ └── public-drive-schema.png │ ├── sidebar.js │ └── styles │ │ ├── bootstrap.scss │ │ └── index.scss ├── community │ └── README.md ├── concepts │ ├── README.md │ ├── arfs │ │ ├── arfs.md │ │ ├── content-types.md │ │ ├── data-model.md │ │ ├── entity-types.md │ │ ├── privacy.md │ │ └── schema-diagrams.md │ ├── arns.md │ ├── atomic-tokens.md │ ├── bundlers.md │ ├── bundles.md │ ├── gateways.md │ ├── keyfiles-and-wallets.md │ ├── manifests.md │ ├── permaweb.md │ ├── permawebApplications.md │ ├── post-transactions.md │ ├── psts.md │ ├── queryTransactions.md │ ├── smartweave.md │ ├── tags.md │ ├── transaction-data.md │ └── vouch.md ├── config │ └── README.md ├── es │ ├── concepts │ │ ├── README.md │ │ ├── arns.md │ │ ├── atomic-tokens.md │ │ ├── bundlers.md │ │ ├── bundles.md │ │ ├── gateways.md │ │ ├── keyfiles-and-wallets.md │ │ ├── manifests.md │ │ ├── permaweb.md │ │ ├── permawebApplications.md │ │ ├── post-transactions.md │ │ ├── psts.md │ │ ├── queryTransactions.md │ │ ├── smartweave.md │ │ ├── tags.md │ │ ├── transaction-data.md │ │ └── vouch.md │ ├── getting-started │ │ ├── README.md │ │ ├── contributing.md │ │ ├── quick-starts │ │ │ ├── hw-cli.md │ │ │ ├── hw-code.md │ │ │ ├── hw-no-code.md │ │ │ └── hw-nodejs.md │ │ └── welcome.md │ ├── guides │ │ ├── README.md │ │ ├── arprofile.md │ │ ├── atomic-tokens │ │ │ └── intro.md │ │ ├── deploying-manifests │ │ │ ├── ardrive.md │ │ │ ├── arweave-app.md │ │ │ ├── deployingManifests.md │ │ │ └── irys.md │ │ ├── deploying-psts.md │ │ ├── deployment │ │ │ ├── arkb.md │ │ │ ├── github-action.md │ │ │ └── irys-cli.md │ │ ├── dns-integration │ │ │ ├── server-side.md │ │ │ └── spheron.md │ │ ├── exm │ │ │ ├── api.md │ │ │ ├── intro.md │ │ │ └── js-sdk │ │ │ │ ├── sdk-deploy.md │ │ │ │ ├── sdk-intro.md │ │ │ │ ├── sdk-read.md │ │ │ │ └── sdk-write.md │ │ ├── http-api.md │ │ ├── posting-transactions │ │ │ ├── README.md │ │ │ ├── arweave-js.md │ │ │ ├── dispatch.md │ │ │ └── irys.md │ │ ├── querying-arweave │ │ │ ├── ar-gql.md │ │ │ ├── ardb.md │ │ │ ├── queryingArweave.md │ │ │ └── search-indexing-service.md │ │ ├── smartweave │ │ │ └── warp │ │ │ │ ├── deploying-contracts.md │ │ │ │ ├── evolve.md │ │ │ │ ├── intro.md │ │ │ │ ├── readstate.md │ │ │ │ └── write-interactions.md │ │ ├── testing │ │ │ └── arlocal.md │ │ ├── using-vue.md │ │ └── vouch.md │ ├── index.md │ ├── kits │ │ ├── README.md │ │ ├── react │ │ │ ├── create-react-app.md │ │ │ ├── index.md │ │ │ └── vite.md │ │ ├── svelte │ │ │ ├── index.md │ │ │ ├── minimal.md │ │ │ └── vite.md │ │ └── vue │ │ │ ├── create-vue.md │ │ │ └── index.md │ └── references │ │ ├── README.md │ │ ├── bundling.md │ │ ├── gql.md │ │ └── http-api.md ├── getting-started │ ├── README.md │ ├── contributing.md │ ├── quick-starts │ │ ├── hw-cli.md │ │ ├── hw-code.md │ │ ├── hw-no-code.md │ │ └── hw-nodejs.md │ └── welcome.md ├── guides │ ├── README.md │ ├── arprofile.md │ ├── atomic-tokens │ │ └── intro.md │ ├── deploying-manifests │ │ ├── ardrive.md │ │ ├── arseeding-js.md │ │ ├── arweave-app.md │ │ ├── deployingManifests.md │ │ └── turbo.md │ ├── deploying-psts.md │ ├── deployment │ │ ├── arkb.md │ │ ├── github-action.md │ │ └── index.md │ ├── dns-integration │ │ ├── server-side.md │ │ └── spheron.md │ ├── exm │ │ ├── api.md │ │ ├── intro.md │ │ └── js-sdk │ │ │ ├── sdk-deploy.md │ │ │ ├── sdk-intro.md │ │ │ ├── sdk-read.md │ │ │ └── sdk-write.md │ ├── http-api.md │ ├── posting-transactions │ │ ├── README.md │ │ ├── arseeding-js.md │ │ ├── arweave-js.md │ │ ├── dispatch.md │ │ └── turbo.md │ ├── querying-arweave │ │ ├── ar-gql.md │ │ ├── ardb.md │ │ ├── queryingArweave.md │ │ └── search-indexing-service.md │ ├── smartweave │ │ ├── atomic-assets │ │ │ ├── ardrive-cli.md │ │ │ └── index.md │ │ └── warp │ │ │ ├── deploying-contracts.md │ │ │ ├── evolve.md │ │ │ ├── intro.md │ │ │ ├── readstate.md │ │ │ └── write-interactions.md │ ├── testing │ │ └── arlocal.md │ ├── using-vue.md │ └── vouch.md ├── id │ ├── concepts │ │ ├── README.md │ │ ├── arns.md │ │ ├── atomic-tokens.md │ │ ├── bundlers.md │ │ ├── bundles.md │ │ ├── gateways.md │ │ ├── keyfiles-and-wallets.md │ │ ├── manifests.md │ │ ├── permaweb.md │ │ ├── permawebApplications.md │ │ ├── post-transactions.md │ │ ├── psts.md │ │ ├── queryTransactions.md │ │ ├── smartweave.md │ │ ├── tags.md │ │ ├── transaction-data.md │ │ └── vouch.md │ ├── getting-started │ │ ├── README.md │ │ ├── contributing.md │ │ ├── quick-starts │ │ │ ├── hw-cli.md │ │ │ ├── hw-code.md │ │ │ ├── hw-no-code.md │ │ │ └── hw-nodejs.md │ │ └── welcome.md │ ├── guides │ │ ├── README.md │ │ ├── arprofile.md │ │ ├── atomic-tokens │ │ │ └── intro.md │ │ ├── deploying-manifests │ │ │ ├── ardrive.md │ │ │ ├── arweave-app.md │ │ │ ├── deployingManifests.md │ │ │ └── irys.md │ │ ├── deploying-psts.md │ │ ├── deployment │ │ │ ├── arkb.md │ │ │ ├── github-action.md │ │ │ └── irys-cli.md │ │ ├── dns-integration │ │ │ ├── server-side.md │ │ │ └── spheron.md │ │ ├── exm │ │ │ ├── api.md │ │ │ ├── intro.md │ │ │ └── js-sdk │ │ │ │ ├── sdk-deploy.md │ │ │ │ ├── sdk-intro.md │ │ │ │ ├── sdk-read.md │ │ │ │ └── sdk-write.md │ │ ├── http-api.md │ │ ├── posting-transactions │ │ │ ├── README.md │ │ │ ├── arweave-js.md │ │ │ ├── dispatch.md │ │ │ └── irys.md │ │ ├── querying-arweave │ │ │ ├── ar-gql.md │ │ │ ├── ardb.md │ │ │ ├── queryingArweave.md │ │ │ └── search-indexing-service.md │ │ ├── smartweave │ │ │ └── warp │ │ │ │ ├── deploying-contracts.md │ │ │ │ ├── evolve.md │ │ │ │ ├── intro.md │ │ │ │ ├── readstate.md │ │ │ │ └── write-interactions.md │ │ ├── testing │ │ │ └── arlocal.md │ │ ├── using-vue.md │ │ └── vouch.md │ ├── index.md │ ├── kits │ │ ├── README.md │ │ ├── react │ │ │ ├── create-react-app.md │ │ │ ├── index.md │ │ │ └── vite.md │ │ ├── svelte │ │ │ ├── index.md │ │ │ ├── minimal.md │ │ │ └── vite.md │ │ └── vue │ │ │ ├── create-vue.md │ │ │ └── index.md │ └── references │ │ ├── README.md │ │ ├── bundling.md │ │ ├── gql.md │ │ └── http-api.md ├── images │ ├── ardrive-manifests.png │ ├── ardrive-pst.png │ ├── arweaveapp-manifest.png │ ├── arweaveapp-tags.png │ ├── exm-create-token.png │ ├── exm-lazy-evaluation.png │ ├── exm-serverless-functions.png │ ├── exm-sign-in-options.png │ ├── exm-verifiable-computing.png │ ├── provenace-toolkit-layout.png │ └── pst-deployment.png ├── index.md ├── kits │ ├── README.md │ ├── react │ │ ├── create-react-app.md │ │ ├── index.md │ │ ├── turbo.md │ │ └── vite.md │ ├── svelte │ │ ├── index.md │ │ ├── minimal.md │ │ └── vite.md │ └── vue │ │ ├── create-vue.md │ │ └── index.md ├── legacy │ └── README.md ├── references │ ├── README.md │ ├── bundling.md │ ├── gql.md │ └── http-api.md └── zh │ ├── concepts │ ├── README.md │ ├── arns.md │ ├── atomic-tokens.md │ ├── bundlers.md │ ├── bundles.md │ ├── gateways.md │ ├── keyfiles-and-wallets.md │ ├── manifests.md │ ├── permaweb.md │ ├── permawebApplications.md │ ├── post-transactions.md │ ├── psts.md │ ├── queryTransactions.md │ ├── smartweave.md │ ├── tags.md │ ├── transaction-data.md │ └── vouch.md │ ├── getting-started │ ├── README.md │ ├── contributing.md │ ├── quick-starts │ │ ├── hw-cli.md │ │ ├── hw-code.md │ │ ├── hw-no-code.md │ │ └── hw-nodejs.md │ └── welcome.md │ ├── guides │ ├── README.md │ ├── arprofile.md │ ├── atomic-tokens │ │ └── intro.md │ ├── deploying-manifests │ │ ├── ardrive.md │ │ ├── arseeding-js.md │ │ ├── arweave-app.md │ │ ├── deployingManifests.md │ │ └── irys.md │ ├── deploying-psts.md │ ├── deployment │ │ ├── arkb.md │ │ ├── github-action.md │ │ └── irys-cli.md │ ├── dns-integration │ │ ├── server-side.md │ │ └── spheron.md │ ├── exm │ │ ├── api.md │ │ ├── intro.md │ │ └── js-sdk │ │ │ ├── sdk-deploy.md │ │ │ ├── sdk-intro.md │ │ │ ├── sdk-read.md │ │ │ └── sdk-write.md │ ├── http-api.md │ ├── posting-transactions │ │ ├── README.md │ │ ├── arseeding-js.md │ │ ├── arweave-js.md │ │ ├── dispatch.md │ │ └── irys.md │ ├── querying-arweave │ │ ├── ar-gql.md │ │ ├── ardb.md │ │ ├── queryingArweave.md │ │ └── search-indexing-service.md │ ├── smartweave │ │ └── warp │ │ │ ├── deploying-contracts.md │ │ │ ├── evolve.md │ │ │ ├── intro.md │ │ │ ├── readstate.md │ │ │ └── write-interactions.md │ ├── testing │ │ └── arlocal.md │ ├── using-vue.md │ └── vouch.md │ ├── index.md │ ├── kits │ ├── README.md │ ├── react │ │ ├── create-react-app.md │ │ ├── index.md │ │ └── vite.md │ ├── svelte │ │ ├── index.md │ │ ├── minimal.md │ │ └── vite.md │ └── vue │ │ ├── create-vue.md │ │ └── index.md │ └── references │ ├── README.md │ ├── bundling.md │ ├── gql.md │ └── http-api.md ├── translateAction.js ├── translateLocal.js ├── yarn-error.log └── yarn.lock /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/.DS_Store -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: publish cookbook 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: ⬇️ Checkout repo 13 | uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 0 16 | - name: ⎔ Setup Node 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 18.x 20 | - name: 📥 Download deps 21 | run: | 22 | cd docs 23 | yarn 24 | - name: 🛠 Build Docs 25 | id: build_artifacts 26 | run: | 27 | cd docs 28 | yarn build 29 | 30 | echo "artifacts_output_dir=src/.vuepress/dist" >> $GITHUB_OUTPUT 31 | env: 32 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} 33 | SPECIAL_ACCESS_TOKEN: ${{ secrets.SPECIAL_ACCESS_TOKEN }} 34 | - name: 💾 Publish to Arweave 35 | id: publish_artifacts 36 | run: | 37 | cd docs 38 | npx permaweb-deploy \ 39 | --ant-process=${ANT_PROCESS} \ 40 | --undername=${UNDERNAME} \ 41 | --deploy-folder=${ARTIFACTS_OUTPUT_DIR} 42 | env: 43 | DEPLOY_KEY: ${{ secrets.COOKBOOK }} 44 | ARTIFACTS_OUTPUT_DIR: ${{ steps.build_artifacts.outputs.artifacts_output_dir }} 45 | ANT_PROCESS: tP8uMeEQR-zodP_jHRyLJf1K7TZtACUsBrn8wdYlGuc 46 | UNDERNAME: "@" 47 | - name: Discord Notification 48 | uses: Ilshidur/action-discord@master 49 | env: 50 | DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} 51 | with: 52 | args: "The project {{ EVENT_PAYLOAD.repository.full_name }} has been deployed." 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | wallet.json 2 | package-lock.json 3 | 4 | .env -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | # List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/ 2 | tasks: 3 | - init: cd docs && yarn # runs during prebuild 4 | command: yarn dev 5 | 6 | # List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/ 7 | ports: 8 | - port: 8080 9 | onOpen: open-browser 10 | visibility: public 11 | -------------------------------------------------------------------------------- /.vite/deps_temp_801fad7e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Permaweb Cookbook 2 | 3 | The Permaweb Cookbook is meant to house small digestible code snippets 4 | for someone that has no experience with blockchain or Permaweb to be able 5 | to grab and go. 6 | 7 | ## Contributing 8 | 9 | The Cookbook is welcome to any and all contributions. Please refer to 10 | the project's style when contributing new snippets of code. 11 | 12 | ### Structure 13 | 14 | Currently we have "topics" under `/docs` and the code for those topics. 15 | 16 | ### References 17 | 18 | References are an overarching topic with a list of references of how to do 19 | things under that topic. The general structure is the following: 20 | 21 | ``` 22 | Code Reference Title 23 | 24 | Short Summary 25 | 26 | Code Snippet 27 | ``` 28 | 29 | ### Guides 30 | 31 | Guides are longer form informational documentation on various topics. 32 | The general structure for writing a guide is the following: 33 | 34 | ``` 35 | Brief Summary/TLDR 36 | 37 | Fact Sheet 38 | 39 | Deep Dive 40 | 41 | Other Resources 42 | ``` 43 | 44 | ### Building 45 | 46 | You need to have node v16 installed - https://nodejs.org 47 | 48 | ```sh 49 | cd docs 50 | yarn 51 | yarn dev 52 | ``` 53 | 54 | ### Translation 55 | 56 | Learn more about translating the cookbook [here](./docs/languages/README.md) 57 | 58 | ### Audit 59 | 60 | If you find a tool or guide out of date, please create an issue on the project board so that it can be removed or updated. 61 | 62 | ### Committing 63 | 64 | We are using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) 65 | for this repository. 66 | 67 | To choose a task or make your own, do the following: 68 | 69 | 1. [Add an issue](https://github.com/twilson63/permaweb-cookbook/issues/new) for the task and assign it to yourself or comment on the issue 70 | 2. Make a draft PR referencing the issue. 71 | 72 | The general flow for making a contribution: 73 | 74 | 1. Fork the repo on GitHub 75 | 2. Clone the project to your own machine 76 | 3. Commit changes to your own branch 77 | 4. Push your work back up to your fork 78 | 5. Submit a Pull request so that we can review your changes 79 | 80 | **NOTE**: Be sure to merge the latest from "upstream" before making a 81 | pull request! 82 | 83 | You can find tasks on the [project board](https://github.com/users/twilson63/projects/2) 84 | or create an issue and assign it to yourself. 85 | 86 | Happy Cooking! 87 | 88 | ## Deploy Instructions 89 | 90 | ```sh 91 | touch wallet.json 92 | # add wallet info 93 | cd docs 94 | yarn deploy 95 | ``` 96 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | pids 2 | logs 3 | node_modules 4 | npm-debug.log 5 | coverage/ 6 | run 7 | dist 8 | .DS_Store 9 | .nyc_output 10 | .basement 11 | config.local.js 12 | basement_dist 13 | .cache 14 | .temp 15 | .yarn 16 | *.lock 17 | .env* -------------------------------------------------------------------------------- /docs/.prettierignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .temp 3 | dist 4 | 5 | package.json 6 | -------------------------------------------------------------------------------- /docs/.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | -------------------------------------------------------------------------------- /docs/deploy.mjs: -------------------------------------------------------------------------------- 1 | import Bundlr from "@bundlr-network/client"; 2 | import { WarpFactory, defaultCacheOptions } from "warp-contracts"; 3 | import fs from "fs"; 4 | import Arweave from "arweave"; 5 | 6 | const ANT = "YcUbL7_j2DLxvMX0dqOu8N73mrcCRzovsE5Mw22uLmc"; 7 | const arweave = Arweave.init({ host: "arweave.net", port: 443, protocol: "https" }); 8 | //const jwk = JSON.parse(fs.readFileSync('../wallet.json', 'utf-8')) 9 | const jwk = JSON.parse(Buffer.from(process.env.COOKBOOK, "base64").toString("utf-8")); 10 | 11 | const bundlr = new Bundlr.default("https://node2.irys.xyz", "arweave", jwk); 12 | const warp = WarpFactory.custom(arweave, defaultCacheOptions, "mainnet").useArweaveGateway().build(); 13 | 14 | const contract = warp.contract(ANT).connect(jwk); 15 | // upload folder 16 | const result = await bundlr.uploadFolder("./src/.vuepress/dist", { 17 | indexFile: "index.html", 18 | }); 19 | console.log('manifest id:', result.id) 20 | 21 | // update ANT 22 | 23 | await contract.writeInteraction({ 24 | function: "setRecord", 25 | subDomain: "@", 26 | transactionId: result.id, 27 | }); 28 | 29 | console.log("Deployed Cookbook, please wait 20 - 30 minutes for ArNS to update!"); 30 | -------------------------------------------------------------------------------- /docs/languages/README.md: -------------------------------------------------------------------------------- 1 | # Translation 2 | 3 | ## Add a new language 4 | To add a new language, add an object to the `language` array in `def.js`. The structure of the object is as follow: 5 | ```js 6 | { 7 | display: "Español", // Name of the language displayed in UI 8 | name: "Spanish", // Name of the language in English, used by OpenAI translation 9 | code: "es", // 2 letter language code (ISO 639‑1) 10 | strings: esStrings, // JSON object of translated UI element strings 11 | } 12 | ``` 13 | Create a new `.json` file under the `strings` folder with the 2 letter language code as the name of the file. If you wish to let OpenAI handle the translation, set the content of the file to `{}`. Otherwise, if you wish to translate some of the strings manually, add the key and it's translated string to the json object. The keys can be found in the english string file `en.json`. 14 | 15 | Create a folder with the name set as the 2 letter language code under the `src` folder. 16 | 17 | ## OpenAI translation 18 | Start by creating a `.env` file in the root of the `docs` folder. Set the content as follow. 19 | ``` 20 | OPENAI_API_KEY={YOUR API KEY HERE} 21 | ``` 22 | 23 | Run the following command to start the translation process in the `docs` directory. 24 | ```bash 25 | node ./translateLocal.js 26 | ``` -------------------------------------------------------------------------------- /docs/languages/def.js: -------------------------------------------------------------------------------- 1 | // UI elements strings json file for new languages 2 | const enStrings = require("./strings/en.json"); 3 | const esStrings = require("./strings/es.json"); 4 | const zhStrings = require("./strings/zh.json"); 5 | const idStrings = require("./strings/id.json"); 6 | 7 | // Start adding new languages by making a new language object inside the array 8 | // display: Name of the language displayed in UI 9 | // code: Language specific code 10 | // name: Name of the language in English, used by OpenAI translation 11 | // strings: JSON object of translated UI element strings 12 | const languages = [ 13 | { 14 | display: "Español", 15 | name: "Spanish", 16 | code: "es", 17 | strings: esStrings, 18 | }, 19 | { 20 | display: "简体中文", 21 | name: "Mandarin Chinese", 22 | code: "zh", 23 | strings: zhStrings, 24 | }, 25 | { 26 | display: "Bahasa Indonesia", 27 | name: "Indonesian", 28 | code: "id", 29 | strings: idStrings, 30 | }, 31 | ]; 32 | 33 | const i18n_strs = languages.reduce((langs, currentLang) => { 34 | langs[currentLang.code] = currentLang.strings; 35 | return langs; 36 | }, {}); 37 | 38 | const get_i18n_str = (langCode="en", key, fallbackStr) => { 39 | const engStr = enStrings[key] || fallbackStr; 40 | if (langCode === "en") return engStr; 41 | return i18n_strs[langCode][key] || engStr; 42 | } 43 | 44 | module.exports = { 45 | languages, 46 | get_i18n_str 47 | }; -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cookbook", 3 | "version": "0.0.1", 4 | "description": "A collection of little developer guides to build on the permaweb", 5 | "main": "index.js", 6 | "authors": { 7 | "name": "Permaweb Builders", 8 | "email": "tom@hyper.io" 9 | }, 10 | "repository": "twilson63/permaweb-cookbook/cookbook", 11 | "scripts": { 12 | "dev": "vuepress dev src", 13 | "build": "vuepress build src", 14 | "deploy": "npm run build && node deploy.mjs", 15 | "fmt": "prettier --single-quote --trailing-comma none --write src/.vuepress", 16 | "lint": "prettier --single-quote --trailing-comma none --check src/.vuepress" 17 | }, 18 | "license": "MIT", 19 | "devDependencies": { 20 | "@bundlr-network/client": "^0.9.11", 21 | "@snippetors/vuepress-plugin-code-copy": "^1.2.3", 22 | "@vuepress/plugin-container": "2.0.0-beta.61", 23 | "@vuepress/plugin-medium-zoom": "2.0.0-beta.61", 24 | "@vuepress/plugin-search": "2.0.0-beta.61", 25 | "arweave": "^1.11.8", 26 | "prettier": "^2.8.4", 27 | "vuepress": "2.0.0-beta.61", 28 | "warp-contracts": "^1.2.37" 29 | }, 30 | "dependencies": { 31 | "@octokit/core": "^4.2.1", 32 | "@vuepress/plugin-container": "2.0.0-beta.61", 33 | "@vuepress/plugin-medium-zoom": "2.0.0-beta.61", 34 | "add-to-calendar-button": "^2.2.5", 35 | "bootstrap": "5.2.3", 36 | "dotenv": "^16.1.4", 37 | "openai": "^3.2.1" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /docs/src/.vuepress/client.js: -------------------------------------------------------------------------------- 1 | import { defineClientConfig } from "@vuepress/client"; 2 | 3 | import Layout from "./layouts/Layout.vue"; 4 | 5 | export default defineClientConfig({ 6 | enhance({ app, router, siteData, languages }) {}, 7 | setup() {}, 8 | layouts: { Layout }, 9 | rootComponents: [], 10 | }); 11 | -------------------------------------------------------------------------------- /docs/src/.vuepress/components/I18NRouterLink.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /docs/src/.vuepress/components/Page.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 22 | 23 | 80 | -------------------------------------------------------------------------------- /docs/src/.vuepress/components/ToggleSidebarButton.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 25 | 26 | 54 | -------------------------------------------------------------------------------- /docs/src/.vuepress/components/Topbar.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 22 | 23 | 100 | -------------------------------------------------------------------------------- /docs/src/.vuepress/composables/useContributors.js: -------------------------------------------------------------------------------- 1 | import { ref } from 'vue'; 2 | 3 | export const useContributors = () => { 4 | const contributors = ref([]); 5 | 6 | fetch( 7 | 'https://api.github.com/repos/twilson63/permaweb-cookbook/contributors?q=contributions&order=desc' 8 | ) 9 | .then((res) => { 10 | if (res.ok) return res.json(); 11 | else return []; 12 | }) 13 | .then((result) => { 14 | contributors.value = result; 15 | }); 16 | 17 | return contributors; 18 | } -------------------------------------------------------------------------------- /docs/src/.vuepress/composables/useI18N.js: -------------------------------------------------------------------------------- 1 | import { usePageFrontmatter } from '@vuepress/client'; 2 | 3 | export const languages = __LANGUAGES__.reduce((langs, currentLang) => { 4 | langs[currentLang.display] = `${currentLang.code}/`; 5 | return langs; 6 | }, { 7 | "English": "/" 8 | }); 9 | 10 | const i18n_strs = __LANGUAGES__.reduce((langs, currentLang) => { 11 | langs[currentLang.code] = currentLang.strings; 12 | return langs; 13 | }, {}); 14 | 15 | export const get_i18n_str = (langCode="en", key, fallbackStr) => { 16 | const engStr = __ENSTRS__[key] || fallbackStr; 17 | if (langCode === "en") return engStr; 18 | return i18n_strs[langCode][key] || engStr; 19 | } 20 | 21 | export const useI18NStr = () => { 22 | const frontmatter = usePageFrontmatter(); 23 | return (key, fallbackStr) => get_i18n_str(frontmatter.value.locale, key, fallbackStr); 24 | }; 25 | 26 | export const getCurrentLanguage = (path) => { 27 | const currentPath = path; 28 | const pathSegments = currentPath 29 | .split("/") 30 | .filter((segment) => segment !== ""); 31 | 32 | if (pathSegments.length >= 2) { 33 | const language = Object.keys(languages).find( 34 | (lang) => `${pathSegments[0]}/` === languages[lang] 35 | ); 36 | if (language) { 37 | return language; 38 | } 39 | } else if (pathSegments.length < 2 && pathSegments[0] !== "") { 40 | const language = Object.keys(languages).find( 41 | (lang) => `${pathSegments[0]}/` === languages[lang] 42 | ); 43 | if (language) { 44 | return language; 45 | } 46 | } 47 | 48 | return "English"; 49 | }; 50 | 51 | export const getLanguagePath = (path, selectedLanguage, currentLanguage="English") => { 52 | if (selectedLanguage === currentLanguage) return path; 53 | 54 | const currentPath = path; 55 | const selectedLanguagePath = languages[selectedLanguage]; 56 | 57 | let newPath; 58 | 59 | if (currentLanguage === "English") { 60 | newPath = currentPath.replace(/^\/(.*)/, `/${selectedLanguagePath}$1`); 61 | } else if (selectedLanguage === "English") { 62 | newPath = currentPath.replace( 63 | new RegExp(`^\/(${Object.values(languages).join("|")})`), 64 | `${selectedLanguagePath}` 65 | ); 66 | } else { 67 | newPath = currentPath.replace( 68 | new RegExp(`^\/(${Object.values(languages).join("|")})`), 69 | `/${selectedLanguagePath}` 70 | ); 71 | } 72 | 73 | return newPath; 74 | }; -------------------------------------------------------------------------------- /docs/src/.vuepress/public/Permaweb_Cookbook.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/.vuepress/public/Permaweb_Cookbook.ico -------------------------------------------------------------------------------- /docs/src/.vuepress/public/cookbook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/.vuepress/public/cookbook.png -------------------------------------------------------------------------------- /docs/src/.vuepress/public/encryption-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/.vuepress/public/encryption-diagram.png -------------------------------------------------------------------------------- /docs/src/.vuepress/public/entity-relationship-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/.vuepress/public/entity-relationship-diagram.png -------------------------------------------------------------------------------- /docs/src/.vuepress/public/private-drive-schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/.vuepress/public/private-drive-schema.png -------------------------------------------------------------------------------- /docs/src/.vuepress/public/public-drive-schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/.vuepress/public/public-drive-schema.png -------------------------------------------------------------------------------- /docs/src/.vuepress/styles/bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import 'bootstrap/scss/functions'; 2 | 3 | $grid-breakpoints: ( 4 | xs: 0, 5 | sm: 576px, 6 | md: 768px, 7 | lg: 992px, 8 | xl: 1100px, 9 | xxl: 1400px 10 | ); 11 | $container-max-widths: ( 12 | sm: 540px, 13 | md: 720px, 14 | lg: 960px, 15 | xl: 1360px, 16 | xxl: 1440px 17 | ); 18 | $grid-gutter-width: 40px; 19 | 20 | @import 'bootstrap/scss/variables'; 21 | @import 'bootstrap/scss/maps'; 22 | @import 'bootstrap/scss/mixins'; 23 | @import 'bootstrap/scss/root'; 24 | -------------------------------------------------------------------------------- /docs/src/community/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Permaweb Cookbook - Community 3 | --- 4 | 5 | # Community 6 | 7 | If you've created something on the Permaweb, and would like to add documentation to this cookbook, consider [contributing](../getting-started/contributing.md)! 8 | 9 | ## Community Contributions 10 | - [Arweave Name System (ArNS)](../concepts/arns.md) 11 | - [Atomic Assets](../guides/smartweave/atomic-assets/index.md) 12 | - [using ArDrive CLI](../guides/smartweave/atomic-assets/ardrive-cli.md) -------------------------------------------------------------------------------- /docs/src/concepts/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Permaweb Cookbook - Core Concepts 3 | --- 4 | 5 | # Core Concepts 6 | 7 | Foundations of Arweave and the Permaweb. 8 | 9 | - [Posting Transactions](post-transactions.md) 10 | - [Metadata (Tags)](tags.md) 11 | - [Querying](queryTransactions.md) 12 | - [Fetching Data](/guides/http-api.md) 13 | - [Transaction Types](bundles.md) 14 | - [Bundles](bundles.md) 15 | - [Path Manifests](manifests.md) 16 | - [Wallets and Keys](keyfiles-and-wallets.md) 17 | - [Permaweb](permaweb.md) 18 | - [Permaweb Applications](permawebApplications.md) 19 | - [Gateway Services](gateways.md) 20 | - [Bundling Services](bundlers.md) 21 | - [Arweave File System (ArFS)](arfs/arfs.md) 22 | - [Data model](arfs/data-model.md) 23 | - [Entity Types](arfs/entity-types.md) 24 | - [Content Types](arfs/content-types.md) 25 | - [Privacy](arfs/privacy.md) 26 | - [Schema Diagrams](arfs/schema-diagrams.md) 27 | 28 | > Do you think a permaweb core concept is missing? Create a issue at [Github](https://github.com/twilson63/permaweb-cookbook/issues) or consider [contributing](../getting-started/contributing.md) 29 | -------------------------------------------------------------------------------- /docs/src/concepts/arfs/content-types.md: -------------------------------------------------------------------------------- 1 | --- 2 | prev: "entity-types.md" 3 | next: "privacy.md" 4 | --- 5 | 6 | # Content Types 7 | 8 | All transaction types in ArFS leverage a specific metadata tag for the Content-Type (also known as mime-type) of the data that is included in the transaction. ArFS clients must determine what the mime-type of the data is, in order for Arweave gateways and browswers to render this content appropriately. 9 | 10 | All public drive, folder, and file (metadata only) entity transactions all use a JSON standard, therefore they must have the following content type tag: 11 | 12 | ```json 13 | Content-Type: '' 14 | ``` 15 | 16 | However, a file's data transaction must have its mime-type determined. This is stored in the file's corresponding metadata transaction JSON's `dataContentType` as well as the content type tag in the data transaction itself. 17 | 18 | ```json 19 | Content-Type: "" 20 | ``` 21 | 22 | All private drive, folder, and file entity transactions must have the following content type, since they are encrypted: 23 | 24 | ```json 25 | Content-Type: '' 26 | ``` 27 | 28 | [ArDrive-Core](https://docs.ardrive.io/docs/core-sdk.html) includes methods to determine a file's content type. 29 | 30 | 31 | ## Other Tags 32 | 33 | ArFS enabled clients should include the following tags on their transactions to identify their application 34 | 35 | ```json 36 | App-Name: " 11 |
Public Drive Schema
12 | 13 | ### Private Drive 14 | 15 |
Private Drive Schema
16 | 17 | Arweave GQL Tag Byte Limit is restricted to `2048`. There is no determined limit on Data JSON custom metadata, though more data results in a higher upload cost. -------------------------------------------------------------------------------- /docs/src/concepts/atomic-tokens.md: -------------------------------------------------------------------------------- 1 | # Atomic Token Concept and Principles 2 | 3 | ![https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A](https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A) 4 | 5 | An Atomic Token is a single permanent identifier that references data and a SmartWeave Contract on the Permaweb. 6 | 7 | ## Specifications 8 | 9 | Data MUST be stored on the arweave network and referencable by a Transaction Identifier 10 | 11 | Contract MUST implement a `balances` object that represents the ownership of the Atomic Token 12 | 13 | Contract MUST implement a `transfer` function that takes the following arguments: 14 | - target {WalletAddress or Contract} 15 | - qty {Number} 16 | 17 | > The transfer function should transfer ownership from the caller to the target 18 | 19 | ## Options 20 | 21 | _These are implementation options that can make the Atomic Token discoverable and tradeable on the Permaweb_ 22 | 23 | [Verto Flex](https://github.com/useverto/flex) - The Flex Library gives your atomic token to be sold or purchased without trusting an exchange. 24 | 25 | [Discoverability Tags - ANS 110](https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-110.md) - These additional tags can help Permaweb applications and services discover your token. 26 | 27 | [Check out the Guide](../guides/atomic-tokens/intro.md) -------------------------------------------------------------------------------- /docs/src/concepts/bundlers.md: -------------------------------------------------------------------------------- 1 | # Bundling Services 2 | 3 | --- 4 | 5 | With bundling services users can post their data transactions to a bundling service to have it "bundled" together with other users transactions and posted as a single Arweave transaction in an upcoming Arweave block. 6 | 7 | --- 8 | 9 | ### What is a bundle? 10 | 11 | --- 12 | 13 | A description of transaction bundles and their benefits can be found [here](/concepts/bundles.md). 14 | 15 | ### What is a Bundler node? 16 | 17 | --- 18 | 19 | A bundler is a node which is responsible for accepting transactions or data items from users, bundling them, and posting them to the Arweave network (with a guarantee they will be uploaded with a specific transaction ID). 20 | 21 | Services: 22 | 23 | - [Turbo](https://github.com/ardriveapp/turbo-upload-service/) 24 | 25 | Which make sure the data is persisted until it is uploaded to Arweave. 26 | 27 | ### Supporting multiple currencies 28 | 29 | --- 30 | 31 | A key feature of bundling services is that because they pay for the base Arweave transaction to be posted (using AR tokens) they can choose to enable payments of storage fees on a variety of different tokens. This is the main entry point for other chains to enable Arweave's permanent storage for their users. 32 | -------------------------------------------------------------------------------- /docs/src/concepts/bundles.md: -------------------------------------------------------------------------------- 1 | # Transaction Bundles 2 | 3 | ### What is a Bundle? 4 | 5 | --- 6 | 7 | A transaction bundle is a special type of Arweave transaction. It enables multiple other transactions and/or data items to be bundled inside it. Because transaction bundles contain many nested transactions they are key to Arweave's ability to scale to thousands of transactions per second. 8 | 9 | Users submit transactions to a bundling service, such as [turbo](https://ardrive.io/turbo-bundler/), which combines them into a 'bundle' with other transactions and posts them to the network. 10 | 11 | ### How Do Bundles Help Arweave? 12 | 13 | --- 14 | 15 | #### Availability 16 | 17 | Bundling services guarantee that bundled transactions are reliably posted to Arweave without dropping. 18 | 19 | Transaction IDs of the bundled transactions are immediately made available, meaning the data can instantly be accessed as if it was already on the Arweave network. 20 | 21 | #### Reliability 22 | 23 | Transactions posted to Arweave can occasionally fail to confirm (resulting in a dropped transaction) due to a number of reasons, such as high network activity. In these instances transactions can become **orphaned**, i.e. stuck in the mempool and eventually removed. 24 | 25 | Bundlers solve this problem by continually attempting to post bundled data to Arweave, assuring that it does not fail or get stuck in the mempool. 26 | 27 | #### Scalability 28 | 29 | Bundles can store up to 2256 transactions, each of which are settled as a single transaction on Arweave. This makes Arweave blockspace scale to support almost any use case. 30 | 31 | ### What are Nested Bundles? 32 | 33 | --- 34 | 35 | Bundles can include data items for uploading to Arweave and those data item can themselves be a bundle. 36 | 37 | This means it is possible to upload a bundle of bundles, or in other words **nested bundles**. 38 | 39 | Nested bundles have no theoretical limit on nesting depth, meaning that transaction throughput can be increased drastically. 40 | 41 | Nested bundles might be useful for when you have different groups of bundled data that you want to guarantee reach Arweave altogether, and at the same time. 42 | 43 | Sources and Further Reading: 44 | 45 | [Ardrive Turbo](https://ardrive.io/turbo-bundler/) 46 | 47 | [ANS-104 Standard](https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-104.md) 48 | -------------------------------------------------------------------------------- /docs/src/concepts/gateways.md: -------------------------------------------------------------------------------- 1 | # Gateways 2 | 3 | --- 4 | 5 | Data uploaded to the Arweave network (or the [permaweb](https://cookbook.arweave.dev/concepts/permaweb.html)) isn't always immediately easy to work with. 6 | 7 | ### What is a Gateway? 8 | 9 | Gateways are sometimes referred to as the "front door to the permaweb". They act as an interface between Arweave and end-users, making it easy to access data or use permaweb applications from your web browser. 10 | 11 | For example, accessing a HTML file stored on Arweave will be displayed as a web page in your browser. The same goes for viewing images, downloading files, viewing JSON data, or any other file stored on Arweave. This makes interacting with the permaweb very similar to using the traditional web. 12 | 13 | ### Other Roles of Gateways 14 | 15 | Other than serving data for users to access, gateways offer other services such as: 16 | 17 | - Caching frequently accessed data and transactions 18 | - Indexing and querying transactions (through Arweave tags and a GraphQl interface) 19 | - Seeding transactions throughout the Arweave network 20 | - Content moderation (content policies to choose which data is or isn't served) 21 | 22 | ### Gateways and the Arweave Protocol 23 | 24 | Although gateways play a large role in allowing content to be accessed on Arweave, they are **not** part of the core protocol. 25 | 26 | This means hosting and running gateways is separate to running a node securing the Arweave network (although are frequently done together). 27 | 28 | As gateways are not part of the core protocol, there is no built-in incentive structure like the rewards or incentives for mining. This allows gateway operators or external services to choose how they want to structure their incentive system, leading to a more decentralized and democratic model. Individual applications could even operate their own gateway to allow for better caching and performance of their permaweb applications. 29 | 30 | Some popular gateways include [arweave.net](https://arweave.net/) ran by the Arweave team, and others like [arweave.world](https://cookbook.arweave.world/) [arweave.asia](https://cookbook.arweave.asia) [arweave.live](https://arweave.live/), and [g8way.io](https://g8way.io). However, operating gateways is being made easier and more accessible through teams such as [AR.IO](https://ar.io/). 31 | 32 | ### Sources and Further Reading 33 | 34 | - [ArWiki](https://arwiki.wiki/#/en/gateways) 35 | - [AR.IO](https://ar.io/) -------------------------------------------------------------------------------- /docs/src/concepts/permaweb.md: -------------------------------------------------------------------------------- 1 | # Welcome to the Permaweb 2 | 3 | The permaweb is like the web, but permanent. Developers build on top of permaweb services to create apps and sites that will exist forever on Arweave. 4 | 5 | ![Permaweb](https://arweave.net/lK3mptAgC2cijnPvogKaLCOsKSuPlvLu_6opnEOrpT0) 6 | 7 | Benefits of the permaweb. 8 | 9 | 1. Sites and apps are permanent, you never have to worry about them going away (even if the team supporting them moves on) 10 | 1. App developers have to make sure every new version of the app actually adds value, otherwise, why would you switch off the old one. 11 | 1. Because all Permaweb apps share a common storage layer, Arweave, they can all compose with one anther's data. 12 | 1. Your data is owned by your wallet and can follow you from app to app. 13 | 14 | ## Compare Traditional Web vs Permaweb 15 | 16 | ![Permaweb vs Traditional](https://arweave.net/5EP6mhpHsfnTsmFk7aVyK8jF6zqavxJT4kgx70mUc5I) 17 | 18 | For more information about the permaweb check out the [medium post](https://arweave.medium.com/welcome-to-the-permaweb-ce0e6c73ddfb). 19 | 20 | -------------------------------------------------------------------------------- /docs/src/config/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | --- 4 | 5 | # Config 6 | 7 | ## foo 8 | 9 | - Type: `string` 10 | - Default: `/` 11 | 12 | ## bar 13 | 14 | - Type: `string` 15 | - Default: `/` 16 | -------------------------------------------------------------------------------- /docs/src/es/concepts/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Conceptos básicos 6 | 7 | Fundamentos de Arweave y el Permaweb. 8 | 9 | - [Publicar transacciones](post-transactions.md) 10 | - [Metadatos (etiquetas)](tags.md) 11 | - [Consultas](queryTransactions.md) 12 | - [Descargar Datos](/guides/http-api.md) 13 | - [Tipos de transacciones](bundles.md) 14 | - [Paquetes](bundles.md) 15 | - [Manifiestos de rutas](manifests.md) 16 | - [Monederos y Claves](keyfiles-and-wallets.md) 17 | - [Permaweb](permaweb.md) 18 | - [Aplicaciones de Permaweb](permawebApplications.md) 19 | - [Servicios de pasarela](gateways.md) 20 | - [Servicios de empaquetado](bundlers.md) 21 | - [SmartWeave](smartweave.md) 22 | - [Sistema de Nombres Arweave (ArNS)](arns.md) 23 | - [Fichas atómicas](atomic-tokens.md) 24 | - [Fichas de Compartición de Beneficios (PSTs)](psts.md) 25 | 26 | > ¿Crees que falta algún concepto básico de Permaweb? Cree una issue en [GitHub](https://github.com/twilson63/permaweb-cookbook/issues) o considere [contribuir](../getting-started/contributing.md) 27 | -------------------------------------------------------------------------------- /docs/src/es/concepts/atomic-tokens.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | - For more information and examples for creating Atomic Tokens. 5 | 6 | # Concepto y principios de Token Atómico 7 | 8 | ![https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A](https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A) 9 | 10 | Un Token Atómico es un único identificador permanente que hace referencia a los datos y un Contrato SmartWeave en el Permaweb. 11 | 12 | ## Especificaciones 13 | 14 | Los datos DEBEN almacenarse en la red de arweave y referenciables mediante un Identificador de Transacción. 15 | 16 | El Contrato DEBE implementar un objeto "balances" que represente la propiedad del Token Atómico. 17 | 18 | El Contrato DEBE implementar una función "transfer" que tenga los siguientes argumentos: 19 | - objetivo {WalletAddress o Contracto} 20 | - qty {Número} 21 | 22 | > La función de transferencia debería transferir la propiedad del llamador al objetivo. 23 | 24 | ## Opciones 25 | 26 | _Estas son opciones de implementación que pueden hacer que el Token Atómico sea descubrible y comerciable en el Permaweb_ 27 | 28 | [Verto Flex](https://github.com/useverto/flex) - La Biblioteca Flex permite que su token atómico sea vendido o comprado sin confiar en un intercambio. 29 | 30 | [Etiquetas de descubrimiento - ANS 110](https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-110.md) - Estas etiquetas adicionales pueden ayudar a las aplicaciones y servicios del Permaweb a descubrir su token. 31 | 32 | [Echa un vistazo a la Guía](../guides/atomic-tokens/intro.md) - Para obtener más información y ejemplos para crear Tokens Atómicos. -------------------------------------------------------------------------------- /docs/src/es/concepts/bundlers.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Servicios de empaquetamiento 6 | 7 | --- 8 | 9 | Con los servicios de empaquetamiento, los usuarios pueden publicar sus transacciones de datos en un servicio centralizado para que se "empaqueten" con las transacciones de otros usuarios y se publiquen como una sola transacción Arweave en un bloque de Arweave próximo. 10 | 11 | ### ¿Qué es un paquete? 12 | 13 | --- 14 | 15 | Puede encontrar una descripción de los paquetes de transacción y sus beneficios [aquí](/concepts/bundles.md). 16 | 17 | ### ¿Qué es un nodo Empaquetador? 18 | 19 | --- 20 | 21 | Un empaquetador es un nodo que se encarga de aceptar transacciones o elementos de datos de los usuarios, empaquetarlos y publicarlos en la red Arweave (con la garantía de que se cargarán con un identificador de transacción específico). 22 | 23 | Que aseguran que los datos se mantengan hasta que se carguen en Arweave. 24 | 25 | ### Apoyando múltiples monedas 26 | 27 | --- 28 | 29 | Una característica clave de los servicios de empaquetamiento es que, debido a que pagan por la publicación de la transacción base de Arweave (usando tokens AR), pueden optar por habilitar pagos de tarifas de almacenamiento con una variedad de tokens diferentes. Esta es la principal vía de entrada para que otras cadenas habiliten el almacenamiento permanente de Arweave para sus usuarios. 30 | -------------------------------------------------------------------------------- /docs/src/es/concepts/permaweb.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Bienvenido a la Permaweb 6 | 7 | La Permaweb es como la web, pero permanente. Los desarrolladores construyen sobre servicios de Permaweb para crear aplicaciones y sitios web que existirán para siempre en Arweave. 8 | 9 | ![Permaweb](https://arweave.net/lK3mptAgC2cijnPvogKaLCOsKSuPlvLu_6opnEOrpT0) 10 | 11 | Beneficios de la Permaweb. 12 | 13 | 1. Los sitios web y las aplicaciones son permanentes, nunca tendrás que preocuparte por que desaparezcan (incluso si el equipo que los soporta se mueve). 14 | 1. Los desarrolladores de aplicaciones tienen que asegurarse de que cada nueva versión de la aplicación realmente aporte valor, de lo contrario, ¿por qué cambiaríamos la antigua?. 15 | 1. Debido a que todas las aplicaciones de Permaweb comparten una capa de almacenamiento común, Arweave, pueden todas componerse con los datos unas de otras. 16 | 1. Tus datos son propiedad de tu billetera y pueden seguirte de una aplicación a otra. 17 | 18 | ## Compara la Web Tradicional con la Permaweb 19 | 20 | ![Permaweb vs Tradicional](https://arweave.net/5EP6mhpHsfnTsmFk7aVyK8jF6zqavxJT4kgx70mUc5I) 21 | 22 | Para obtener más información sobre la Permaweb, consulta el [artículo en Medium](https://arweave.medium.com/welcome-to-the-permaweb-ce0e6c73ddfb). 23 | -------------------------------------------------------------------------------- /docs/src/es/getting-started/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Cocinar con el Permaweb 6 | 7 | La cocina Permaweb es un recurso para desarrolladores que ofrece los conceptos y referencias esenciales para construir aplicaciones en el Permaweb. Cada concepto y referencia se enfocará en aspectos específicos del ecosistema de desarrollo del Permaweb mientras proporciona detalles adicionales y ejemplos de uso. 8 | 9 | ## Desarrolladores 10 | 11 | Bienvenidos a la comunidad de desarrollo de Arweave, donde el pasado está grabado para siempre en el blockchain y el futuro está lleno de posibilidades sin límites. ¡Construyamos juntos la web descentralizada! 12 | 13 | [Leer más](welcome.md) 14 | 15 | ## Contribuir 16 | 17 | La Cocina esta diseñada de manera para que sea fácil para nuevos desarrolladores de Permaweb contribuir. ¡Incluso si no sabes cómo hacer algo, contribuir a la Cocina es una excelente forma de aprender! 18 | 19 | Ve todos los issues abiertos aquí. Las pautas de contribución aquí. si encuentras que falta un concepto, guía o referencia en la cocina, agrega un issue. 20 | 21 | [Leer más](contributing.md) 22 | 23 | ## Cómo leer la Cocina 24 | 25 | La cocina Permaweb está dividida en diferentes secciones, cada una con un objetivo diferente. 26 | 27 | | Sección | Descripción | 28 | | ----------------- | -------------------------------------------------------------------------------------------- | 29 | | Conceptos Básicos | Bloques de construcción del Permaweb que es bueno saber para el desarrollo | 30 | | Guías | Guías de bocado de distintas herramientas para el desarrollo | 31 | | Referencias | Referencias a fragmentos de código comúnmente necesarios | 32 | | Kits de inicio | Iniciadores de Framework Front-end para empezar a construir en el Permaweb sin perder tiempo | 33 | 34 | ## Comienzos Rápidos 35 | 36 | Estas son pequeñas guías para ayudar a desarrolladores con cualquier nivel de experiencia a enviar código al permaweb. 37 | 38 | - [Hola Mundo (Sin Código)](quick-starts/hw-no-code.md) 39 | - [Hola Mundo (Código)](quick-starts/hw-code.md) 40 | - [Desplegar una Página Web](quick-starts/webpage.md) 41 | - [Desplegar una Aplicación Web](quick-starts/web-app.md) 42 | -------------------------------------------------------------------------------- /docs/src/es/getting-started/quick-starts/hw-cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Hola Mundo (CLI) 6 | 7 | Esta guía le guiará a través de la forma más simple de obtener datos en el permaweb usando una interfaz de línea de comandos (CLI). 8 | 9 | ## Requerimientos 10 | 11 | - [NodeJS](https://nodejs.org) LTS o superior 12 | 13 | ## Descripción 14 | 15 | Usando una ventana de terminal / consola, cree una nueva carpeta llamada `hw-permaweb-1`. 16 | 17 | ## Configuración 18 | 19 | ```sh 20 | cd hw-permaweb-1 21 | npm init -y 22 | npm install arweave ardrive-cli 23 | ``` 24 | 25 | ## Generar una billetera 26 | 27 | ```sh 28 | npx -y @permaweb/wallet > ~/.demo-arweave-wallet.json 29 | ``` 30 | 31 | ## Crea una página web 32 | 33 | ```sh 34 | echo "

Hola Permaweb

" > index.html 35 | ``` 36 | 37 | ## Subir utilizando Irys 38 | 39 | ```sh 40 | # Create a Drive 41 | FOLDER_ID=$(npx ardrive create-drive -n public -w ~/.demo-arweave-wallet.json --turbo | jq -r '.created[] | select(.type == "folder") | .entityId') 42 | # Upload file 43 | TX_ID=$(npx ardrive upload-file -l index.html --content-type text/html -w ~/.demo-arweave-wallet.json --turbo -F ${FOLDER_ID} | jq -r '.created[] | select(.type == "file 44 | ") | .dataTxId') 45 | # open file from ar.io gateway 46 | open https://g8way.io/${TX_ID} 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/src/es/getting-started/quick-starts/hw-no-code.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Hola Mundo (Sin Código) 6 | 7 | En este tutorial rápido vamos a subir una imagen al permaweb sin tener que escribir código. 8 | 9 | ## Requisitos 10 | 11 | - Computadora 12 | - Internet 13 | - Navegador web moderno 14 | 15 | ## Crea una billetera con algunos AR 16 | 17 | [https://faucet.arweave.net/](https://faucet.arweave.net/) 18 | 19 | Visite el grifo de Arweave y genera una billetera con AR, esto requiere una cuenta de Twitter. Se te pedirá descargar tu archivo de claves como `file.json`. 20 | 21 | ![faucet](https://arweave.net/aO-L2ZAhqUC6H1xThrY8-b9TwQykRcRhZkPaeF9tTuo/) 22 | 23 | ## Añadiendo el archivo de claves a la billetera Arweave.app 24 | 25 | https://arweave.app/add 26 | 27 | Haga clic en el botón Importar claves. Y cargue su archivo de claves en la billetera de la aplicación. 28 | 29 | ![add keyfile](https://arweave.net/urFQ0X2pBHmDRk9v8zeog4yDGmj1mYA16nS_7shpJSE/) 30 | 31 | ## Enviar algunos datos a Arweave 32 | 33 | Cuando se haya importado el archivo de claves, se le dirigirá a la vista de la billetera, haga clic en el botón Enviar y seleccione un archivo para cargar. Luego haga clic en el botón `Enviar`. 34 | 35 | ![send data](https://arweave.net/UnT4rcnGUgkJgggVFUVXA6M2e0IrWs-VzNnpJ4mJr3M) 36 | 37 | ## ¡Felicidades!! 38 | 39 | Acabas de publicar algunos datos en Arweave sin escribir código. 40 | 41 | ## ¡Verlo en acción! 42 | 43 | - [Arcademy](https://arcademy.arweave.dev/#/AtomicPlayground/xMVuQ5BKy__EccnMu0Ji_0rPk3f6yCtIRdHwvjSweB4) 44 | - [Youtube](https://youtu.be/T6wJ3m5ABSU) 45 | -------------------------------------------------------------------------------- /docs/src/es/getting-started/welcome.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Desarrollar en la Permaweb 6 | 7 | ## Bienvenido a la Permaweb 8 | 9 | Crear aplicaciones en la permaweb, que está construida sobre el protocolo Arweave, es similar a construir aplicaciones web tradicionales pero con algunas diferencias clave. 10 | 11 | Una de las principales diferencias es que los datos se almacenan en la permaweb de forma permanente, tal y como sugiere el nombre, en lugar de almacenarse en un servidor centralizado. Esto significa que una vez que los datos se cargan a la permaweb, no se pueden eliminar ni alterar. Esto puede ser beneficioso para aplicaciones que requieren almacenamiento de datos inalterables, como los sistemas de gestión de la cadena de suministro o de votación. 12 | 13 | Otra diferencia es que la permaweb es descentralizada, lo que significa que no hay un punto central de control o falla. Esto puede proporcionar mayor seguridad y fiabilidad para las aplicaciones. 14 | 15 | Además, la permaweb usa un token único, llamado AR, para pagar el almacenamiento de datos en la red. Esto puede agregar una nueva capa de complejidad al desarrollo de aplicaciones, ya que los desarrolladores deben considerar cómo integrar AR en sus aplicaciones y manejar los pagos. 16 | 17 | En general, la experiencia de crear aplicaciones en la permaweb puede ser desafiante, pero también puede ser gratificante ya que ofrece beneficios únicos en comparación con el desarrollo web tradicional. 18 | 19 | ## Hola Mundos 20 | 21 | - [Hola Mundo (Sin código)](./quick-starts/hw-no-code.md) 22 | - [Hola Mundo (CLI)](./quick-starts/hw-cli.md) 23 | - [Hola Mundo (Node.js)](./quick-starts/hw-node.md) 24 | -------------------------------------------------------------------------------- /docs/src/es/guides/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Guías 6 | 7 | Guías rápidas para los componentes básicos de la Permaweb 8 | 9 | - [ArProfile (arprofile.md)](arprofile.md) 10 | - [Integración de DNS (dns-integration/server-side.md)](dns-integration/server-side.md) 11 | - [Lado del servidor](dns-integration/server-side.md) 12 | - [Spheron](dns-integration/spheron.md) 13 | - [Implementación de aplicaciones (deployment/irys-cli.md)](deployment/irys-cli.md) 14 | - [arkb](deployment/arkb.md) 15 | - [irys-cli](deployment/irys-cli.md) 16 | - [github-action](deployment/github-action.md) 17 | - [Implementación de PathManifests (deploying-manifests/deployingManifests.md)](deploying-manifests/deployingManifests.md) 18 | - [arweave.app](deploying-manifests/arweave-app.md) 19 | - [ardrive](deploying-manifests/ardrive.md) 20 | - [irys.xyz](deploying-manifests/irys.md) 21 | - [Implementación de PSTs (deploying-psts.md)](deploying-psts.md) 22 | - [GraphQL](querying-arweave/queryingArweave.md) 23 | - [ArDB](querying-arweave/ardb.md) 24 | - [ar-gql](querying-arweave/ar-gql.md) 25 | - [Servicio de búsqueda](querying-arweave/search-indexing-service.md) 26 | - SmartWeave 27 | - [Tokens atómicos](atomic-tokens/intro.md) 28 | - [Vouch](vouch.md) 29 | - Contratos Warp 30 | - [Introducción](smartweave/warp/intro.md) 31 | - [Implementación de contratos](smartweave/warp/deploying-contracts.md) 32 | - [Leer el estado del contrato](smartweave/warp/readstate.md) 33 | - [Escribir interacciones del contrato](smartweave/warp/write-interactions.md) 34 | - [Evolucionar el contrato](smartweave/warp/evolve.md) 35 | - [Pruebas](testing/arlocal.md) 36 | 37 | > ¿Crees que falta alguna guía de la Permaweb? Crea un problema en [Github](https://github.com/twilson63/permaweb-cookbook/issues) o considera [contribuir](../getting-started/contributing.md) 38 | -------------------------------------------------------------------------------- /docs/src/es/guides/deploying-manifests/ardrive.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | ### ArDrive 5 | 6 | --- 7 | 8 | Puedes crear un manifiesto para una carpeta o un grupo de carpetas con `ardrive create-manifest` utilizando la [CLI de ArDrive](https://github.com/ardriveapp/ardrive-cli). 9 | 10 | Lectura adicional: [Documentación de la CLI de ArDrive](https://github.com/ardriveapp/ardrive-cli) 11 | 12 | --- 13 | 14 | Alternativamente, puedes crear un manifiesto utilizando la aplicación web [ArDrive](https://ardrive.io) seleccionando Nuevo → Crear manifiesto mientras estás dentro de una unidad. 15 | 16 | ![Manifiesto de la aplicación web de ArDrive](~@source/images/ardrive-manifests.png) -------------------------------------------------------------------------------- /docs/src/es/guides/deploying-manifests/arweave-app.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | ### Arweave.app 5 | 6 | --- 7 | 8 | Al subir un directorio a través de [Arweave.app](http://Arweave.app), se creará automáticamente un manifiesto para todos los archivos en el directorio. 9 | 10 | ![ArweaveApp Carga de Manifiesto](~@source/images/arweaveapp-manifest.png) 11 | 12 | Alternativamente, puedes subir tu propio archivo de manifiesto manualmente, agregar la etiqueta siguiente y enviar la transacción. 13 | 14 | ![ArweaveApp Etiquetas de Manifiesto](~@source/images/arweaveapp-tags.png) -------------------------------------------------------------------------------- /docs/src/es/guides/deploying-manifests/deployingManifests.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Creación e Implementación de Manifiestos 5 | 6 | --- 7 | 8 | Esta guía explica cómo crear e implementar un manifiesto de ruta de forma manual. 9 | 10 | La página de conceptos fundamentales de los manifiestos de ruta ofrece más información sobre qué son los manifiestos y por qué podrían ser útiles para tu proyecto. 11 | 12 | Si sigues esta guía para implementar un manifiesto de ruta, deberá seguir la estructura de manifiesto presentada en la página de [conceptos fundamentales](https://cookbook.arweave.dev/concepts/manifests.html). -------------------------------------------------------------------------------- /docs/src/es/guides/deploying-manifests/irys.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | ### Irys CLI (Previously Bundlr) 6 | 7 | --- 8 | 9 | El comando `irys upload-dir ` carga un directorio local en Arweave y automáticamente genera un manifiesto de los archivos. 10 | 11 | Si desea cargar su propio archivo de manifiesto manualmente, utilizando la bandera `--content-type "application/x.arweave-manifest+json"` en cualquier transacción, se designará como una transacción de manifiesto. 12 | 13 | ### Cliente JS de Irys 14 | 15 | --- 16 | 17 | Usando el siguiente fragmento carga un directorio local en Arweave y automáticamente genera un manifiesto de los archivos: 18 | 19 | ```js 20 | await irys.uploadFolder("./ruta/al/directorio", { 21 | indexFile: "./archivoIndice.html", // archivo de índice opcional (archivo que el usuario cargará al acceder al manifiesto) 22 | batchSize: 50, // cantidad de elementos para cargar de una vez 23 | keepDeleted: false, // si mantener o no los elementos previamente eliminados de cargas anteriores 24 | }); // devuelve el ID del manifiesto 25 | ``` 26 | 27 | Si desea cargar su propio archivo de manifiesto manualmente, `await irys.upload(data, { tags: [{ name: "Content-type", value: "application/x.arweave-manifest+json" }] } )` designará los datos cargados como una transacción de manifiesto. 28 | 29 | --- 30 | 31 | Fuente y lectura adicional: [Documentación de Irys](http://docs.irys.xyz/developer-docs/irys-sdk#uploading-a-folder) 32 | -------------------------------------------------------------------------------- /docs/src/es/guides/deployment/irys-cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Irys CLI (Previously Bundlr) 6 | 7 | ## Requisitos 8 | 9 | Se requiere una billetera Arweave para implementar. Si el tamaño del directorio es mayor a 100kb, se requiere una instancia de Irys financiada. 10 | 11 | ## Instalación 12 | 13 | Para instalar la CLI de Irys, ejecuta el siguiente comando 14 | 15 | 16 | 17 | ```console:no-line-numbers 18 | npm install -g @irys/sdk 19 | ``` 20 | 21 | 22 | 23 | 24 | ```console:no-line-numbers 25 | yarn global add @irys/sdk 26 | ``` 27 | 28 | 29 | 30 | 31 | ## Generación Estática 32 | 33 | Las aplicaciones de Permaweb son generadas estáticamente, lo que significa que el código y el contenido se generan de antemano y se almacenan en la red. 34 | 35 | A continuación se muestra un ejemplo de un sitio estático. Para implementarlo en Permaweb, el directorio `build` se pasará como argumento para la bandera `upload-dir`. 36 | 37 | ```js 38 | |- build 39 | |- index.html 40 | |- styles.css 41 | |- index.js 42 | ``` 43 | 44 | ## Implementación 45 | 46 | ```console 47 | irys upload-dir [ruta a la carpeta] -w [ruta a la billetera] --index-file [index.html] -c [moneda] -h [nodo de Irys] 48 | ``` 49 | 50 |
51 | 52 | 53 | ## Otros Comandos 54 | 55 | #### Financiar Irys 56 | 57 | ```console 58 | irys fund [monto] -h [nodo de Irys] -w [ruta a la billetera] -c [moneda] 59 | ``` 60 | 61 | \* La financiación de una instancia de Irys puede tardar hasta 30 minutos en procesarse 62 | 63 | #### Verificar el Saldo de Irys 64 | 65 | ```console 66 | irys balance [dirección de billetera] -h [nodo de Irys] -c arweave 67 | ``` 68 | -------------------------------------------------------------------------------- /docs/src/es/guides/exm/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Token de API de la Máquina de Ejecución 5 | 6 | EXM busca ser agnóstico de criptografía y solo requiere un token de API (también conocido como clave) para interactuar. Este token de API es necesario para la mayoría de las acciones en EXM, como implementaciones y operaciones de escritura. 7 | 8 | ## Creación de un token de API 9 | 10 | Para crear un token de API, se deben realizar los siguientes pasos: 11 | 12 | - Ir a la [página principal](https://exm.dev/). 13 | - Elegir el método preferido para Registrarse/Iniciar sesión. 14 | 15 | ![Opciones de inicio de sesión de EXM](~@source/images/exm-sign-in-options.png) 16 | 17 | - Después de ser redirigido al panel de control, hacer clic en "Nuevo Token". 18 | 19 | ![Crear nuevo token de API](~@source/images/exm-create-token.png) 20 | 21 | - Copiar el token que se ha generado y usarlo con el SDK o CLI. 22 | 23 | ## Manejo seguro del token de API 24 | 25 | El token es un identificador de nuestra cuenta y nos permite acceder a funciones asociadas con ella. Por lo tanto, es vital asegurarse de que este token se mantenga en secreto para evitar cualquier spam y ataques a nuestras funciones. La mejor manera de hacerlo es utilizando variables de entorno. 26 | 27 | Hay dos formas de almacenar variables de entorno: 28 | 29 | 1. A través de la línea de comandos: 30 | 31 | En el directorio del proyecto, pasar el siguiente comando: 32 | 33 | ```bash 34 | export EXM_PK= 35 | ``` 36 | 37 | 2. A través del sdk `dotenv`: 38 | 39 | - Ejecutar lo siguiente en la línea de comandos: 40 | 41 | ```bash 42 | npm install dotenv 43 | 44 | #O 45 | 46 | yarn add dotenv 47 | ``` 48 | - Importar la biblioteca en el archivo usando las variables: 49 | 50 | ```jsx 51 | import dotenv from "dotenv"; 52 | dotenv.config(); 53 | ``` 54 | 55 | Luego, esta clave se puede referir dentro de los archivos como `process.env.EXM_PK` sin exponerla ni subirla a sistemas de control de versiones como GitHub. -------------------------------------------------------------------------------- /docs/src/es/guides/exm/js-sdk/sdk-intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # SDK de la Máquina de Ejecución 5 | 6 | El SDK de JavaScript permite el uso de la Máquina de Ejecución (EXM) en aplicaciones JavaScript y TypeScript. Para utilizar el SDK, se necesitan realizar los siguientes pasos de configuración. 7 | 8 | ## Instalación 9 | 10 | Para instalar EXM en tu proyecto, puedes utilizar `npm` o `yarn`. 11 | 12 | 13 | 14 | 15 | ```bash 16 | npm install @execution-machine/sdk 17 | ``` 18 | 19 | 20 | 21 | ```bash 22 | yarn add @execution-machine/sdk 23 | ``` 24 | 25 | 26 | 27 | ## Importación 28 | 29 | Cuando utilizas EXM con tu proyecto, el paquete debe ser importado de la siguiente manera. 30 | 31 | 32 | 33 | 34 | ```js 35 | import { Exm } from '@execution-machine/sdk'; 36 | ``` 37 | 38 | 39 | 40 | ## Creación de una instancia 41 | 42 | Para interactuar con EXM después de la instalación y la importación, se debe crear una instancia. 43 | 44 | 45 | 46 | 47 | ```js 48 | const exmInstance = new Exm({ token: 'MI_TOKEN_EXM' }); 49 | ``` 50 | 51 | 52 | 53 | ## Resumen 54 | 55 | Las siguientes guías mostrarán cómo desplegar funciones sin servidor utilizando el SDK de EXM JS y cómo interactuar con ellas. -------------------------------------------------------------------------------- /docs/src/es/guides/posting-transactions/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | Por favor, consulte los ejemplos adjuntos al concepto fundamental de publicación de transacciones. 6 | 7 | - Ejemplo de [arweave-js](/guides/posting-transactions/arweave-js.md) 8 | - Ejemplo de [irys.xyz](/guides/posting-transactions/irys.md) 9 | - Ejemplo de [dispatch](/guides//posting-transactions/dispatch.md) 10 | -------------------------------------------------------------------------------- /docs/src/es/guides/posting-transactions/dispatch.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Publicar una Transacción usando Dispatch 5 | Las carteras de Arweave en el navegador tienen el concepto de despachar transacciones. ¡Si la transacción tiene un tamaño menor a 100KB se puede publicar de forma gratuita! 6 | ## Despachando una Transacción 7 | Esto se puede hacer sin ninguna dependencia de paquetes para la aplicación del cliente. Siempre y cuando el usuario tenga una cartera activa en el navegador y los datos sean menores a 100KB, las transacciones despachadas son gratuitas y se garantiza que serán confirmadas en la red. 8 | 9 | ```js:no-line-numbers 10 | // usar arweave-js para crear una transacción 11 | let tx = await arweave.createTransaction({ data:"¡Hola Mundo!" }) 12 | 13 | // agregar algunas etiquetas personalizadas a la transacción 14 | tx.addTag('App-Name', 'PublicSquare') 15 | tx.addTag('Content-Type', 'text/plain') 16 | tx.addTag('Version', '1.0.1') 17 | tx.addTag('Type', 'post') 18 | 19 | // usar la cartera del navegador para despachar() la transacción 20 | let result = await window.arweaveWallet.dispatch(tx); 21 | 22 | // registrar el ID de la transacción 23 | console.log(result.id); 24 | ``` 25 | 26 | ## Recursos 27 | * Para una visión general de todas las formas en las que se pueden publicar transacciones, consulta la sección [Publicar Transacciones](../../concepts/post-transactions.md) del libro de cocina. -------------------------------------------------------------------------------- /docs/src/es/guides/querying-arweave/ar-gql.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # ar-gql 5 | Este paquete es una capa mínima encima de GraphQL, admite consultas parametrizadas con variables de consulta. También implementa la gestión de resultados paginados. 6 | 7 | ## Instalación 8 | 9 | Para instalar `ar-gql`, ejecuta 10 | 11 | 12 | 13 | ```console:no-line-numbers 14 | npm i ar-gql 15 | ``` 16 | 17 | 18 | 19 | ```console:no-line-numbers 20 | yarn add ar-gql 21 | ``` 22 | 23 | 24 | 25 | ## Ejemplo 26 | ```js:no-line-numbers 27 | import { arGql } from "ar-gql" 28 | 29 | const argql = arGql() 30 | 31 | (async () => { 32 | let results = await argql.run(`query( $count: Int ){ 33 | transactions( 34 | first: $count, 35 | tags: [ 36 | { 37 | name: "App-Name", 38 | values: ["PublicSquare"] 39 | }, 40 | { 41 | name: "Content-Type", 42 | values: ["text/plain"] 43 | }, 44 | ] 45 | ) { 46 | edges { 47 | node { 48 | id 49 | owner { 50 | address 51 | } 52 | data { 53 | size 54 | } 55 | block { 56 | height 57 | timestamp 58 | } 59 | tags { 60 | name, 61 | value 62 | } 63 | } 64 | } 65 | } 66 | }`, {count: 1}); 67 | console.log(results); 68 | })(); 69 | ``` 70 | 71 | ## Recursos 72 | * [Página de Github de ar-gql](https://github.com/johnletey/arGql) -------------------------------------------------------------------------------- /docs/src/es/guides/querying-arweave/ardb.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # ArDB 5 | Una biblioteca construida sobre GraphQL que permite consultar datos de transacciones y bloques de Arweave sin necesidad de memorizar los nombres de los parámetros de GraphQL. Simplemente construye consultas utilizando el autocompletado en tu editor de código favorito. 6 | 7 | ## Instalación 8 | ```console:no-line-numbers 9 | yarn add ardb 10 | ``` 11 | 12 | ## Ejemplo 13 | ```js:no-line-numbers 14 | import Arweave from 'arweave'; 15 | import ArDB from 'ardb'; 16 | 17 | // inicializa una instancia de Arweave 18 | const arweave = Arweave.init({}); 19 | 20 | // arweave es una instancia de cliente de Arweave 21 | const ardb = new ArDB(arweave); 22 | 23 | // Obtén una transacción individual por su id 24 | const tx = await ardb.search('transacción') 25 | .id('A235HBk5p4nEWfjBEGsAo56kYsmq7mCCyc5UZq5sgjY') 26 | .findOne(); 27 | 28 | // Obtén un arreglo de transacciones e incluye solo el primer resultado 29 | const txs = await ardb.search('transacciones') 30 | .appName('SmartWeaveAction') 31 | .findOne(); 32 | 33 | // Esto es lo mismo que hacer: 34 | const txs = await ardb.search('transacciones') 35 | .tag('App-Name', 'SmartWeaveAction') 36 | .limit(1) 37 | .find(); 38 | 39 | // Busca varias transacciones de un propietario/dirección de billetera específico 40 | const txs = await ardb.search('transacciones') 41 | .from('BPr7vrFduuQqqVMu_tftxsScTKUq9ke0rx4q5C9ieQU') 42 | .find(); 43 | 44 | // Continúa paginando a través de los resultados con... 45 | const newTxs = await ardb.next(); 46 | 47 | // O puedes obtener todos los resultados de una vez haciendo: 48 | const txs = await ardb.search('bloques') 49 | .id('BkJ_h-GGIwfek-cJd-RaJrOXezAc0PmklItzzCLIF_aSk36FEjpOBuBDS27D2K_T') 50 | .findAll(); 51 | 52 | ``` 53 | 54 | ## Recursos 55 | * [Paquete NPM de ArDB](https://www.npmjs.com/package/ardb) -------------------------------------------------------------------------------- /docs/src/es/guides/using-vue.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Uso de Vue en Markdown 5 | 6 | ## Restricciones de acceso a la API del navegador 7 | 8 | Debido a que las aplicaciones de VuePress se renderizan en el servidor con Node.js al generar compilaciones estáticas, cualquier uso de Vue debe cumplir con los [requisitos de código universal](https://ssr.vuejs.org/es/universal.html). En resumen, asegúrate de solo acceder a las API del navegador / DOM en los hooks `beforeMount` o `mounted`. 9 | 10 | Si estás utilizando o demostrando componentes que no son compatibles con SSR (por ejemplo, aquellos que contienen directivas personalizadas), puedes envolverlos dentro del componente incorporado ``. -------------------------------------------------------------------------------- /docs/src/es/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | onboarding: true 4 | --- 5 | 6 | # Cocinando con la Permaweb 7 | 8 | El libro de cocina de la Permaweb es un recurso para desarrolladores que proporciona los conceptos esenciales y las referencias para construir aplicaciones en la Permaweb. Cada concepto y referencia se centrará en aspectos específicos del ecosistema de desarrollo de la Permaweb, a la vez que proporcionará detalles adicionales y ejemplos de uso. 9 | 10 | ## Desarrolladores 11 | 12 | Bienvenidos a la comunidad de desarrollo de Arweave, donde el pasado queda grabado para siempre en la blockchain y el futuro está lleno de posibilidades infinitas. ¡Construyamos juntos la web descentralizada! 13 | 14 | [Más información](getting-started/welcome.md) 15 | 16 | ## Contribuciones 17 | 18 | El libro de cocina está diseñado de manera que resulta fácil para los nuevos desarrolladores de Permaweb contribuir. Incluso si no sabes hacer algo, contribuir al libro de cocina es una excelente manera de aprender. 19 | 20 | Echa un vistazo a todos los problemas abiertos aquí. Puedes encontrar las pautas de contribución aquí. Si descubres que el libro de cocina carece de algún concepto, guía o referencia, por favor agrega un problema. 21 | 22 | [Más información](getting-started/contributing.md) 23 | 24 | ## Cómo Leer el Libro de Cocina 25 | 26 | El libro de cocina de la Permaweb se divide en diferentes secciones, cada una dirigida a un objetivo diferente. 27 | 28 | | Sección | Descripción | 29 | | ------------- | ----------------------------------------------------------------------------------- | 30 | | Conceptos Básicos | Bloques fundamentales de la Permaweb que es importante conocer para el desarrollo | 31 | | Guías | Guías breves sobre diferentes herramientas para el desarrollo | 32 | | Referencias | Referencias a fragmentos de código comúnmente necesarios | 33 | | Kits de inicio | Kits iniciales de marcos de frontend para que puedas comenzar a construir en la Permaweb en poco tiempo | 34 | 35 | ## Inicios Rápidos 36 | 37 | Estas son guías breves para ayudar a los desarrolladores de todos los niveles de experiencia a publicar código en la Permaweb. 38 | 39 | - [Hola Mundo (Sin Código)](getting-started/quick-starts/hw-no-code.md) -------------------------------------------------------------------------------- /docs/src/es/kits/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Kits de inicio 5 | 6 | Los kits de inicio son repositorios tipo boilerplate para frameworks específicos configurados y listos para usar, para construir en la permaweb. 7 | 8 | - [Svelte](./svelte/index.md) 9 | - [React](./react/index.md) 10 | - [Vue](./vue/index.md) -------------------------------------------------------------------------------- /docs/src/es/kits/react/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Paquetes de inicio de React 5 | 6 | React es una biblioteca popular utilizada para construir interfaces de usuario. Junto con otras herramientas populares como create-react-app, un proyecto de React puede compilarse en un paquete. Este paquete se puede cargar como una transacción en la permaweb donde servirá como una aplicación de página única. 7 | 8 | Guías de paquetes de inicio de React: 9 | 10 | * [Vite](./vite.md) - utiliza Vite para construir una aplicación permaweb de React 11 | * [Create React App](./create-react-app.md) - utiliza Create React App para construir una aplicación permaweb de React 12 | 13 | ::: info Restricciones de la aplicación permaweb 14 | * 100% de la aplicación en el lado del cliente (sin backend en el lado del servidor) 15 | * Las aplicaciones se sirven desde una sub-ruta (https://[gateway]/[TX_ID]) 16 | ::: -------------------------------------------------------------------------------- /docs/src/es/kits/svelte/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Kits de inicio de Svelte 5 | 6 | Svelte es un marco que se compila en un paquete de JavaScript y en el proceso elimina el marco de la distribución de la aplicación. Esto resulta en un tamaño mucho más pequeño que otros marcos. Svelte es el marco perfecto para las aplicaciones Permaweb. Una aplicación Permaweb se construye sobre los principios de una aplicación de una sola página, pero vive en la red Arweave y se distribuye a través de los gateways de Permaweb. 7 | 8 | Guías de Kits de inicio de Svelte: 9 | 10 | * [Mínimo](./minimal.md) - lo mínimo necesario para construir una aplicación svelte permaweb 11 | * [Vite](./vite.md) - Svelte, Typescript y Vite 12 | 13 | ::: info Restricciones de la aplicación Permaweb 14 | * 100% aplicación frontend (sin backend del lado del servidor) 15 | * Las aplicaciones se sirven desde un subdirectorio (https://[gateway]/[TX_ID]) 16 | ::: -------------------------------------------------------------------------------- /docs/src/es/kits/vue/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | # Juegos de inicio de Vue 5 | 6 | Vue.js es un marco de JavaScript progresivo que permite construir interfaces de usuario. A diferencia de otros marcos, compila la plantilla en JavaScript durante el tiempo de ejecución, lo que se traduce en un tamaño de archivo más pequeño y un rendimiento más rápido. Vue es ideal para construir aplicaciones de una sola página escalables y de alto rendimiento, lo que lo convierte en una opción popular entre los desarrolladores front-end. 7 | 8 | Guía de kits de inicio de Vue: 9 | 10 | **Nota:** - Dado que `npm init vue@latest` ya utiliza vite, no hemos incluido una guía de vite para Vue. 11 | 12 | * [Crear aplicación Vue](./create-vue.md) - Utilice Crear Vue para construir de manera eficiente una aplicación basada en Vue.js con TypeScript y Vite en la permaweb moderna. 13 | 14 | ::: info Restricciones de la aplicación en la permaweb 15 | * Aplicación 100% front-end (sin backend en el lado del servidor) 16 | * Las aplicaciones se sirven desde una subruta (https://[gateway]/[TX_ID]) 17 | ::: -------------------------------------------------------------------------------- /docs/src/es/references/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: es 3 | --- 4 | 5 | # Referencias 6 | 7 | ## Arweave Whitepaper 8 | 9 | - Documento técnico de Arweave: El nuevo estándar para el almacenamiento permanente y distribuido. 10 | - Disponible en: [https://www.arweave.org/whitepapers](https://www.arweave.org/whitepapers) 11 | 12 | ## Blockchain Infrastructure for Decentralized Applications 13 | 14 | - Artículo académico sobre la infraestructura blockchain para aplicaciones descentralizadas. 15 | - Autor: [Alan Alderson](https://www.example.com) 16 | 17 | ## Linguistics and Blockchain 18 | 19 | - Publicación académica sobre la relación entre lingüística y tecnología blockchain. 20 | - Autores: [John Johnson](https://www.example.com), [María Martínez](https://www.example.com) 21 | 22 | ## Understanding ArQL 23 | 24 | - Guía para comprender y utilizar ArQL, el lenguaje de consulta de Arweave. 25 | - Disponible en: [https://www.arweave.org/arql-documentation](https://www.arweave.org/arql-documentation) 26 | -------------------------------------------------------------------------------- /docs/src/getting-started/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | # Cooking with the Permaweb 6 | 7 | The Permaweb Cookbook is a developer resource that provides the essential concepts and references for buiding applications on the Permaweb. Each concept and reference will focus on specific aspects of the Permaweb development ecosystem while providing additional details and usage examples. 8 | 9 | ## Developers 10 | 11 | Welcome to the Arweave development community, where the past is forever etched in the blockchain and the future is full of endless possibilities. Let's build the decentralized web together! 12 | 13 | [Read More](welcome.md) 14 | 15 | ## Contributing 16 | 17 | The Cookbook is designed in a way that makes it easy for new Permaweb developers to contribute. Even if you don't know how to do something, contributing to the cookbook is a great way to learn! 18 | 19 | Check out all open issues here. Contribution guidelines here. if you find the cookbook is missing a concept, guide or reference, please add an issue. 20 | 21 | [Read More](contributing.md) 22 | 23 | 24 | ## How to Read the Cookbook 25 | 26 | The Permaweb Cookbook is split into different sections, each aimed at a different goal. 27 | 28 | | Section | Description | 29 | | ------- | ----------- | 30 | | Core Concepts | Building blocks of the Permaweb that are good to know for development | 31 | | Guides | Snack-sized guides about different tools for development | 32 | | References | References to commonly needed code snippets | 33 | | Starter Kits | Front-end Framework Starters to get you started building on the Permaweb in no time | 34 | 35 | ## Quick Starts 36 | 37 | These are small guides to help developers from every experience level to ship code the the permaweb. 38 | 39 | - [Hello World (NodeJS)](quick-starts/hw-nodejs.md) 40 | -------------------------------------------------------------------------------- /docs/src/getting-started/quick-starts/hw-cli.md: -------------------------------------------------------------------------------- 1 | # Hello World (CLI) 2 | 3 | This guide walks you through the most simple way to get data on to the permaweb using a command-line interface (CLI). 4 | 5 | ## Requirements 6 | 7 | - [NodeJS](https://nodejs.org) LTS or greater 8 | 9 | ## Description 10 | 11 | Using a terminal/console window create a new folder called `hw-permaweb-1`. 12 | 13 | ## Setup 14 | 15 | ```sh 16 | cd hw-permaweb-1 17 | npm init -y 18 | npm install arweave ardrive-cli 19 | ``` 20 | 21 | ## Generate a wallet 22 | 23 | ```sh 24 | npx -y @permaweb/wallet > ~/.demo-arweave-wallet.json 25 | ``` 26 | 27 | ## Create a web page 28 | 29 | ```sh 30 | echo "

Hello Permaweb

" > index.html 31 | ``` 32 | 33 | ## Upload using Ardrive CLI 34 | 35 | ```sh 36 | # Create a Drive 37 | FOLDER_ID=$(npx ardrive create-drive -n public -w ~/.demo-arweave-wallet.json --turbo | jq -r '.created[] | select(.type == "folder") | .entityId') 38 | # Upload file 39 | TX_ID=$(npx ardrive upload-file -l index.html --content-type text/html -w ~/.demo-arweave-wallet.json --turbo -F ${FOLDER_ID} | jq -r '.created[] | select(.type == "file 40 | ") | .dataTxId') 41 | # open file from ar.io gateway 42 | open https://g8way.io/${TX_ID} 43 | ``` 44 | 45 | -------------------------------------------------------------------------------- /docs/src/getting-started/quick-starts/hw-no-code.md: -------------------------------------------------------------------------------- 1 | # Hello World (No Code) 2 | 3 | In this quick start we are going to upload an image to the permaweb with no code! 4 | 5 | ## Requirements 6 | 7 | * Computer 8 | * Internet 9 | * Modern web browser 10 | 11 | ## Create a wallet 12 | 13 | [https://arweave.app/add](https://arweave.app/add) or [https://arconnect.io](https://arconnect.io) 14 | 15 | ## Send some data to arweave 16 | 17 | Go to [https://hello_cookbook.arweave.dev](https://hello_cookbook.arweave.dev) 18 | 19 | Enter some data and click publish, connect your wallet and "BAM" 20 | 21 | ## Congrats!! 22 | 23 | You just published some data on Arweave using zero code. 24 | 25 | > To check out the project -> https://github.com/twilson63/pw-no-code-hello 26 | -------------------------------------------------------------------------------- /docs/src/getting-started/welcome.md: -------------------------------------------------------------------------------- 1 | # Developing on the Permaweb 2 | 3 | ## Welcome to the Permaweb 4 | 5 | Creating applications on the permaweb, which is built on the Arweave protocol, is similar to building traditional web applications but with some key differences. 6 | 7 | One major difference is that data is stored on the permaweb permanently, as the name suggests, rather than on a centralized server. This means that once data is uploaded to the permaweb, it cannot be deleted or altered. This can be beneficial for applications that require tamper-proof data storage, such as supply chain management or voting systems. 8 | 9 | Another difference is that the permaweb is decentralized, meaning there is no central point of control or failure. This can provide increased security and reliability for applications. 10 | 11 | Additionally, the permaweb uses a unique token, called AR, to pay for the storage of data on the network. This can add a new layer of complexity to application development, as developers need to consider how to integrate AR into their applications and handle payments. 12 | 13 | Overall, the experience of creating applications on the permaweb can be challenging, but it can also be rewarding as it offers unique benefits over traditional web development. 14 | 15 | ## Hello Worlds 16 | 17 | * [Hello World (No Code)](./quick-starts/hw-no-code.md) 18 | * [Hello World (CLI)](./quick-starts/hw-cli.md) -------------------------------------------------------------------------------- /docs/src/guides/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Permaweb Cookbook - Guides 3 | --- 4 | 5 | # Guides 6 | 7 | Snack-sized guides for the building blocks of the Permaweb 8 | 9 | - [ArProfile](arprofile.md) 10 | - [DNS Integration](dns-integration/server-side.md) 11 | - [Server Side](dns-integration/server-side.md) 12 | - [Spheron](dns-integration/spheron.md) 13 | - [Deploying Apps](deployment/index.md) 14 | - [arkb](deployment/arkb.md) 15 | - [github-action](deployment/github-action.md) 16 | - [Deploying PathManifests](deploying-manifests/deployingManifests.md) 17 | - [arweave.app](deploying-manifests/arweave-app.md) 18 | - [ardrive](deploying-manifests/ardrive.md) 19 | - [Deploying PSTs](deploying-psts.md) 20 | - [GraphQL](querying-arweave/queryingArweave.md) 21 | - [ArDB](querying-arweave/ardb.md) 22 | - [ar-gql](querying-arweave/ar-gql.md) 23 | - [Search Service](querying-arweave/search-indexing-service.md) 24 | - [Testing](testing/arlocal.md) 25 | 26 | > Do you think a permaweb guide is missing? Create a issue at [Github](https://github.com/twilson63/permaweb-cookbook/issues) or consider [contributing](../getting-started/contributing.md) 27 | -------------------------------------------------------------------------------- /docs/src/guides/deploying-manifests/ardrive.md: -------------------------------------------------------------------------------- 1 | ### ArDrive 2 | 3 | --- 4 | 5 | You can create a manifest for a folder or group of folders with `ardrive create-manifest` using the [ArDrive CLI](https://github.com/ardriveapp/ardrive-cli). 6 | 7 | Further Reading: [ArDrive CLI Docs](https://github.com/ardriveapp/ardrive-cli) 8 | 9 | --- 10 | 11 | Alternatively, you can create a manifest using the [ArDrive](https://ardrive.io) web app by selecting New → Create manifest while inside of a drive. 12 | 13 | ![ArDrive Web App Manifest](~@source/images/ardrive-manifests.png) -------------------------------------------------------------------------------- /docs/src/guides/deploying-manifests/arweave-app.md: -------------------------------------------------------------------------------- 1 | ### Arweave.app 2 | 3 | --- 4 | 5 | Uploading a directory through [Arweave.app](http://Arweave.app) will automatically create a manifest for all of the files in the directory. 6 | 7 | ![ArweaveApp Manifest Upload](~@source/images/arweaveapp-manifest.png) 8 | 9 | Alternatively, you can upload your own manifest file manually, add the following tag, and submit the transaction. 10 | 11 | ![ArweaveApp Manifest Tags](~@source/images/arweaveapp-tags.png) -------------------------------------------------------------------------------- /docs/src/guides/deploying-manifests/deployingManifests.md: -------------------------------------------------------------------------------- 1 | # Creating and Deploying Manifests 2 | 3 | --- 4 | 5 | This guide lays out how to create and deploy a path manifest manually. 6 | 7 | The path manifests core concepts page has more information on what manifests are, and why they might be useful for your project. 8 | 9 | If you follow this guide to deploy a path manifest, it will need to follow the manifest structure laid out in the [core concepts](https://cookbook.arweave.dev/concepts/manifests.html) page. -------------------------------------------------------------------------------- /docs/src/guides/deployment/index.md: -------------------------------------------------------------------------------- 1 | # Deployment 2 | 3 | - [arkb](arkb.md) 4 | - [github-action](github-action.md) -------------------------------------------------------------------------------- /docs/src/guides/dns-integration/spheron.md: -------------------------------------------------------------------------------- 1 | # Spheron 2 | 3 | The Spheron Protocol is a decentralized platform designed to streamline the creation of modern dapps. It offers a seamless experience for developers, allowing for quick deployment, automatic scaling, and personalized content delivery on decentralized networks. 4 | 5 | Spheron uses a GitHub integration to handle continuous deployments and gives us the ability to integrate custom DNS to any given deployment. 6 | 7 | ## What you will need to set up a Spheron account 8 | 9 | * A GitHub account 10 | * A permaweb application identifier and is deployed on the permaweb 11 | 12 | ::: tip 13 | To deploy Arweave applications using Spheron, you will need the Pro Plan which is $20/month 14 | ::: 15 | 16 | ## Authentication/Log in 17 | 18 | Spheron relies on GitHub, GitLab or BitBucket repo's for their deployments, similar to Vercel. 19 | 20 | To log in to Spheron, head to the [Spheron Aqua dashboard](https://app.spheron.network/) and select your preferred authentication. 21 | 22 | ## Import repo 23 | 24 | Once logged in, you will be presented with the user dashboard. Click the "New Project" button in the top right of the dashboard to import a repo. Select the repo you want and choose the option to deploy to Arweave. 25 | 26 | ## Connecting to DNS 27 | 28 | Now that you've imported your project and deployed, go to the "Domains" tab. Enter the domain name, environment and select a domain to point the deployment to. 29 | 30 | Before continuing, you will be asked to verify your configured records. Update the record in your domain manager. Updating a DNS can take up to 72 hours. You will see something similar to the image below: 31 | 32 | 33 | 34 | Once updated, you will need to verify in Spheron. Click the `Verify` button and you should be all set and ready to go. Now whenever you deploy a new version to GitHub, your domain will be updated with the newest version!🎉 35 | 36 | 37 | ::: tip 38 | To create a fully decentralized application, be sure to use [ArNS](https://ar.io/arns) or any decentralized DNS server 39 | ::: 40 | ## Summary 41 | 42 | Spheron is a straight-forward way for deploying Permaweb applications to Arweave, and redirecting them to custom domains. Combining continuous integration and continuous deployment, ensuring a smooth developer experience all round! 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/src/guides/exm/api.md: -------------------------------------------------------------------------------- 1 | # Execution Machine API Token 2 | 3 | EXM seeks to be crypto agnostic and requires only a single API token (also known as key) to interact with. This API key is required for most actions in EXM like deployments and write operations. 4 | 5 | ## Creating an API Token 6 | 7 | For creating an API token, the following steps must be performed: 8 | 9 | - Go to the [main page](https://exm.dev/). 10 | - Choose the preferred method to Sign-Up/ Sign-In. 11 | 12 | ![EXM Sign In Options](~@source/images/exm-sign-in-options.png) 13 | 14 | - After being redirected to the dashboard, click on "New Token". 15 | 16 | ![Create New API Token](~@source/images/exm-create-token.png) 17 | 18 | - Copy the token that has been generated and use it with the SDK or CLI. 19 | 20 | ## Handling API Token safely 21 | 22 | The token is an identifier to our account and lets us access functions associated with it. Hence, it is vital to ensure this token is kept secret to prevent any spams and attacks to our functions. The best way to do so is using environment variables. 23 | 24 | There are two ways to store environment variables: 25 | 26 | 1. Through the command line: 27 | 28 | In the directory of the project, pass the following command: 29 | 30 | ```bash 31 | export EXM_PK= 32 | ``` 33 | 34 | 2. Through the `dotenv` sdk: 35 | 36 | - Run the following in the command line: 37 | 38 | ```bash 39 | npm install dotenv 40 | 41 | #OR 42 | 43 | yarn add dotenv 44 | ``` 45 | - Import the library in file using the variables: 46 | 47 | ```jsx 48 | import dotenv from "dotenv"; 49 | dotenv.config(); 50 | ``` 51 | 52 | Then this key can be refered inside files as `process.env.EXM_PK` without exposing it or pushing it to version control systems like GitHub. -------------------------------------------------------------------------------- /docs/src/guides/exm/js-sdk/sdk-intro.md: -------------------------------------------------------------------------------- 1 | # Execution Machine SDK 2 | 3 | The JavaScript SDK enables the usage of Execution Machine (EXM) in JavaScript and TypeScript applications. To use the SDK the following setup steps are needed. 4 | 5 | ## Install 6 | 7 | To install EXM in your project you can use `npm` or `yarn`. 8 | 9 | 10 | 11 | 12 | ```bash 13 | npm install @execution-machine/sdk 14 | ``` 15 | 16 | 17 | 18 | 19 | ```bash 20 | yarn add @execution-machine/sdk 21 | ``` 22 | 23 | 24 | 25 | 26 | ## Import 27 | 28 | When using EXM with your project the package must be imported as follows. 29 | 30 | 31 | 32 | 33 | ```js 34 | import { Exm } from '@execution-machine/sdk'; 35 | ``` 36 | 37 | 38 | 39 | ## Creating an instance 40 | 41 | To interact with EXM after installation and importing, an instance must be created. 42 | 43 | 44 | 45 | 46 | ```js 47 | const exmInstance = new Exm({ token: 'MY_EXM_TOKEN' }); 48 | ``` 49 | 50 | 51 | 52 | ## Summary 53 | 54 | The following guides will show how to deploy serverless functions using the EXM JS SDK, and how to interact with them. -------------------------------------------------------------------------------- /docs/src/guides/exm/js-sdk/sdk-read.md: -------------------------------------------------------------------------------- 1 | # Read from Serverless Functions with Execution Machine SDK 2 | 3 | There are two ways of reading state from an EXM serverless functions. As explained in the [introduction](../intro.md#serverless-functions-on-arweave), EXM stores a copy of the function on a cache layer for rapidly serving applications but also uploads the function on Arweave to maintain decentralisation and its associated benefits. As a result of this, the function state can be read either from EXM's cache layer or directly from Arweave. 4 | 5 | 1. Reading from EXM's cache layer: 6 | 7 | The read call reads the latest state as stored on EXM's cached layer. This layer is specifically designed for rapily serving applications. It takes an optimistic approach and updates the function state immediately upoon receiving a transaction request. 8 | 9 | 10 | 11 | 12 | ```js 13 | import { Exm } from '@execution-machine/sdk'; 14 | import { functionId } from './functionId.js'; 15 | 16 | // init new EXM instance 17 | const exm = new Exm({ token: process.env.EXM_API_TOKEN }); 18 | 19 | // read from cached layer 20 | const readResult = await exm.functions.read(functionId); 21 | console.log(readResult); 22 | ``` 23 | 24 | 25 | 26 | 27 | 2. Reading directly from Arweave (Evaluate): 28 | 29 | The evaluate call returns the latest state as successfully processed on Arweave. This latest state is calculated by [lazy evaluation](../intro.md#how-does-it-work-in-the-background), which evaluates the initial state and the interactions with the function in order of ocurrence to arrive at the latest state. 30 | 31 | 32 | 33 | 34 | ```js 35 | import { Exm } from '@execution-machine/sdk'; 36 | import { functionId } from './functionId.js'; 37 | 38 | // init new EXM instance 39 | const exm = new Exm({ token: process.env.EXM_API_TOKEN }); 40 | 41 | // evaluate from arweave 42 | const evalResult = await exm.functions.evaluate(functionId); 43 | console.log(evalResult); 44 | ``` 45 | 46 | 47 | 48 | 49 | ::: tip 50 | Reading from Arweave is recommended for verification purposes only. The function state returned from the evaluate call can be checked against the information returned by the cache layer to ensure its authenticity. There may be a slight lag in posting the transaction request and it updating on the network. 51 | ::: 52 | 53 | -------------------------------------------------------------------------------- /docs/src/guides/posting-transactions/README.md: -------------------------------------------------------------------------------- 1 | Please the the examples attached to Posting Transactions Core Concept. 2 | 3 | - [arweave-js](/guides/posting-transactions/arweave-js.md) example 4 | - [dispatch](/guides//posting-transactions/dispatch.md) example 5 | - [arseeding-js](/guides//posting-transactions/arseeding-js.md) example 6 | - [turbo](/guides//posting-transactions/turbo.md) example 7 | -------------------------------------------------------------------------------- /docs/src/guides/posting-transactions/arseeding-js.md: -------------------------------------------------------------------------------- 1 | # Posting Transactions using arseeding.js 2 | You can use the `arseeding-js` JavaScript SDK package to publish transactions on the Arweave network. Arseeding automatically broadcasts the transaction to all Arweave nodes in the network, ensuring that the transaction is promptly received in the pending pool of all Arweave nodes, thus increasing the transaction's packaging speed. 3 | ## Installing arseeding.js 4 | To install `arseeding.js` run: 5 | 6 | 7 | 8 | 9 | ```console:no-line-numbers 10 | npm install arseeding-js 11 | ``` 12 | 13 | 14 | 15 | 16 | ```console:no-line-numbers 17 | yarn add arseeding-js 18 | ``` 19 | 20 | 21 | 22 | 23 | ## Transaction for Uploading Data 24 | When using Arseeding, you must pre-fund your account on [everpay](https://app.everpay.io/). This balance can be funded with $AR tokens or other cryptocurrencies. Another distinction is that the Arseeding service ensures that your data will make it onto the blockchain. 25 | 26 | ```js:no-line-numbers 27 | const { genNodeAPI } = require('arseeding-js') 28 | 29 | const run = async () => { 30 | const instance = genNodeAPI('YOUR PRIVATE KEY') 31 | const arseedUrl = 'https://arseed.web3infra.dev' 32 | const data = Buffer.from('........') 33 | const payCurrencyTag = 'ethereum-usdc-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' // everPay supported token tag (chainType-symbol-id) 34 | const options = { 35 | tags: [{ name: 'Content-Type', value: 'image/png' }] 36 | } 37 | const res = await instance.sendAndPay(arseedUrl, data, payCurrencyTag, options) 38 | console.log('res', res) 39 | } 40 | run() 41 | ``` 42 | 43 | 44 | ## Resources 45 | * For an overview of all methods for publishing transactions, please refer to the [Publishing Transactions](../../concepts/post-transactions.md) section in the operation manual. 46 | 47 | * You can find the complete Arseeding documentation on the [Arseeding website](https://web3infra.dev/docs/arseeding/introduction/lightNode/). 48 | 49 | * Follow the Arseeding Upload Manifest tutorial [here](https://web3infra.dev/docs/arseeding/sdk/arseeding-js/manifest/). -------------------------------------------------------------------------------- /docs/src/guides/posting-transactions/dispatch.md: -------------------------------------------------------------------------------- 1 | # Posting a Transaction using Dispatch 2 | Arweave Browser wallets have the concept of dispatching transactions. If the transaction is under 100KB in size it can be posted for free! 3 | ## Dispatching a Transaction 4 | This can be done without any package dependencies for the client app. As long as the user has a browser wallet active and the data is less than 100KB, dispatched transactions are free and guaranteed to be confirmed on the network. 5 | 6 | ```js:no-line-numbers 7 | // use arweave-js to create a transaction 8 | let tx = await arweave.createTransaction({ data:"Hello World!" }) 9 | 10 | // add some custom tags to the transaction 11 | tx.addTag('App-Name', 'PublicSquare') 12 | tx.addTag('Content-Type', 'text/plain') 13 | tx.addTag('Version', '1.0.1') 14 | tx.addTag('Type', 'post') 15 | 16 | // use the browser wallet to dispatch() the transaction 17 | let result = await window.arweaveWallet.dispatch(tx); 18 | 19 | // log out the transactino id 20 | console.log(result.id); 21 | ``` 22 | 23 | ## Resources 24 | * For an overview of all the ways you can post transactions, see the [Posting Transactions](../../concepts/post-transactions.md) section of the cookbook. -------------------------------------------------------------------------------- /docs/src/guides/querying-arweave/ar-gql.md: -------------------------------------------------------------------------------- 1 | # ar-gql 2 | This package is a minimal layer on top of GraphQL, it supports parameterized queries with query variables. It also implements management of paged results. 3 | 4 | ## Installation 5 | 6 | To install `ar-gql run 7 | 8 | 9 | 10 | ```console:no-line-numbers 11 | npm i ar-gql 12 | ``` 13 | 14 | 15 | 16 | ```console:no-line-numbers 17 | yarn add ar-gql 18 | ``` 19 | 20 | 21 | 22 | ## Example 23 | ```js:no-line-numbers 24 | import { arGql } from "ar-gql" 25 | 26 | const argql = arGql() 27 | 28 | (async () => { 29 | let results = await argql.run(`query( $count: Int ){ 30 | transactions( 31 | first: $count, 32 | tags: [ 33 | { 34 | name: "App-Name", 35 | values: ["PublicSquare"] 36 | }, 37 | { 38 | name: "Content-Type", 39 | values: ["text/plain"] 40 | }, 41 | ] 42 | ) { 43 | edges { 44 | node { 45 | id 46 | owner { 47 | address 48 | } 49 | data { 50 | size 51 | } 52 | block { 53 | height 54 | timestamp 55 | } 56 | tags { 57 | name, 58 | value 59 | } 60 | } 61 | } 62 | } 63 | }`, {count: 1}); 64 | console.log(results); 65 | })(); 66 | ``` 67 | 68 | ## Resources 69 | * [ar-gql github page](https://github.com/johnletey/arGql) 70 | -------------------------------------------------------------------------------- /docs/src/guides/querying-arweave/ardb.md: -------------------------------------------------------------------------------- 1 | # ArDB 2 | A library built on top of GraphQL that makes it possible to query transaction and block data from arweave without having to memorize GraphQL parameter names. Just build queries using autocomplete in your favorite code editor. 3 | 4 | ## Installation 5 | ```console:no-line-numbers 6 | yarn add ardb 7 | ``` 8 | 9 | ## Example 10 | ```js:no-line-numbers 11 | import Arweave from 'arweave'; 12 | import ArDB from 'ardb'; 13 | 14 | // initialize an arweave instance 15 | const arweave = Arweave.init({}); 16 | 17 | // arweave is Arweave Client instance 18 | const ardb = new ArDB(arweave); 19 | 20 | // Get a single transaction by its id 21 | const tx = await ardb.search('transaction') 22 | .id('A235HBk5p4nEWfjBEGsAo56kYsmq7mCCyc5UZq5sgjY') 23 | .findOne(); 24 | 25 | // Get an array of transactions and include only the first result 26 | const txs = await ardb.search('transactions') 27 | .appName('SmartWeaveAction') 28 | .findOne(); 29 | 30 | // This is the same as doing: 31 | const txs = await ardb.search('transactions') 32 | .tag('App-Name', 'SmartWeaveAction') 33 | .limit(1) 34 | .find(); 35 | 36 | // Search for multiple transactions from a specific owner/wallet address 37 | const txs = await ardb.search('transactions') 38 | .from('BPr7vrFduuQqqVMu_tftxsScTKUq9ke0rx4q5C9ieQU') 39 | .find(); 40 | 41 | // Continue paging though the results with... 42 | const newTxs = await ardb.next(); 43 | 44 | // Or you could get all results at once by doing: 45 | const txs = await ardb.search('blocks') 46 | .id('BkJ_h-GGIwfek-cJd-RaJrOXezAc0PmklItzzCLIF_aSk36FEjpOBuBDS27D2K_T') 47 | .findAll(); 48 | 49 | ``` 50 | 51 | ## Resources 52 | * [ArDB NPM package](https://www.npmjs.com/package/ardb) -------------------------------------------------------------------------------- /docs/src/guides/smartweave/atomic-assets/index.md: -------------------------------------------------------------------------------- 1 | # Atomic Assets 2 | 3 | An atomic asset is a unique package that includes data, labels (also known as tags), and a specific agreement, all under a single, unchangeable identifier. This allows applications and users to access the data, labels, and agreement by using just this one identifier. 4 | 5 | To enable trading of the Atomic Asset, we must connect it to something called a SmartWeave Token. This connection transforms the asset into what's known as an Atomic Token and allows it to be exchanged or traded. 6 | 7 | The SmartWeave Token has a special feature called a balances object that keeps track of who owns the tokens related to that particular asset. This ensures that ownership and trades are recorded and managed accurately. 8 | 9 | ## Deploying Atomic Assets 10 | 11 | 12 | * [using ArDrive CLI](ardrive-cli) -------------------------------------------------------------------------------- /docs/src/guides/using-vue.md: -------------------------------------------------------------------------------- 1 | # Using Vue in Markdown 2 | 3 | ## Browser API Access Restrictions 4 | 5 | Because VuePress applications are server-rendered in Node.js when generating static builds, any Vue usage must conform to the [universal code requirements](https://ssr.vuejs.org/en/universal.html). In short, make sure to only access Browser / DOM APIs in `beforeMount` or `mounted` hooks. 6 | 7 | If you are using or demoing components that are not SSR friendly (for example containing custom directives), you can wrap them inside the built-in `` component: 8 | 9 | ## 10 | -------------------------------------------------------------------------------- /docs/src/guides/vouch.md: -------------------------------------------------------------------------------- 1 | # Vouch 2 | 3 | There are a few ways to query an Arweave address to verify if it has been vouched by a service. Below is two of those approaches. 4 | ## VouchDAO Package 5 | The `isVouched` function is made available to use in your applications in a straight-forward way. 6 | 7 | #### Installation 8 | Add the package: 9 | 10 | 11 | 12 | ```console:no-line-numbers 13 | npm i vouchdao 14 | ``` 15 | 16 | 17 | 18 | 19 | ```console:no-line-numbers 20 | yarn add vouchdao 21 | ``` 22 | 23 | 24 | 25 | 26 | #### Usage 27 | Inside of an async function you can use the `isVouched` function which will return true if a user is vouched. 28 | 29 | ```js:no-line-numbers 30 | import { isVouched } from 'vouchdao' 31 | (async () => { 32 | const res = await isVouched("ARWEAVE_ADDRESS") // true || undefined 33 | // ... 34 | })(); 35 | ``` 36 | 37 | ## Using GraphQL 38 | You can query the Arweave network using GraphQL to find out if a given Arweave address has been vouched. 39 | 40 | ```graphql 41 | query { 42 | transactions( 43 | tags:{name:"Vouch-For", values:["ARWEAVE_ADDRESS"]} 44 | ) { 45 | edges { 46 | node { 47 | id 48 | tags { 49 | name 50 | value 51 | } 52 | } 53 | } 54 | } 55 | } 56 | ``` 57 | 58 | If the address has been vouched, an array of nodes will be returned with tags pertaining to the service that issues the ANS-109. You can cross reference the `owner address` value with the passed community votes to ensure the service has been verified through community vote via VouchDAO. 59 | 60 | ```graphql 61 | "owner": { 62 | "address": "Ax_uXyLQBPZSQ15movzv9-O1mDo30khslqN64qD27Z8" 63 | }, 64 | "tags": [ 65 | { 66 | "name": "Content-Type", 67 | "value": "application/json" 68 | }, 69 | { 70 | "name": "App-Name", 71 | "value": "Vouch" 72 | }, 73 | { 74 | "name": "App-Version", 75 | "value": "0.1" 76 | }, 77 | { 78 | "name": "Verification-Method", 79 | "value": "Twitter" 80 | }, 81 | { 82 | "name": "Vouch-For", 83 | "value": "ARWEAVE_ADDRESS" 84 | } 85 | ] 86 | ``` 87 | 88 | ## Resources 89 | * [VouchDAO](https://vouch-dao.arweave.dev) 90 | * [VouchDAO Contract](https://sonar.warp.cc/?#/app/contract/_z0ch80z_daDUFqC9jHjfOL8nekJcok4ZRkE_UesYsk) 91 | * [Arweave/GraphQL Playground](https://arweave.net/graphql) -------------------------------------------------------------------------------- /docs/src/id/concepts/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Konsep Inti 6 | 7 | Dasar-dasar Arweave dan Permaweb. 8 | 9 | - [Mengirim Transaksi](post-transactions.md) 10 | - [Metadata (Tag)](tags.md) 11 | - [Meminta](queryTransactions.md) 12 | - [Mengambil Data](/guides/http-api.md) 13 | - [Jenis Transaksi](bundles.md) 14 | - [Bundle](bundles.md) 15 | - [Manifes Jalur](manifests.md) 16 | - [Dompet dan Kunci](keyfiles-and-wallets.md) 17 | - [Permaweb](permaweb.md) 18 | - [Aplikasi Permaweb](permawebApplications.md) 19 | - [Layanan Gateway](gateways.md) 20 | - [Layanan Bundling](bundlers.md) 21 | - [SmartWeave](smartweave.md) 22 | - [Sistem Nama Arweave (ArNS)](arns.md) 23 | - [Token Atomik](atomic-tokens.md) 24 | - [Token Pembagian Keuntungan (PST)](psts.md) 25 | 26 | > Apakah Anda berpikir bahwa ada konsep inti Permaweb yang hilang? Buat *issues* di [Github](https://github.com/twilson63/permaweb-cookbook/issues) atau pertimbangkan untuk [berkontribusi](../getting-started/contributing.md) -------------------------------------------------------------------------------- /docs/src/id/concepts/atomic-tokens.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Konsep dan Prinsip Atomic Token 6 | 7 | ![https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A](https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A) 8 | 9 | Sebuah Atomic Token adalah identifier permanen tunggal yang merujuk pada data dan Kontrak SmartWeave di Permaweb. 10 | 11 | ## Spesifikasi 12 | 13 | Data HARUS disimpan di jaringan arweave dan dapat diakses dengan Menggunakan Identifier Transaksi 14 | 15 | Kontrak HARUS mengimplementasikan objek `balances` yang mewakili kepemilikan Atomic Token 16 | 17 | Kontrak HARUS mengimplementasikan fungsi `transfer` yang mengambil argumen berikut: 18 | - target {Alamat Wallet atau Kontrak} 19 | - qty {Jumlah} 20 | 21 | > Fungsi transfer seharusnya mentransfer kepemilikan dari pemanggil ke target 22 | 23 | ## Opsi 24 | 25 | _Opsi implementasi yang dapat membuat Atomic Token ditemukan dan diperdagangkan di Permaweb_ 26 | 27 | [Verto Flex](https://github.com/useverto/flex) - Pustaka Flex memberikan Atomic token Anda untuk dijual atau dibeli tanpa harus percaya kepada bursa. 28 | 29 | [Tanda Temuan - ANS 110](https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-110.md) - Tag tambahan ini dapat membantu aplikasi dan layanan Permaweb menemukan token Anda. 30 | 31 | [Periksa Panduan Ini](../guides/atomic-tokens/intro.md) -------------------------------------------------------------------------------- /docs/src/id/concepts/bundlers.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Layanan Bundling 6 | 7 | --- 8 | 9 | Dengan layanan bundling, pengguna dapat mengirimkan transaksi data mereka ke layanan bundling untuk "dibundle" bersama dengan transaksi pengguna lain dan dikirimkan sebagai satu transaksi Arweave tunggal dalam blok Arweave yang akan datang. 10 | 11 | ### Mengirimkan ke layanan bundling 12 | 13 | --- 14 | 15 | Anda dapat membaca lebih lanjut tentang cara mengirimkan transaksi Anda ke layanan bundling [di sini](/guides/posting-transactions/irys.md). 16 | 17 | ### Apa itu Bundle? 18 | 19 | --- 20 | 21 | Deskripsi bundle transaksi dan manfaatnya dapat ditemukan [di sini](/concepts/bundles.md). 22 | 23 | ### Apa itu node Bundler? 24 | 25 | --- 26 | 27 | Seorang bundler adalah node yang bertanggung jawab untuk menerima transaksi atau item data dari pengguna, mem-bundlenya, dan mengirimkannya ke jaringan Arweave (dengan jaminan bahwa mereka akan diunggah dengan ID transaksi tertentu). 28 | 29 | Pionir layanan bundling dan bundler terbesar saat ini adalah [irys.xyz](https://irys.xyz). Node Irys menjalankan: 30 | 31 | - Proksi terbalik NGINX 32 | - Proses API HTTP 33 | - Cache Redis 34 | - Database SQL (Postgres) 35 | - Proses pekerja 36 | 37 | Semuanya memastikan bahwa data dipertahankan hingga diunggah ke Arweave. 38 | 39 | ### Mendukung berbagai mata uang 40 | 41 | --- 42 | 43 | Fitur utama dari layanan bundling adalah bahwa karena mereka membayar untuk transaksi dasar Arweave yang akan dikirimkan (menggunakan token AR), mereka dapat memilih untuk mengaktifkan pembayaran biaya penyimpanan dengan berbagai jenis token yang berbeda. Ini adalah titik masuk utama bagi rantai lain untuk mengaktifkan penyimpanan permanen Arweave untuk pengguna mereka. 44 | -------------------------------------------------------------------------------- /docs/src/id/concepts/permaweb.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Selamat datang di Permaweb 6 | 7 | Permaweb mirip dengan web, tetapi bersifat permanen. Para pengembang membangun di atas layanan Permaweb untuk menciptakan aplikasi dan situs yang akan ada selamanya di Arweave. 8 | 9 | ![Permaweb](https://arweave.net/lK3mptAgC2cijnPvogKaLCOsKSuPlvLu_6opnEOrpT0) 10 | 11 | Manfaat Permaweb. 12 | 13 | 1. Situs dan aplikasi bersifat permanen, Anda tidak perlu khawatir tentang mereka menghilang (bahkan jika tim yang mendukungnya berpindah). 14 | 2. Pengembang aplikasi harus memastikan setiap versi baru dari aplikasi benar-benar menambahkan nilai, jika tidak, mengapa Anda akan beralih dari yang lama. 15 | 3. Karena semua aplikasi Permaweb berbagi lapisan penyimpanan yang sama, Arweave, mereka dapat semua berkomposisi dengan data satu sama lain. 16 | 4. Data Anda dimiliki oleh dompet Anda dan dapat mengikuti Anda dari satu aplikasi ke aplikasi lainnya. 17 | 18 | ## Bandingkan Web Tradisional vs Permaweb 19 | 20 | ![Permaweb vs Tradisional](https://arweave.net/5EP6mhpHsfnTsmFk7aVyK8jF6zqavxJT4kgx70mUc5I) 21 | 22 | Untuk informasi lebih lanjut tentang Permaweb, kunjungi [postingan di medium](https://arweave.medium.com/welcome-to-the-permaweb-ce0e6c73ddfb). -------------------------------------------------------------------------------- /docs/src/id/getting-started/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | --- 6 | 7 | # Cooking dengan Permaweb 8 | 9 | Permaweb Cookbook adalah sumber daya pengembang yang menyediakan konsep-konsep penting dan referensi untuk membangun aplikasi di Permaweb. Setiap konsep dan referensi akan berfokus pada aspek-aspek tertentu dari ekosistem pengembangan Permaweb sambil memberikan detail tambahan dan contoh penggunaan. 10 | 11 | ## Pengembang 12 | 13 | Selamat datang di komunitas pengembangan Arweave, di mana masa lalu selamanya terukir dalam blockchain dan masa depan penuh dengan kemungkinan tak terbatas. Mari bangun web terdesentralisasi bersama-sama! 14 | 15 | [Baca Selengkapnya](welcome.md) 16 | 17 | ## Berkontribusi 18 | 19 | Cookbook dirancang sedemikian rupa sehingga memudahkan pengembang Permaweb baru untuk berkontribusi. Bahkan jika Anda tidak tahu cara melakukan sesuatu, berkontribusi pada cookbook adalah cara yang bagus untuk belajar! 20 | 21 | Lihat semua isu terbuka di sini. Pedoman kontribusi di sini. Jika Anda merasa cookbook kekurangan konsep, panduan, atau referensi, silakan tambahkan isu. 22 | 23 | [Baca Selengkapnya](contributing.md) 24 | 25 | ## Cara Membaca Cookbook 26 | 27 | Permaweb Cookbook dibagi menjadi beberapa bagian berbeda, masing-masing ditujukan untuk tujuan yang berbeda. 28 | 29 | | Bagian | Deskripsi | 30 | | ------- | ----------- | 31 | | Konsep Inti | Bangunan dasar Permaweb yang penting untuk diketahui dalam pengembangan | 32 | | Panduan | Panduan berukuran snack tentang berbagai alat untuk pengembangan | 33 | | Referensi | Referensi untuk potongan kode yang sering dibutuhkan | 34 | | Starter Kit | Starter Kit Kerangka kerja front-end untuk memulai membangun di Permaweb dalam waktu singkat | 35 | 36 | ## Memulai Cepat 37 | 38 | Ini adalah panduan kecil untuk membantu pengembang dari berbagai tingkatan pengalaman untuk menyusun kode di Permaweb. 39 | 40 | - [Hello World (NodeJS)](quick-starts/hw-nodejs.md) -------------------------------------------------------------------------------- /docs/src/id/getting-started/quick-starts/hw-cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Hello World (CLI) 6 | 7 | Panduan ini akan membantu Anda untuk melakukan hal yang paling sederhana, yaitu mengunggah data ke permaweb menggunakan antarmuka baris perintah (CLI). 8 | 9 | ## Persyaratan 10 | 11 | - [NodeJS](https://nodejs.org) LTS atau yang lebih baru 12 | 13 | ## Deskripsi 14 | 15 | Dengan menggunakan jendela terminal atau konsol, buat folder baru bernama `hw-permaweb-1`. 16 | 17 | ## Persiapan 18 | 19 | ```sh 20 | cd hw-permaweb-1 21 | npm init -y 22 | npm install arweave @irys/sdk 23 | ``` 24 | 25 | ## Membuat sebuah dompet (wallet) 26 | 27 | ```sh 28 | node -e "require('arweave').init({}).wallets.generate().then(JSON.stringify).then(console.log.bind(console))" > wallet.json 29 | ``` 30 | 31 | ## Membuat halaman web 32 | 33 | ```sh 34 | echo "

Halo Permaweb

" > index.html 35 | ``` 36 | 37 | ## Mengunggah menggunakan Irys 38 | 39 | ```sh 40 | irys upload index.html -c arweave -h https://node2.irys.xyz -w ./wallet.json 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/src/id/getting-started/quick-starts/hw-no-code.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Hello World (No Code) 6 | 7 | Dalam panduan cepat ini, kita akan mengunggah gambar ke permaweb tanpa perlu menulis kode apa pun! 8 | 9 | ## Persyaratan 10 | 11 | * Komputer 12 | * Koneksi internet 13 | * Browser web modern 14 | 15 | ## Buat dompet (wallet) 16 | 17 | Buka [https://arweave.app/add](https://arweave.app/add) atau [https://arconnect.io](https://arconnect.io) 18 | 19 | ## Kirim data ke arweave 20 | 21 | Buka [https://hello_cookbook.arweave.dev](https://hello_cookbook.arweave.dev) 22 | 23 | Masukkan beberapa data dan klik "publish," sambungkan dompet Anda, dan "BAM" 24 | 25 | ## Selamat!! 26 | 27 | Anda baru saja mempublikasikan beberapa data di Arweave tanpa perlu menulis kode apa pun. 28 | 29 | > Untuk melihat proyeknya -> [https://github.com/twilson63/pw-no-code-hello](https://github.com/twilson63/pw-no-code-hello) 30 | -------------------------------------------------------------------------------- /docs/src/id/getting-started/welcome.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Pengembangan di Permaweb 6 | 7 | ## Selamat datang di Permaweb 8 | 9 | Membuat aplikasi di permaweb, yang dibangun di atas protokol Arweave, mirip dengan membangun aplikasi web tradisional tetapi dengan beberapa perbedaan kunci. 10 | 11 | Salah satu perbedaan utama adalah bahwa data disimpan di permaweb secara permanen, sesuai dengan namanya, daripada di server terpusat. Ini berarti bahwa setelah data diunggah ke permaweb, tidak dapat dihapus atau diubah. Hal ini dapat bermanfaat untuk aplikasi yang memerlukan penyimpanan data yang tahan terhadap manipulasi, seperti manajemen rantai pasokan atau sistem pemungutan suara. 12 | 13 | Perbedaan lainnya adalah bahwa permaweb bersifat terdesentralisasi, artinya tidak ada titik kontrol atau kegagalan pusat. Hal ini dapat memberikan keamanan dan kehandalan yang lebih tinggi untuk aplikasi. 14 | 15 | Selain itu, permaweb menggunakan token unik, yang disebut AR, untuk membayar penyimpanan data di jaringan. Hal ini dapat menambah lapisan kompleksitas baru dalam pengembangan aplikasi, karena pengembang perlu mempertimbangkan bagaimana mengintegrasikan AR ke dalam aplikasi mereka dan mengelola pembayaran. 16 | 17 | Secara keseluruhan, pengalaman membuat aplikasi di permaweb bisa menantang, tetapi juga bisa memberikan keuntungan unik dibandingkan dengan pengembangan web tradisional. 18 | 19 | ## Hello Worlds 20 | 21 | * [Hello World (Tanpa Kode)](./quick-starts/hw-no-code.md) 22 | * [Hello World (CLI)](./quick-starts/hw-cli.md) -------------------------------------------------------------------------------- /docs/src/id/guides/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Panduan 6 | 7 | Panduan berukuran snack untuk elemen-elemen dasar Permaweb: 8 | 9 | - [ArProfile](arprofile.md) 10 | - [Integrasi DNS](dns-integration/server-side.md) 11 | - [Sisi Server](dns-integration/server-side.md) 12 | - [Spheron](dns-integration/spheron.md) 13 | - [Mengunggah Aplikasi](deployment/irys-cli.md) 14 | - [arkb](deployment/arkb.md) 15 | - [irys-cli](deployment/irys-cli.md) 16 | - [tindakan-github](deployment/github-action.md) 17 | - [Mengunggah PathManifests](deploying-manifests/deployingManifests.md) 18 | - [arweave.app](deploying-manifests/arweave-app.md) 19 | - [ardrive](deploying-manifests/ardrive.md) 20 | - [irys.xyz](deploying-manifests/irys.md) 21 | - [Mengunggah PSTs](deploying-psts.md) 22 | - [GraphQL](querying-arweave/queryingArweave.md) 23 | - [ArDB](querying-arweave/ardb.md) 24 | - [ar-gql](querying-arweave/ar-gql.md) 25 | - [Layanan Pencarian](querying-arweave/search-indexing-service.md) 26 | - SmartWeave 27 | - [Token Atomik](atomic-tokens/intro.md) 28 | - [Vouch](vouch.md) 29 | - Kontrak Warp 30 | - [Pengantar](smartweave/warp/intro.md) 31 | - [Mengunggah Kontrak](smartweave/warp/deploying-contracts.md) 32 | - [Baca Status Kontrak](smartweave/warp/readstate.md) 33 | - [Interaksi Kontrak Tulis](smartweave/warp//write-interactions.md) 34 | - [Evolusi Kontrak](smartweave/warp//evolve.md) 35 | - [Pengujian](testing/arlocal.md) 36 | 37 | > Apakah Anda berpikir ada panduan Permaweb yang hilang? Buat isu di [Github](https://github.com/twilson63/permaweb-cookbook/issues) atau pertimbangkan [berkontribusi](../getting-started/contributing.md) 38 | -------------------------------------------------------------------------------- /docs/src/id/guides/deploying-manifests/ardrive.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | ### ArDrive 6 | 7 | --- 8 | 9 | Anda dapat membuat sebuah manifest untuk sebuah folder atau sekelompok folder dengan menggunakan `ardrive create-manifest` menggunakan [ArDrive CLI](https://github.com/ardriveapp/ardrive-cli). 10 | 11 | Baca lebih lanjut: [Dokumentasi ArDrive CLI](https://github.com/ardriveapp/ardrive-cli) 12 | 13 | --- 14 | 15 | Sebagai alternatif, Anda dapat membuat sebuah manifest menggunakan aplikasi web [ArDrive](https://ardrive.io) dengan memilih New → Create manifest saat berada dalam sebuah drive. 16 | 17 | ![Manifest Aplikasi Web ArDrive](~@source/images/ardrive-manifests.png) -------------------------------------------------------------------------------- /docs/src/id/guides/deploying-manifests/arweave-app.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | ### Arweave.app 6 | 7 | --- 8 | 9 | Mengunggah sebuah direktori melalui [Arweave.app](http://Arweave.app) akan secara otomatis membuat manifest untuk semua file dalam direktori tersebut. 10 | 11 | ![Pengunggahan Manifest ArweaveApp](~@source/images/arweaveapp-manifest.png) 12 | 13 | Atau, Anda dapat mengunggah file manifest sendiri secara manual, tambahkan tag berikut, dan kirimkan transaksi. 14 | 15 | ![Tag Manifest ArweaveApp](~@source/images/arweaveapp-tags.png) -------------------------------------------------------------------------------- /docs/src/id/guides/deploying-manifests/deployingManifests.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Creating and Deploying Manifests 6 | 7 | --- 8 | 9 | Panduan ini menjelaskan cara membuat dan mendeploy manifest path secara manual. 10 | 11 | Halaman inti konsep manifest path memiliki informasi lebih lanjut tentang apa itu manifest dan mengapa mereka bisa berguna untuk proyek Anda. 12 | 13 | Jika Anda mengikuti panduan ini untuk mendeploy manifest path, itu harus mengikuti struktur manifest yang dijelaskan di halaman [konsep inti](https://cookbook.arweave.dev/concepts/manifests.html). -------------------------------------------------------------------------------- /docs/src/id/guides/deploying-manifests/irys.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | ### Irys CLI 6 | 7 | --- 8 | 9 | `irys upload-dir ` mengunggah direktori lokal ke Arweave dan secara otomatis menghasilkan manifest untuk file-file tersebut. 10 | 11 | Jika Anda ingin mengunggah file manifest sendiri secara manual, menggunakan flag `--content-type "application/x.arweave-manifest+json"` pada transaksi apa pun akan menunjukkannya sebagai transaksi manifest. 12 | 13 | ### Klien Irys JS 14 | 15 | --- 16 | 17 | Menggunakan potongan kode berikut mengunggah direktori lokal ke Arweave dan secara otomatis menghasilkan manifest untuk file-file tersebut: 18 | 19 | ```js 20 | await irys.uploadFolder("./path/to/folder", { 21 | indexFile: "./optionalIndex.html", // file indeks opsional (file yang akan dimuat oleh pengguna saat mengakses manifest) 22 | batchSize: 50, // jumlah item yang akan diunggah sekaligus 23 | keepDeleted: false, // apakah akan menyimpan item yang sudah dihapus dari unggahan sebelumnya 24 | }); // mengembalikan ID manifest 25 | ``` 26 | 27 | Jika Anda ingin mengunggah file manifest sendiri secara manual, `await irys.upload(data, { tags: [{ name: "Content-type", value: "application/x.arweave-manifest+json" }] } )` akan menunjukkannya sebagai transaksi manifest. 28 | 29 | --- 30 | 31 | Sumber dan Bacaan Lebih Lanjut: [Dokumentasi Irys](http://docs.irys.xyz/developer-docs/irys-sdk) 32 | -------------------------------------------------------------------------------- /docs/src/id/guides/deployment/irys-cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Irys CLI (Previously Bundlr) 6 | 7 | ## Prasyarat 8 | 9 | Diperlukan dompet Arweave untuk melakukan penyebaran. Jika ukuran direktori lebih dari 100kb, diperlukan instance Irys yang telah didanai. 10 | 11 | ## Instalasi 12 | 13 | Untuk menginstal Irys CLI, jalankan perintah berikut: 14 | 15 | 16 | 17 | ```console:no-line-numbers 18 | npm install -g @irys/sdk 19 | ``` 20 | 21 | 22 | 23 | 24 | ```console:no-line-numbers 25 | yarn global add @irys/sdk 26 | ``` 27 | 28 | 29 | 30 | 31 | ## Pembangunan Statis 32 | 33 | Aplikasi Permaweb dibangun secara statis, artinya kode dan kontennya dibangun sebelumnya dan disimpan di jaringan. 34 | 35 | Di bawah ini adalah contoh situs statis. Untuk mendistribusikannya ke Permaweb, direktori `build` akan digunakan sebagai argumen untuk flag `upload-dir`. 36 | 37 | ```js 38 | |- build 39 | |- index.html 40 | |- styles.css 41 | |- index.js 42 | ``` 43 | 44 | ## Penyebaran 45 | 46 | ```console 47 | irys upload-dir [path to folder] -w [path to wallet] --index-file [index.html] -c [mata uang] -h [node Irys] 48 | ``` 49 | 50 |
51 | 52 | 53 | ## Perintah Lain 54 | 55 | #### Dana Irys 56 | 57 | ```console 58 | irys fund [jumlah] -h [node Irys] -w [path to wallet] -c [mata uang] 59 | ``` 60 | 61 | \* Mendanai instance Irys dapat memakan waktu hingga 30 menit untuk diproses 62 | 63 | #### Periksa Saldo Irys 64 | 65 | ```console 66 | irys balance [alamat dompet] -h [node Irys] -c arweave 67 | ``` 68 | -------------------------------------------------------------------------------- /docs/src/id/guides/exm/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Execution Machine API Token 6 | 7 | EXM berusaha menjadi agnostik kripto dan hanya memerlukan satu token API (juga dikenal sebagai kunci) untuk berinteraksi. Token API ini diperlukan untuk sebagian besar tindakan di EXM seperti penyebaran dan operasi tulis. 8 | 9 | ## Membuat Token API 10 | 11 | Untuk membuat token API, langkah-langkah berikut harus dilakukan: 12 | 13 | - Buka [halaman utama](https://exm.dev/). 14 | - Pilih metode yang diinginkan untuk Daftar Masuk/Log Masuk. 15 | 16 | ![Pilihan Masuk EXM](~@source/images/exm-sign-in-options.png) 17 | 18 | - Setelah diarahkan ke dasbor, klik "Token Baru". 19 | 20 | ![Buat Token API Baru](~@source/images/exm-create-token.png) 21 | 22 | - Salin token yang telah dibuat dan gunakan dengan SDK atau CLI. 23 | 24 | ## Menangani Token API dengan Aman 25 | 26 | Token tersebut adalah pengidentifikasi akun kita dan memungkinkan kita mengakses fungsi yang terkait dengannya. Oleh karena itu, sangat penting untuk memastikan token ini tetap rahasia untuk mencegah spam dan serangan terhadap fungsi-fungsi kita. Cara terbaik untuk melakukannya adalah dengan menggunakan variabel lingkungan. 27 | 28 | Ada dua cara untuk menyimpan variabel lingkungan: 29 | 30 | 1. Melalui baris perintah: 31 | 32 | Di direktori proyek, jalankan perintah berikut: 33 | 34 | ```bash 35 | export EXM_PK= 36 | ``` 37 | 38 | 2. Melalui sdk `dotenv`: 39 | 40 | - Jalankan perintah berikut di baris perintah: 41 | 42 | ```bash 43 | npm install dotenv 44 | 45 | #ATAU 46 | 47 | yarn add dotenv 48 | ``` 49 | - Impor pustaka ini dalam file menggunakan variabel: 50 | 51 | ```jsx 52 | import dotenv from "dotenv"; 53 | dotenv.config(); 54 | ``` 55 | 56 | Maka kunci ini dapat dirujuk dalam file sebagai `process.env.EXM_PK` tanpa mengeksposnya atau mendorongnya ke sistem kontrol versi seperti GitHub. -------------------------------------------------------------------------------- /docs/src/id/guides/exm/js-sdk/sdk-intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # SDK Execution Machine 6 | 7 | SDK JavaScript memungkinkan penggunaan Execution Machine (EXM) dalam aplikasi JavaScript dan TypeScript. Untuk menggunakan SDK, langkah-langkah pengaturan berikut diperlukan. 8 | 9 | ## Instalasi 10 | 11 | Untuk menginstal EXM dalam proyek Anda, Anda dapat menggunakan `npm` atau `yarn`. 12 | 13 | 14 | 15 | 16 | ```bash 17 | npm install @execution-machine/sdk 18 | ``` 19 | 20 | 21 | 22 | 23 | ```bash 24 | yarn add @execution-machine/sdk 25 | ``` 26 | 27 | 28 | 29 | 30 | ## Impor 31 | 32 | Saat menggunakan EXM dengan proyek Anda, paket harus diimpor sebagai berikut. 33 | 34 | 35 | 36 | 37 | ```js 38 | import { Exm } from '@execution-machine/sdk'; 39 | ``` 40 | 41 | 42 | 43 | ## Membuat Instance 44 | 45 | Untuk berinteraksi dengan EXM setelah instalasi dan impor, sebuah instance harus dibuat. 46 | 47 | 48 | 49 | 50 | ```js 51 | const exmInstance = new Exm({ token: 'MY_EXM_TOKEN' }); 52 | ``` 53 | 54 | 55 | 56 | ## Ringkasan 57 | 58 | Panduan-panduan berikut akan menunjukkan cara mendeploy fungsi tanpa server menggunakan EXM JS SDK, dan bagaimana berinteraksi dengan mereka. -------------------------------------------------------------------------------- /docs/src/id/guides/exm/js-sdk/sdk-read.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Membaca dari Fungsi Tanpa Server dengan SDK Execution Machine 6 | 7 | Ada dua cara untuk membaca status dari fungsi tanpa server EXM. Seperti yang dijelaskan dalam [pengantar](../intro.md#serverless-functions-on-arweave), EXM menyimpan salinan fungsi pada lapisan cache untuk melayani aplikasi dengan cepat tetapi juga mengunggah fungsi ke Arweave untuk menjaga desentralisasi dan manfaat yang terkait dengannya. Akibatnya, status fungsi dapat dibaca baik dari lapisan cache EXM maupun langsung dari Arweave. 8 | 9 | 1. Membaca dari lapisan cache EXM: 10 | 11 | Panggilan baca membaca status terbaru seperti yang disimpan pada lapisan cache EXM. Lapisan ini dirancang khusus untuk melayani aplikasi dengan cepat. Ini mengambil pendekatan optimis dan memperbarui status fungsi segera setelah menerima permintaan transaksi. 12 | 13 | 14 | 15 | 16 | ```js 17 | import { Exm } from '@execution-machine/sdk'; 18 | import { functionId } from './functionId.js'; 19 | 20 | // init new EXM instance 21 | const exm = new Exm({ token: process.env.EXM_API_TOKEN }); 22 | 23 | // read from cached layer 24 | const readResult = await exm.functions.read(functionId); 25 | console.log(readResult); 26 | ``` 27 | 28 | 29 | 30 | 31 | 2. Membaca langsung dari Arweave (Evaluasi): 32 | 33 | Panggilan evaluasi mengembalikan status terbaru yang berhasil diproses di Arweave. Status terbaru ini dihitung dengan [evaluasi malas](../intro.md#how-does-it-work-in-the-background), yang mengevaluasi status awal dan interaksi dengan fungsi dalam urutan kejadian untuk sampai pada status terbaru. 34 | 35 | 36 | 37 | 38 | ```js 39 | import { Exm } from '@execution-machine/sdk'; 40 | import { functionId } from './functionId.js'; 41 | 42 | // init new EXM instance 43 | const exm = new Exm({ token: process.env.EXM_API_TOKEN }); 44 | 45 | // evaluate from arweave 46 | const evalResult = await exm.functions.evaluate(functionId); 47 | console.log(evalResult); 48 | ``` 49 | 50 | 51 | 52 | 53 | ::: tip 54 | Membaca dari Arweave direkomendasikan hanya untuk tujuan verifikasi. Status fungsi yang dikembalikan dari panggilan evaluasi dapat diperiksa dengan informasi yang dikembalikan oleh lapisan cache untuk memastikan keasliannya. Mungkin ada sedikit keterlambatan dalam pengiriman permintaan transaksi dan pembaruan di jaringan. 55 | ::: -------------------------------------------------------------------------------- /docs/src/id/guides/posting-transactions/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | Silakan lihat contoh yang terlampir pada Konsep Inti Posting Transaksi. 6 | 7 | - Contoh [arweave-js](/guides/posting-transactions/arweave-js.md) 8 | - Contoh [irys.xyz](/guides/posting-transactions/irys.md) 9 | - Contoh [dispatch](/guides/posting-transactions/dispatch.md) 10 | -------------------------------------------------------------------------------- /docs/src/id/guides/posting-transactions/dispatch.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Mengirimkan Transaksi dengan Menggunakan Dispatch 6 | Dompet Arweave di peramban memiliki konsep pengiriman transaksi. Jika ukuran transaksi kurang dari 100KB, maka transaksi tersebut dapat diposting secara gratis! 7 | ## Mengirimkan Transaksi 8 | Ini dapat dilakukan tanpa ketergantungan paket apa pun untuk aplikasi klien. Selama pengguna memiliki dompet peramban yang aktif dan data kurang dari 100KB, transaksi yang dikirimkan gratis dan dijamin akan dikonfirmasi di jaringan. 9 | 10 | ```js:no-line-numbers 11 | // menggunakan arweave-js untuk membuat transaksi 12 | let tx = await arweave.createTransaction({ data:"Hello World!" }) 13 | 14 | // menambahkan beberapa tag kustom ke transaksi 15 | tx.addTag('App-Name', 'PublicSquare') 16 | tx.addTag('Content-Type', 'text/plain') 17 | tx.addTag('Version', '1.0.1') 18 | tx.addTag('Type', 'post') 19 | 20 | // menggunakan dompet peramban untuk mendispatch() transaksi 21 | let result = await window.arweaveWallet.dispatch(tx); 22 | 23 | // mencetak ID transaksi 24 | console.log(result.id); 25 | ``` 26 | 27 | ## Sumber Daya 28 | * Untuk gambaran semua cara Anda dapat memposting transaksi, lihat bagian [Posting Transactions](../../concepts/post-transactions.md) dari cookbook. -------------------------------------------------------------------------------- /docs/src/id/guides/posting-transactions/irys.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Mengirimkan Transaksi menggunakan irys.xyz 6 | 7 | Mengirimkan transaksi ke irys.xyz dapat dilakukan dengan menggunakan paket javascript `irys.xyz/sdk`. Layanan bundling memungkinkan konfirmasi transaksi yang diposting dan mendukung banyak ribu transaksi per blok melalui penggunaan bundel transaksi. 8 | 9 | ## Menginstal irys.xyz/sdk 10 | 11 | Untuk menginstal `irys/sdk`, jalankan 12 | 13 | 14 | 15 | 16 | ```console:no-line-numbers 17 | npm install @irys/sdk 18 | ``` 19 | 20 | 21 | 22 | 23 | ```console:no-line-numbers 24 | yarn add @irys/sdk 25 | ``` 26 | 27 | 28 | 29 | 30 | ## Menginisialisasi Irys Network Client 31 | 32 | Perbedaan antara pengiriman transaksi Layer 1 dan transaksi Layer 2 yang dibundel adalah bahwa saat menggunakan Irys Anda harus melakukan deposit di node Irys sebelumnya. Deposit ini dapat dilakukan menggunakan token AR atau berbagai mata uang kripto lainnya. Perbedaan lainnya adalah bahwa layanan Irys menjamin data Anda akan tiba di rantai. 33 | 34 | ```js:no-line-numbers 35 | import Irys from '@irys/sdk'; 36 | import fs from "fs"; 37 | 38 | // muat berkas kunci dompet JWK dari disk 39 | let key = JSON.parse(fs.readFileSync("walletFile.txt").toString()); 40 | 41 | // inisialisasi SDK Irys 42 | const irys = new Irys({ "http://node1.irys.xyz", "arweave", key }); 43 | ``` 44 | 45 | ## Mengirimkan Transaksi yang Dibundel 46 | 47 | ```js:no-line-numbers 48 | // muat data dari disk 49 | const imageData = fs.readFileSync(`images/myImage.png`); 50 | 51 | // tambahkan tag kustom yang memberi tahu gateway cara menyajikan data ini ke peramban 52 | const tags = [ 53 | {name: "Content-Type", value: "image/png"}, 54 | ]; 55 | 56 | // buat transaksi yang dibundel dan tandatangani 57 | const tx = irys.createTransaction(imageData, { tags }); 58 | await tx.sign(); 59 | 60 | // unggah transaksi ke Irys untuk dimasukkan dalam bundel yang akan diposting 61 | await tx.upload(); 62 | ``` 63 | 64 | ## Sumber Daya 65 | 66 | - Untuk gambaran semua cara Anda dapat memposting transaksi, lihat bagian [Posting Transactions](../../concepts/post-transactions.md) dari buku masak. 67 | 68 | - Dokumentasi lengkap Irys client dapat ditemukan di [situs web irys.xyz](https://docs.irys.xyz) 69 | 70 | - Tutorial dan lokakarya untuk [mengunggah koleksi NFT](http://docs.irys.xyz/hands-on/tutorials/uploading-nfts) menggunakan Irys. 71 | -------------------------------------------------------------------------------- /docs/src/id/guides/querying-arweave/ar-gql.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # ar-gql 6 | Paket ini adalah lapisan minimal di atas GraphQL, mendukung kueri berparameter dengan variabel kueri. Ini juga mengimplementasikan pengelolaan hasil berhalaman. 7 | 8 | ## Instalasi 9 | 10 | Untuk menginstal `ar-gql`, jalankan 11 | 12 | 13 | 14 | ```console:no-line-numbers 15 | npm i ar-gql 16 | ``` 17 | 18 | 19 | 20 | ```console:no-line-numbers 21 | yarn add ar-gql 22 | ``` 23 | 24 | 25 | 26 | ## Contoh 27 | ```js:no-line-numbers 28 | import { arGql } from "ar-gql" 29 | 30 | const argql = arGql() 31 | 32 | (async () => { 33 | let results = await argql.run(`query( $count: Int ){ 34 | transactions( 35 | first: $count, 36 | tags: [ 37 | { 38 | name: "App-Name", 39 | values: ["PublicSquare"] 40 | }, 41 | { 42 | name: "Content-Type", 43 | values: ["text/plain"] 44 | }, 45 | ] 46 | ) { 47 | edges { 48 | node { 49 | id 50 | owner { 51 | address 52 | } 53 | data { 54 | size 55 | } 56 | block { 57 | height 58 | timestamp 59 | } 60 | tags { 61 | name, 62 | value 63 | } 64 | } 65 | } 66 | } 67 | }`, {count: 1}); 68 | console.log(results); 69 | })(); 70 | ``` 71 | 72 | ## Sumber Daya 73 | * [Halaman github ar-gql](https://github.com/johnletey/arGql) -------------------------------------------------------------------------------- /docs/src/id/guides/querying-arweave/ardb.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # ArDB 6 | Sebuah perpustakaan yang dibangun di atas GraphQL yang memungkinkan Anda untuk mengambil data transaksi dan blok dari Arweave tanpa harus menghafal nama parameter GraphQL. Cukup bangun kueri dengan menggunakan fitur otomatisasi lengkap di editor kode favorit Anda. 7 | 8 | ## Instalasi 9 | ```console:no-line-numbers 10 | yarn add ardb 11 | ``` 12 | 13 | ## Contoh 14 | ```js:no-line-numbers 15 | import Arweave from 'arweave'; 16 | import ArDB from 'ardb'; 17 | 18 | // inisialisasi instans arweave 19 | const arweave = Arweave.init({}); 20 | 21 | // arweave adalah instans Klien Arweave 22 | const ardb = new ArDB(arweave); 23 | 24 | // Dapatkan satu transaksi berdasarkan ID-nya 25 | const tx = await ardb.search('transaction') 26 | .id('A235HBk5p4nEWfjBEGsAo56kYsmq7mCCyc5UZq5sgjY') 27 | .findOne(); 28 | 29 | // Dapatkan array transaksi dan sertakan hanya hasil pertama 30 | const txs = await ardb.search('transactions') 31 | .appName('SmartWeaveAction') 32 | .findOne(); 33 | 34 | // Ini sama dengan melakukan hal berikut: 35 | const txs = await ardb.search('transactions') 36 | .tag('App-Name', 'SmartWeaveAction') 37 | .limit(1) 38 | .find(); 39 | 40 | // Cari beberapa transaksi dari pemilik/alamat dompet tertentu 41 | const txs = await ardb.search('transactions') 42 | .from('BPr7vrFduuQqqVMu_tftxsScTKUq9ke0rx4q5C9ieQU') 43 | .find(); 44 | 45 | // Lanjutkan penelusuran hasil dengan... 46 | const newTxs = await ardb.next(); 47 | 48 | // Atau Anda bisa mendapatkan semua hasil sekaligus dengan melakukan: 49 | const txs = await ardb.search('blocks') 50 | .id('BkJ_h-GGIwfek-cJd-RaJrOXezAc0PmklItzzCLIF_aSk36FEjpOBuBDS27D2K_T') 51 | .findAll(); 52 | 53 | ``` 54 | 55 | ## Sumber Daya 56 | * [Paket NPM ArDB](https://www.npmjs.com/package/ardb) -------------------------------------------------------------------------------- /docs/src/id/guides/smartweave/warp/readstate.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # SDK Warp (SmartWeave) - ReadState 6 | 7 | Status kontrak SmartWeave dihitung melalui evaluasi malas, yang berarti evaluasi status terjadi saat membaca, bukan saat menulis. Saat membaca kontrak, SDK mengumpulkan semua interaksi status, mengurutkannya, dan menjalankannya terhadap kontrak sumber menggunakan pola reduce atau fold. 8 | 9 | ## Readstate Dasar 10 | 11 | ```ts 12 | const warp = WarpFactory.forMainnet() 13 | const CONTRACT_ID = '_z0ch80z_daDUFqC9jHjfOL8nekJcok4ZRkE_UesYsk' 14 | 15 | const result = await warp.contract(CONTRACT_ID).readState() 16 | 17 | // log current state 18 | console.log(result.cachedValue.state) 19 | ``` 20 | 21 | ## Readstate Lanjutan 22 | 23 | Beberapa kontrak membaca status kontrak lain atau memanggil atau menulis ke kontrak lain. Saat meminta status kontrak ini, perlu ada pengaturan evaluasi. 24 | 25 | ```ts 26 | const warp = WarpFactory.forMainnet() 27 | const CONTRACT_ID = 'FMRHYgSijiUNBrFy-XqyNNXenHsCV0ThR4lGAPO4chA' 28 | 29 | const result = await warp.contract(CONTRACT_ID) 30 | .setEvaluationOptions({ 31 | internalWrites: true, 32 | allowBigInt: true 33 | }) 34 | .readState() 35 | 36 | // log current state 37 | console.log(result.cachedValue.state) 38 | ``` 39 | 40 | ### Opsi Evaluasi Umum 41 | 42 | | Nama | Deskripsi | 43 | | ---- | ----------- | 44 | | internalWrites | Mengevaluasi kontrak yang berisi tulisan internal ke kontrak lain | 45 | | allowBigInt | Mengevaluasi kontrak yang menggunakan BigInt yang dapat Anda pelajari lebih lanjut tentang bigInt [Dokumentasi MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | 46 | | unsafeClient | Nilai ini bisa `allow`, `skip`, atau `throw`. Anda sebaiknya menghindari penggunaan unsafeClient dalam kontrak Anda karena dapat menghasilkan hasil yang tidak dapat diprediksi. | 47 | 48 | ## Readstate dari BlockHeight atau Sortkey Tertentu 49 | 50 | Anda mungkin ingin melihat status sebelumnya, bukan status saat ini, dengan menyediakan blockHeight Anda dapat membaca status kontrak pada block height tertentu. 51 | 52 | ```ts 53 | const { sortKey, cachedValue } = await contract.readState(1090111) 54 | ``` 55 | 56 | ## Ringkasan 57 | 58 | Membaca status saat ini dari Kontrak SmartWeave melakukan evaluasi status dengan menarik semua interaksi dan memproses setiap interaksi melalui metode fold. Pendekatan ini unik untuk permaweb dan memerlukan pemahaman unik tentang bagaimana kode Kontrak SmartWeave Anda dieksekusi. -------------------------------------------------------------------------------- /docs/src/id/guides/using-vue.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Menggunakan Vue di Markdown 6 | 7 | ## Pembatasan Akses API Browser 8 | 9 | Karena aplikasi VuePress dirrender oleh server dalam Node.js saat menghasilkan build statis, penggunaan Vue harus sesuai dengan [persyaratan kode universal](https://ssr.vuejs.org/en/universal.html). Singkatnya, pastikan hanya mengakses API Browser / DOM dalam hook `beforeMount` atau `mounted`. 10 | 11 | Jika Anda menggunakan atau mendemo komponen yang tidak ramah terhadap SSR (misalnya mengandung direktif kustom), Anda dapat melingkupi mereka dalam komponen bawaan ``: 12 | 13 | ## 14 | -------------------------------------------------------------------------------- /docs/src/id/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | onboarding: true 4 | --- 5 | 6 | # Cooking dengan Permaweb 7 | 8 | Cookbook Permaweb adalah sumber daya pengembang yang menyediakan konsep-konsep penting dan referensi untuk membangun aplikasi di Permaweb. Setiap konsep dan referensi akan berfokus pada aspek-aspek tertentu dari ekosistem pengembangan Permaweb sambil memberikan rincian tambahan dan contoh penggunaan. 9 | 10 | ## Pengembang 11 | 12 | Selamat datang di komunitas pengembangan Arweave, di mana masa lalu selamanya terukir di blockchain dan masa depan penuh dengan kemungkinan tak terbatas. Mari kita bangun web terdesentralisasi bersama! 13 | 14 | [Baca Lebih Lanjut](getting-started/welcome.md) 15 | 16 | ## Berkontribusi 17 | 18 | Cookbook ini dirancang dengan cara yang memudahkan pengembang Permaweb yang baru untuk berkontribusi. Bahkan jika Anda tidak tahu cara melakukan sesuatu, berkontribusi pada cookbook adalah cara yang bagus untuk belajar! 19 | 20 | Periksa semua isu terbuka di sini. Pedoman kontribusi di sini. Jika Anda menemukan bahwa cookbook ini kekurangan konsep, panduan, atau referensi, silakan tambahkan isu. 21 | 22 | [Baca Lebih Lanjut](getting-started/contributing.md) 23 | 24 | ## Cara Membaca Cookbook 25 | 26 | Cookbook Permaweb dibagi menjadi berbagai bagian, masing-masing ditujukan untuk tujuan yang berbeda. 27 | 28 | | Bagian | Deskripsi | 29 | | ------------- | --------------------------------------------------------------------------- | 30 | | Konsep Inti | Blok bangunan Permaweb yang penting untuk diketahui dalam pengembangan | 31 | | Panduan | Panduan berukuran snack tentang berbagai alat untuk pengembangan | 32 | | Referensi | Referensi ke potongan kode yang sering dibutuhkan | 33 | | Kit Pemula | Starter Framework Front-end untuk memulai membangun di Permaweb dengan cepat | 34 | 35 | ## Mulai Cepat 36 | 37 | Ini adalah panduan kecil untuk membantu pengembang dari berbagai tingkat pengalaman dalam mengirim kode ke Permaweb. 38 | 39 | - [Hello Word (Tanpa Kode)](getting-started/quick-starts/hw-no-code.md) -------------------------------------------------------------------------------- /docs/src/id/kits/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Starter Kits 6 | 7 | Starter kits adalah repositori boilerplate untuk kerangka kerja tertentu yang telah dikonfigurasi dan siap digunakan untuk membangun di permaweb. 8 | 9 | - [Svelte](./svelte/index.md) 10 | - [React](./react/index.md) 11 | - [Vue](./vue/index.md) 12 | -------------------------------------------------------------------------------- /docs/src/id/kits/react/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # React Starter Kits 6 | 7 | React adalah sebuah library populer yang digunakan untuk membangun antarmuka pengguna. Bersama dengan alat-alat populer lainnya seperti create-react-app, sebuah proyek React dapat dikompilasi menjadi bundel. Bundel ini dapat diunggah sebagai transaksi ke permaweb di mana ia akan berfungsi sebagai aplikasi satu halaman. 8 | 9 | Panduan Memulai React: 10 | 11 | * [Vite](./vite.md) - memanfaatkan Vite untuk membangun aplikasi React di permaweb 12 | * [Create React App](./create-react-app.md) - memanfaatkan Create React App untuk membangun aplikasi React di permaweb 13 | 14 | ::: info Batasan Aplikasi Permaweb 15 | * Aplikasi sepenuhnya berbasis front-end (Tanpa Backend Server-Side) 16 | * Aplikasi disajikan dari sub-path (https://[gateway]/[TX_ID]) 17 | ::: -------------------------------------------------------------------------------- /docs/src/id/kits/svelte/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Svelte Starter Kits 6 | 7 | Svelte adalah sebuah framework yang dikompilasi menjadi bundel JavaScript dan dalam prosesnya menghapus framework tersebut dari distribusi aplikasi. Ini menghasilkan jejak yang jauh lebih kecil daripada kerangka kerja lainnya. Svelte adalah kerangka kerja yang sempurna untuk Aplikasi Permaweb. Aplikasi Permaweb dibangun berdasarkan prinsip Aplikasi Halaman Tunggal (Single Page Application), tetapi berada di jaringan Arweave dan didistribusikan oleh gateway Permaweb. 8 | 9 | Panduan Awal Svelte: 10 | 11 | * [Minimal](./minimal.md) - yang diperlukan minimum untuk membangun aplikasi svelte permaweb 12 | * [Vite](./vite.md) - Svelte, TypeScript, dan Vite 13 | 14 | ::: info Kendala Aplikasi Permaweb 15 | * Aplikasi 100% Front-end (Tanpa Backend Server) 16 | * Aplikasi disajikan dari sub-path (https://[gateway]/[TX_ID]) 17 | ::: -------------------------------------------------------------------------------- /docs/src/id/kits/vue/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Vue Starter Kits 6 | 7 | Vue.js adalah kerangka kerja JavaScript progresif yang memungkinkan pembuatan antarmuka pengguna. Berbeda dengan kerangka kerja lainnya, Vue.js mengompilasi template menjadi JavaScript saat runtime, sehingga menghasilkan ukuran berkas yang lebih kecil dan kinerja yang lebih cepat. Vue sangat ideal untuk membangun aplikasi satu halaman (single-page applications) yang performa dan skalabilitasnya baik, sehingga membuatnya menjadi pilihan yang populer di kalangan pengembang front-end. 8 | 9 | Panduan Kit Permulaan Vue: 10 | 11 | **Catatan:** - Karena `npm init vue@latest` sudah menggunakan Vite, kami tidak menyertakan panduan Vite untuk Vue. 12 | 13 | - [Buat Aplikasi Vue](./create-vue.md) - Gunakan Create Vue untuk efisien membangun aplikasi modern Permaweb berbasis Vue.js dengan TypeScript dan Vite. 14 | 15 | ::: info Kendala Aplikasi Permaweb 16 | 17 | - Aplikasi 100% front-end (Tanpa Backend Server) 18 | - Aplikasi disajikan dari sub-patokan (https://[gateway]/[TX_ID]) 19 | ::: -------------------------------------------------------------------------------- /docs/src/id/references/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: id 3 | --- 4 | 5 | # Referensi -------------------------------------------------------------------------------- /docs/src/images/ardrive-manifests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/ardrive-manifests.png -------------------------------------------------------------------------------- /docs/src/images/ardrive-pst.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/ardrive-pst.png -------------------------------------------------------------------------------- /docs/src/images/arweaveapp-manifest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/arweaveapp-manifest.png -------------------------------------------------------------------------------- /docs/src/images/arweaveapp-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/arweaveapp-tags.png -------------------------------------------------------------------------------- /docs/src/images/exm-create-token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/exm-create-token.png -------------------------------------------------------------------------------- /docs/src/images/exm-lazy-evaluation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/exm-lazy-evaluation.png -------------------------------------------------------------------------------- /docs/src/images/exm-serverless-functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/exm-serverless-functions.png -------------------------------------------------------------------------------- /docs/src/images/exm-sign-in-options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/exm-sign-in-options.png -------------------------------------------------------------------------------- /docs/src/images/exm-verifiable-computing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/exm-verifiable-computing.png -------------------------------------------------------------------------------- /docs/src/images/provenace-toolkit-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/provenace-toolkit-layout.png -------------------------------------------------------------------------------- /docs/src/images/pst-deployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/twilson63/permaweb-cookbook/7fb2276b0cc823f19830662ca7690f452a22aae4/docs/src/images/pst-deployment.png -------------------------------------------------------------------------------- /docs/src/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | onboarding: true 3 | --- 4 | 5 | # Cooking with the Permaweb 6 | 7 | The Permaweb Cookbook is a developer resource that provides the essential concepts and references for buiding applications on the Permaweb. Each concept and reference will focus on specific aspects of the Permaweb development ecosystem while providing additional details and usage examples. 8 | 9 | ## Developers 10 | 11 | Welcome to the Arweave development community, where the past is forever etched in the blockchain and the future is full of endless possibilities. Let's build the decentralized web together! 12 | 13 | [Read More](getting-started/welcome.md) 14 | 15 | ## Contributing 16 | 17 | The Cookbook is designed in a way that makes it easy for new Permaweb developers to contribute. Even if you don't know how to do something, contributing to the cookbook is a great way to learn! 18 | 19 | Check out all open issues here. Contribution guidelines here. if you find the cookbook is missing a concept, guide or reference, please add an issue. 20 | 21 | [Read More](getting-started/contributing.md) 22 | 23 | ## How to Read the Cookbook 24 | 25 | The Permaweb Cookbook is split into different sections, each aimed at a different goal. 26 | 27 | | Section | Description | 28 | | ------------- | ----------------------------------------------------------------------------------- | 29 | | Core Concepts | Building blocks of the Permaweb that are good to know for development | 30 | | Guides | Snack-sized guides about different tools for development | 31 | | References | References to commonly needed code snippets | 32 | | Starter Kits | Front-end Framework Starters to get you started building on the Permaweb in no time | 33 | 34 | ## Quick Starts 35 | 36 | These are small guides to help developers from every experience level to ship code the the permaweb. 37 | 38 | - [Hello World (No Code)](getting-started/quick-starts/hw-no-code.md) 39 | -------------------------------------------------------------------------------- /docs/src/kits/README.md: -------------------------------------------------------------------------------- 1 | # Starter Kits 2 | 3 | Starter kits are boiler plate repositories for specific frameworks configured and ready to go, to build on the permaweb. 4 | 5 | - [React](./react/index.md) 6 | - [Svelte](./svelte/index.md) 7 | - [Vue](./vue/index.md) 8 | -------------------------------------------------------------------------------- /docs/src/kits/react/index.md: -------------------------------------------------------------------------------- 1 | # React Starter Kits 2 | 3 | React is a popular library used for building user interfaces. Alongside other popular 4 | tools such as create-react-app, a React project can be compiled into a bundle. This bundle 5 | can be uploaded as a transaction to the permaweb where it will serve as a single page application. 6 | 7 | React Starter Kit Guides: 8 | 9 | * [Vite](./turbo.md) - React + Vite, publish with permaweb-deploy 10 | * [Create React App](./create-react-app.md) - utilize Create React App to build a React permaweb app 11 | 12 | 13 | 14 | ::: info Permaweb Application Constraints 15 | * 100% Front-end application (No Server-Side Backend) 16 | * Applications are served from a sub-path (https://[gateway]/[TX_ID]) 17 | ::: 18 | -------------------------------------------------------------------------------- /docs/src/kits/svelte/index.md: -------------------------------------------------------------------------------- 1 | # Svelte Starter Kits 2 | 3 | Svelte is a framework that compiles to a JavaScript bundle and in the process removes the framework from the distribution of the app. This results in a much smaller footprint than other frameworks. Svelte is the perfect framework for Permaweb Applications. A Permaweb Application is built on the principles of a Single Page Application, but lives on the Arweave network and is distributed by Permaweb gateways. 4 | 5 | Svelte Starter Kit Guides: 6 | 7 | * [Minimal](./minimal.md) - the minimum required to build a svelte permaweb app 8 | * [Vite](./vite.md) - Svelte, Typescript and Vite 9 | 10 | ::: info Permaweb Application Constraints 11 | * 100% Front-end application (No Server-Side Backend) 12 | * Applications are served from a sub-path (https://[gateway]/[TX_ID]) 13 | ::: 14 | -------------------------------------------------------------------------------- /docs/src/kits/vue/index.md: -------------------------------------------------------------------------------- 1 | # Vue Starter Kits 2 | 3 | Vue.js is a progressive JavaScript framework that allows building user interfaces. Unlike other frameworks, it compiles the template into JavaScript during runtime, resulting in a smaller file size and faster performance. Vue is ideal for building performant and scalable single-page applications, making it a popular choice among front-end developers. 4 | 5 | Vue Starter Kit Guides: 6 | 7 | **Note:** - Since `npm init vue@latest`alredy uses vite, we have not included a vite guide for Vue. 8 | 9 | - [Create Vue App](./create-vue.md) - Use Create Vue to efficiently build a Vue.js-based with TypeScript and Vite modern permaweb application 10 | 11 | ::: info Permaweb Application Constraints 12 | 13 | - 100% Front-end application (No Server-Side Backend) 14 | - Applications are served from a sub-path (https://[gateway]/[TX_ID]) 15 | ::: 16 | -------------------------------------------------------------------------------- /docs/src/legacy/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Permaweb Cookbook - Legacy 3 | --- 4 | # Legacy 5 | 6 | The following concepts and guides have been deprecated. 7 | 8 | - Concepts 9 | - [Smartweave](../concepts/smartweave.md) 10 | - Guides 11 | - [Smartweave](../guides/smartweave/atomic-assets/index.md) 12 | -------------------------------------------------------------------------------- /docs/src/references/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Permaweb Cookbook - References 3 | --- 4 | 5 | # References 6 | 7 | References for learning in depth about various topics like Bundling, GraphQL, and HTTP APIs. 8 | 9 | - [Bundling](bundling.md) 10 | - [GraphQL](gql.md) 11 | - [HTTP API](http-api) 12 | 13 | > Do you think a permaweb guide is missing? Create a issue at [Github](https://github.com/twilson63/permaweb-cookbook/issues) or consider [contributing](../getting-started/contributing.md) 14 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 核心概念 5 | 6 | Arweave和永久网络(permaweb)的基础知识。 7 | 8 | - [发布交易](post-transactions.md) 9 | - [元数据(标签)](tags.md) 10 | - [查询](queryTransactions.md) 11 | - [获取数据](/guides/http-api.md) 12 | - [交易类型](bundles.md) 13 | - [捆绑数据](bundles.md) 14 | - [路径清单](manifests.md) 15 | - [钱包和密钥](keyfiles-and-wallets.md) 16 | - [永久网络](permaweb.md) 17 | - [永久网络应用](permawebApplications.md) 18 | - [网关服务](gateways.md) 19 | - [捆绑服务](bundlers.md) 20 | - [SmartWeave](smartweave.md) 21 | - [Arweave名称系统(ArNS)](arns.md) 22 | - [原子代币](atomic-tokens.md) 23 | - [利润分享代币(PSTs)](psts.md) 24 | 25 | > 您认为永久网络的核心概念还缺少什么吗?请在[GitHub](https://github.com/twilson63/permaweb-cookbook/issues)上创建一个问题,或考虑[参与贡献](../getting-started/contributing.md)。 -------------------------------------------------------------------------------- /docs/src/zh/concepts/arns.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # ArNS - Arweave命名系统 5 | ## 概述 6 | Arweave命名系统(ArNS)是建立在Permaweb上由Smartweave所驱动的电话簿。 7 | 8 | 它是一个去中心化且抗审查的命名系统,由AR.IO Gateways驱动,用于将易读用户名连接到PermaWeb的应用程序、页面和数据。 9 | 10 | 该系统的工作原理类似于传统的DNS,用户可以在注册表中购买名称,DNS名称服务器将这些名称解析为IP地址。 11 | 12 | 通过ArNS,注册表是去中心化的、永久的,并存储在Arweave(使用Smartweave)上,每个AR.IO网关充当缓存和名称解析器。用户可以在ArNS注册表中注册一个名称,例如"my-name",并设置一个指针指向任何Arweave交易ID。AR.IO网关将将该名称解析为其自己的子域,例如https://laserilla.arweave.net ,并将所有请求代理到关联的Arweave交易ID。每个注册的名称也可以与之关联的下层名称,每个下层名称指向一个Arweave交易ID,例如https://v1_laserilla.arweave.net ,给其所有者提供更多的灵活性和控制权。 13 | 14 | ## ArNS注册表 15 | 16 | 17 | ArNS使用Smartweave协议来管理其名称记录。每个记录或名称由用户租用并与ANT代币绑定。您可以将多个ArNS名称注册到单个ANT中,但不能将多个ANT注册到单个ArNS名称——网关将无法确定路由ID的指向位置。 18 | 19 | ArNS名称最多可以包含32个字符,包括数字[0-9]、字母[a-z]和破折号[-]。破折号不能是尾随破折号,例如-myname。 20 | 21 | ## ANTs(Arweave Name Tokens) 22 | 23 | ANTs是ArNS生态系统的重要组成部分,它们是拥有ArNS名称的实际关键。当您将ArNS名称注册到ANT时,ANT就成为该名称的传输方式。ArNS注册表不在乎谁拥有ANT,它只知道ANT所属的名称。 24 | 25 | 在ANT中,您可以构建出任何所需的功能,范围包括ArNS注册表批准的源代码交易列表。这些功能可以包括NFT、PST、DAO或完整的应用程序。 26 | 27 | ## 下层名称(Under_Names) 28 | 29 | 下层名称是由您的ANT(Arweave Name Token)持有和管理的记录。即使不拥有ArNS名称,您也可以创建和管理这些记录,并在将ANT发送给新的所有者时进行转移。同样,如果您的ArNS名称到期,并将您的ANT注册到新的ArNS名称上,您的所有下层名称将保持不变。 30 | 31 | 示例:您拥有oldName.arweave.net。 32 | 33 | 然后:您创建了下层名称"my" - my_oldName.arweave.net。 34 | 35 | 然后:oldName.arweave.net到期了,并且您将newName.arweave.net注册到了您的ANT上。 36 | 37 | 现在:my_下层名称可以在newName上访问 - my_newName.arweave.net。 38 | 39 | 以下是ANT合约状态的示例: 40 | 41 | ```json 42 | { 43 | balances:{ QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ : 1 }, 44 | controller: "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ", 45 | evolve: null, 46 | name: "ArDrive OG Logo", 47 | owner: "QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ", 48 | records:{ 49 | @:{ transactionId: "xWQ7UmbP0ZHDY7OLCxJsuPCN3wSUk0jCTJvOG1etCRo" }, 50 | undername1:{ transactionId: "usOLUmbP0ZHDY7OLCxJsuPCN3wSUk0jkdlvOG1etCRo" } 51 | }, 52 | ticker:"ANT-ARDRIVE-OG-LOGO" 53 | } 54 | ``` 55 | 基本的"@"记录是ANT的初始路由ID。如果您将'my-name'注册到此ANT,并尝试通过my-name.arweave.net访问它,您将被重定向到@记录的transactionId。 56 | 57 | 如果您尝试访问undername1_my-name.arweave.net,您将得到'undername1'的transactionId。 58 | 59 | 理论上,ANT拥有不受限制的undernames数量。然而,将服务多少个取决于使用的ArNS名称的层级。 60 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/atomic-tokens.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 原子代币概念和原则 5 | 6 | ![https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A](https://arweave.net/bcHI0TW_nH-iTfZnobD9Wt6d0Qe6thWfPrGhnvi1m1A) 7 | 8 | 原子代币是一个永久标识符,用于引用Permaweb上的数据和SmartWeave合约。 9 | 10 | ## 规范 11 | 12 | 数据必须存储在arweave网络上,并可通过交易标识符(TxId)引用。 13 | 14 | 合约必须实现一个表示原子代币所有权的“balances”对象。 15 | 16 | 合约必须实现一个“transfer”函数,接受以下参数: 17 | - target {钱包地址或合约} 18 | - qty {数量} 19 | 20 | > 转移函数应将所有权从调用者转移到目标。 21 | 22 | ## 选项 23 | 24 | _这些是可以使原子代币在Permaweb上可发现和可交易的实现选项_ 25 | 26 | [Verto Flex](https://github.com/useverto/flex) - Flex库允许您的原子代币在无需信任交易所的情况下进行出售或购买。 27 | 28 | [发现性标签 - ANS 110](https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-110.md) - 这些附加标签可以帮助Permaweb应用程序和服务发现您的令牌。 29 | 30 | [查看指南](../guides/atomic-tokens/intro.md) 31 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/bundlers.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # 打包服务 6 | 7 | --- 8 | 9 | 通过打包服务,用户可以将自己的数据交易发布到打包服务器上,将其与其他用户的交易一同"打包",并作为单个交易被加入到新的 Arweave 区块中。 10 | 11 | ### 发布到打包服务 12 | 13 | --- 14 | 15 | 您可以在[此处](/guides/posting-transactions/irys.md)了解如何将您的交易发布到打包服务。 16 | 17 | ### 什么是打包? 18 | 19 | --- 20 | 21 | 关于交易打包及优点的描述可以在[此处](/concepts/bundles.md)找到。 22 | 23 | ### 什么是打包节点? 24 | 25 | --- 26 | 27 | 打包节点是负责接受用户的交易或数据项目,将它们打包并发布到 Arweave 网络的节点(并保证使用特定的交易 ID 上传)。 28 | 29 | 打包服务的先驱和最大规模的服务提供者是[irys.xyz](https://irys.xyz)Irys 节点运行以下组件: 30 | 31 | - 一个 NGINX 反向代理 32 | - HTTP API 进程 33 | - 一个 Redis 缓存 34 | - 一个 SQL(Postgres)数据库 35 | - 工作进程 36 | 37 | 这些组件确保数据在上传到 Arweave 之前得到持久化。 38 | 39 | ### 支持多种货币 40 | 41 | --- 42 | 43 | 打包服务的一个关键特性是,它们支付基本的 Arweave 交易费用(使用 AR 代币),也可以选择其他代币支付储费用。这是其他链为其用户启用 Arweave 永久存储的主要入口点。 44 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/bundles.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # 交易捆绑/交易打包(Transaction Bundles) 6 | 7 | ### 什么是捆绑? 8 | 9 | --- 10 | 11 | 交易捆绑是一种特殊类型的 Arweave 交易。它可以将多个其他交易和/或数据项捆绑在其中。由于交易捆绑包含许多嵌套交易,它们是 Arweave 能够扩展到每秒数千个交易的关键。 12 | 13 | 用户将交易提交给捆绑服务器,例如[irys.xyz](https://irys.xyz),该服务将它们与其他交易组合成一个'bundle'(捆绑),然后将其发布到网络上。 14 | 15 | ### 捆绑如何帮助 Arweave? 16 | 17 | --- 18 | 19 | #### 可用性 20 | 21 | 捆绑服务保证捆绑的交易可靠地发布到 Arweave 而不会丢失。 22 | 23 | 捆绑交易的交易 ID 会立即可用,这意味着数据可以立即访问,就好像它已经在 Arweave 网络上一样。 24 | 25 | #### 可靠性 26 | 27 | 由于网络活动频繁等原因,发布到 Arweave 的交易有时可能无法确认(导致交易丢失)。在这些情况下,交易可能变成**孤立交易**,即被卡在内存池中并最终被删除。 28 | 29 | 捆绑解决了这个问题,它持续不断地尝试将捆绑的数据发布到 Arweave,以确保其不会失败或被卡在内存池中。 30 | 31 | #### 可扩展性 32 | 33 | 捆绑可以存储多达 2256笔交易,每笔交易都作为单笔交易在 Arweave 上结算。这使得 Arweave 的区块空间能够支持几乎任何用例。 34 | 35 | #### 灵活性 36 | 37 | 由于捆绑由构建在 Arweave 之上的捆绑服务处理,所以它可以使用不同的货币进行存储付费。[irys.xyz](https://irys.xyz)支持使用多种代币(如 ETH、MATIC 和 SOL)支付将数据上传到 Arweave。 38 | 39 | ### 什么是嵌套捆绑? 40 | 41 | --- 42 | 43 | 捆绑可以包含用于上传到 Arweave 的数据项,而这些数据项本身也可以是一个捆绑。 44 | 45 | 这意味着可以上传捆绑的捆绑,或者换句话说,**嵌套捆绑**。 46 | 47 | 嵌套捆绑在理论上没有嵌套深度的限制,这意味着交易吞吐量可以大大增加。 48 | 49 | 当您有不同的捆绑数据组,您希望保证这些数据组同时上传到 Arweave,嵌套捆绑可能会有用。 50 | 51 | 来源和进一步阅读: 52 | 53 | [Irys Docs](https://docs.irys.xyz) 54 | 55 | [ANS-104 Standard](https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-104.md) 56 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/gateways.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 网关(Gateways) 5 | 6 | --- 7 | 8 | 上传到Arweave网络(或[永久网](https://cookbook.arweave.dev/concepts/permaweb.html))的数据并不是立即可用的。 9 | 10 | ### 什么是网关? 11 | 12 | 网关也可被称为“永久网的前门”。它们是Arweave和用户之间的接口,使得从您的网页浏览器中轻松访问数据或使用永久网应用变得容易。 13 | 14 | 例如,访问存储在Arweave上的HTML文件将在您的浏览器中显示为一个网页。查看图片、下载文件、查看JSON数据或任何其他存储在Arweave上的文件也是如此。这使得与永久网的交互非常类似于使用传统的网页。 15 | 16 | ### 网关的其他作用 17 | 18 | 除了为用户提供访问数据的服务外,网关还提供其他服务,例如: 19 | 20 | - 缓存经常访问的数据和交易 21 | - 对交易进行索引和查询(通过Arweave标签和GraphQL接口) 22 | - 在整个Arweave网络中播种交易 23 | - 内容审查(通过内容策略选择提供或不提供的数据) 24 | 25 | ### 网关和Arweave协议 26 | 27 | 虽然网关在允许内容在Arweave上被访问方面起着重要作用,但它们**不**是核心协议的一部分。 28 | 29 | 这意味着托管和运行网关与运行保护Arweave网络的节点是分开的(尽管通常一起运行)。 30 | 31 | 由于网关不是核心协议的一部分,因此没有内置的激励机制,如挖矿的奖励或激励。这使得网关运营商或外部服务能够选择如何构建他们的激励系统,从而实现更加分散和民主的模式。甚至个别应用程序可以运行自己的网关,以实现更好的缓存和永久网应用性能。 32 | 33 | 一些受欢迎的网关包括由Arweave团队运营的[arweave.net](https://arweave.net/),以及其他网关如 [arweave.world](https://cookbook.arweave.world/) [arweave.asia](https://cookbook.arweave.asia) [arweave.live](https://arweave.live/)和[g8way.io](https://g8way.io)。然而,通过[AR.IO](https://ar.io/)等团队,网关的运营变得更加简单和易于访问。 34 | 35 | ### 来源和进一步阅读材料 36 | 37 | - [ArWiki](https://arwiki.wiki/#/en/gateways) 38 | - [AR.IO](https://ar.io/) 39 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/keyfiles-and-wallets.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 钱包和密钥 5 | 6 | --- 7 | 8 | ### Arweave 钱包 9 | 10 | 在 Arweave 上,钱包是用于在区块链上保证一个唯一地址的工具。该地址用于跟踪您的 $AR 余额,并与 Arweave 网络进行交互,例如发送交易或与[SmartWeave 合约](../guides/smartweave/warp/intro.md)进行交互。 11 | 12 | 与大多数区块链一样,在 Arweave 上,钱包的概念可能有一些误导。 13 | 14 | 钱包本身**不持有**任何代币;代币余额存储在区块链上,并与钱包地址关联。相反,钱包持有用于签署交易以发布数据或转移代币的加密的公私钥对。拥有该钱包的所有者(具有访问钱包的**私钥**)是唯一能够为该地址签署交易并访问其资金的人。 15 | 16 | ### 公私钥对和钱包格式 17 | 18 | Arweave 使用 *4096 位* RSA-PSS 密钥对,并以 JWK(JSON Web Keys)格式存储。JWK 格式可用于存储多种类型的加密密钥,而不仅仅是 RSA 密钥对。 19 | 20 | 以下是描述 RSA-PSS 密钥对的 JWK 文件内容。这些值进行了缩写,以防止意外地将它们用作链上交易的发送方或接收方。在存储 RSA-PSS 密钥对时,与 JWK 中的 `n` 关联的值是您钱包的**公钥**,可以安全地共享,而不会损害钱包的安全性。 21 | 22 | ```json 23 | { 24 | "d": "cgeeu66FlfX9wVgZr5AXKlw4MxTlxSuSwMtTR7mqcnoE...", 25 | "dp": "DezP9yvB13s9edjhYz6Dl...", 26 | "dq": "SzAT5DbV7eYOZbBkkh20D...", 27 | "e": "AQAB", 28 | "ext": true, 29 | "kty": "RSA", 30 | "n": "o4FU6y61V1cBLChYgF9O37S4ftUy4newYWLApz4CXlK8...", 31 | "p": "5ht9nFGnpfW76CPW9IEFlw...", 32 | "q": "tedJwzjrsrvk7o1-KELQxw...", 33 | "qi": "zhL9fXSPljaVZ0WYhFGPU..." 34 | } 35 | ``` 36 | 37 | 您的**私钥**也存储在 JWK 中,主要存储在与 `d` 关联的值下,但也部分派生自 JWK 中的其他值。**私钥**就像是您钱包的密码,它可以用于创建数字签名(例如用于签署交易)或解密数据。 38 | 39 | 这些 JWK 是实际的 `json` 文件,通过钱包应用程序(如[Arweave.app](https://arweave.app))创建和导出,或使用[arweave-js](https://github.com/ArweaveTeam/arweave-js)通过代码生成。 40 | 41 | 使用钱包应用程序生成密钥对时,您的**私钥**也可以表示为一个助记符**种子短语**,在某些情况下,它可以用作替代方法来签署交易和/或恢复您的钱包。 42 | 43 | ### 钱包安全 44 | 45 | 您的**私钥**必须始终保密,因为它具有将代币从您的地址转移到他人地址的能力。作为开发者,请确保不要在任何公共的 GitHub 存储库中包含您的密钥文件,也不要在任何其他公开位置托管它。 46 | 47 | ### 钱包地址 48 | 49 | 有趣的是,您的钱包地址是由其**公钥**派生的。尽管安全分享您的**公钥**给他人,但 *4096 位*的**公钥**在方便传递时有些太长。为了减少这种开销并使钱包地址更加可读,将**公钥**的 `SHA-256` 哈希进行了`Base64URL`编码,并用作钱包地址。这种安全和确定性地将一个唯一的 43 个字符的钱包地址与钱包的**公钥**关联起来,并提供了一个方便的缩写,任何人只要具有该**公钥**即可验证。 50 | 51 | ### 钱包 52 | 53 | [Arweave.app](https://arweave.app/welcome) - Arweave 网页钱包,用于部署永久数据、安全地将您的账户连接到去中心化的应用程序,并导航 Arweave。 54 | 55 | [ArConnect](https://www.arconnect.io/) - Arweave 钱包浏览器扩展程序 56 | 57 | ### 来源和进一步阅读: 58 | [Arweave 文档](https://docs.arweave.org/developers/server/http-api#key-format) 59 | 60 | [JSON Web Key 格式 (RFC 7517)](https://www.rfc-editor.org/rfc/rfc7517) -------------------------------------------------------------------------------- /docs/src/zh/concepts/permaweb.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 欢迎来到永久网络(Permaweb) 5 | 6 | 永久网络类似于互联网,但是它是永久存在的。开发者可以在永久网络服务的基础上构建应用和网站,这些应用和网站将永远存在于Arweave上。 7 | 8 | ![永久网络](https://arweave.net/lK3mptAgC2cijnPvogKaLCOsKSuPlvLu_6opnEOrpT0) 9 | 10 | 永久网络的好处: 11 | 12 | 1. 网站和应用是永久存在的,您不必担心它们会消失(即使支持它们的团队离开了) 13 | 2. 应用开发者必须确保每个新版本的应用都增加了价值,否则,何必放弃旧版本呢。 14 | 3. 因为所有的永久网络应用都共享一个存储层Arweave,它们可以访问彼此的数据。 15 | 4. 您的数据由您的钱包拥有,并且可以在应用之间使用。 16 | 17 | ## 传统网络与永久网络的比较 18 | 19 | ![永久网络与传统网络](https://arweave.net/5EP6mhpHsfnTsmFk7aVyK8jF6zqavxJT4kgx70mUc5I) 20 | 21 | 要了解更多关于永久网络的信息,请查看[medium文章](https://arweave.medium.com/welcome-to-the-permaweb-ce0e6c73ddfb)。 22 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/permawebApplications.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # 永久网(permaweb)应用程序 6 | 7 | 永久网(permaweb)应用程序是一种在您的浏览器中运行的网页或 Web 应用程序。使其成为永久网(permaweb)应用程序的是它被部署到 Arweave 并永久保存。即使开发该应用程序的团队不再维护,用户也可以放心,永久网(permaweb)应用程序仍然在线并可用。永久网(permaweb)应用程序的巨大优势在于它们将数据保存在 Arweave 上,这意味着可以轻松将其导入到其他可能改善您当前使用的应用程序的应用程序中。 8 | 9 | ## 什么是永久网(permaweb)? 10 | 11 | ::: 信息 12 | 深入了解永久网(permaweb)的详细信息,请参阅[永久网(permaweb)](./permaweb.md)这篇文章 13 | ::: 14 | 15 | 永久网(permaweb)是建立在[Arweave 永久网(permaweb)服务](./permaweb.md)之上的站点、应用程序和智能合约的集合。永久网(permaweb)的核心部分包括以下内容: 16 | 17 | - 网关服务(如 arweave.net、arweave.live、ar.io) 18 | - 包装服务(如 irys.xyz) 19 | - 序列化服务(如 warp.cc) 20 | - 索引服务(如 goldsky) 21 | 22 | 23 | 24 | ### 网关服务 25 | 26 | 网关服务是连接 Arweave 上的数据和在浏览器中显示数据之间的桥梁。网关通常提供索引服务,同时提供事务数据服务,为查询 Arewave 事务公开 graphQL 链接点。 27 | 28 | ### 包装服务 29 | 30 | 包装服务将交易聚合成事务包,并确保这些事务包直接发布到 Arewave。通过使用像 irys.xyz 这样的捆绑服务,您可以在单个 Arweave 块中发布数十万个事务。 31 | 32 | ### 序列化服务 33 | 34 | 序列化服务使得智能合约能够高性能计算存储在 Arweave 网络上的业务逻辑。 35 | 36 | ### 索引服务 37 | 38 | 索引服务监听 Arweave 上的所有交易,并将它们导入到适用于快速查询的索引数据库中。然后它们公开一个 graphQL 端点,以便永久网(permaweb)应用程序可以对 Arweave 数据进行优化查询。 39 | 40 | 这些服务共同组成了永久网(permaweb)服务层,并赋予开发人员在永久网(permaweb)上构建完全分散的应用程序的能力。 41 | 42 | ## 应用程序开发 43 | 44 | 使用永久网(permaweb)进行应用程序开发与“单页应用程序”开发类似,应用程序由在 Web 浏览器中执行的前端功能组成,并使用 GraphQL(读取/查询)、Irys(写入)和 SmartWeave(分布式计算)组成应用程序的业务逻辑和持久化层。 45 | 46 | ![common permaweb app](https://arweave.net/UjbgAk8duudDc97lOYIt7rBVtRHp2Z9F6Ua5OcvwNCk/) 47 | 48 | 通过利用现代 Web 应用程序框架和[路径清单](./manifests.md)规范,开发人员可以将网站和应用程序部署到永久网(permaweb)上。 49 | 50 | 要了解有关创建和部署永久网(permaweb)应用程序的更多信息,请查看您喜欢的框架中的我们的起始套件: 51 | 52 | - [React](../kits/react/index.md) 53 | - [Svelte](../kits/svelte/index.md) 54 | 55 | ::: 提示 缺少我所用的框架? 56 | 找不到您的框架?为什么不贡献一下呢?[如何对菜谱做贡献](../getting-started/contributing.md) 57 | ::: 58 | -------------------------------------------------------------------------------- /docs/src/zh/concepts/psts.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 概述 5 | 6 | --- 7 | 8 | 利润分享通证(PST)是一种SmartWeaveToken,包括以下结构: 9 | 10 | | 属性 | 类型 | 11 | | ---------- | ---------- | 12 | | 余额 | 对象 | 13 | | 名称 | 字符串 | 14 | | 代号 | 字符串 | 15 | | 转账 | 方法 | 16 | | 余额查询 | 方法 | 17 | 18 | PST通常用于治理一个协议或“利润分享社区”(PSC),类似于DAO。 19 | 20 | ### 如何分发PST? 21 | 22 | --- 23 | 24 | 应用的创始人可以创建一定数量的PST,并根据自己的意愿分发它们,可以保留或出售给投资者以筹集资金。 25 | 26 | 协议可以以PST作为奖励来奖励贡献工作或完成社区任务以激励增长。 27 | 28 | PST也可以在[Permaswap](https://permaswap.network/#/)(目前处于测试网)之间进行交换,开发人员可以使用[Verto Flex](https://github.com/useverto/flex)设置代币交易权限。 29 | 30 | ### 特点 31 | 32 | --- 33 | 34 | PST作为“微股息”起作用。当使用协议时,一定数量的小费被保留下来分配给持有者。小费以 $AR 的形式支付,而不是PST的货币。这在正在开发的应用程序和Arweave之间创造了一种特殊的关系。 35 | 36 | ### 好处 37 | 38 | --- 39 | 40 | - 为开发人员提供了一种灵活的方式来运行协议,并根据需要分发“所有权” 41 | - PST可以用作协议工作或社区任务的支付方式 42 | - 鼓励创始人增加网络使用量,因为它直接与收入相关 43 | - 持有者获得内在价值(奖励 $AR,而不是更多的“股份”) 44 | 45 | ### 示例PST:ARDRIVE Token 46 | 47 | --- 48 | 49 | ArDrive是一个永久网络应用程序,利用了他们恰如其名的PST,即ARDRIVE。 50 | 51 | 当有人通过ArDrive支付 $AR 来上传数据时,15% 的社区费用会按照随机加权的方法分配给一个令牌持有者。 52 | 53 | ![ArDrive PST Cycle](~@source/images/ardrive-pst.png) 54 | 55 | 用户上传数据 -> 一个 ARDRIVE 代币持有者收到 $AR -> ARDRIVE 代币持有者可以使用这个 $AR 来上传文件 -> 周期重复。希望这给您一个关于您可以实现自己的PST的一个好主意! 56 | 57 | ### 探索PSTs 58 | 59 | --- 60 | 61 | 直接使用ViewBlock和Sonar by Redstone可能是最合适的。只需使用显示PST的链接,以免让人们翻阅查找。 62 | 63 | 您可以使用[ViewBlock](https://viewblock.io/arweave)获得类似于etherscan的体验,查看PST合约,例如[这里](https://viewblock.io/arweave/contract/-8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ)。 64 | 65 | 另一个选择是Sonar,这是一个由[RedStone Finance](https://sonar.redstone.tools/#/app/contracts)构建的Arweave智能合约浏览器。在这里查看相同的合约[here](https://sonar.warp.cc/?#/app/contract/-8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ)。 66 | 67 | > 一些社区成员已经在讨论将PST称为“永久网络服务通证”。在PST方面还有很多探索要做 → 加入[此处](https://discord.com/channels/999377270701564065/999377270701564068/1055569446481178734)的讨论(Discord)。 -------------------------------------------------------------------------------- /docs/src/zh/concepts/vouch.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Vouch(背书) 5 | ## 概述 6 | #### Vouch 协议 7 | Arweave 引入了 ANS-109 Vouch(身份声明)的概念。它是一种使用特定的交易格式和一些标签的标准,允许 permaweb 上的任何人为任何 Arweave 地址的身份和人性提供“背书”。 8 | 9 | 将 ANS-109 这样的标准添加到 permaweb 中将有助于最小化 Sybil 攻击和恶意行为者,使 permaweb 用户体验更加安全。 10 | 11 | #### VouchDAO 12 | VouchDAO 是一个由社区领导的、建立在 Vouch 标准之上的分散验证层。开发者创建背书服务,VouchDAO 社区的成员投票决定哪些验证服务值得信赖。 13 | 14 | 一旦创建了新的服务,其地址将在 [VouchDAO community.xyz](https://community.xyz/#_z0ch80z_daDUFqC9jHjfOL8nekJcok4ZRkE_UesYsk) 接口上进行投票。如果投票通过,它将被添加为经过验证的背书。 15 | 16 | 17 | 18 | ## 工作原理 19 | 开发者可以创建不同的 Vouch 服务,根据给定的一组要求对用户的 Arweave 钱包进行证明。当前的一个例子是 Twitter 服务,这是第一个背书服务,迄今已为超过180个 Arweave 地址提供了背书。 20 | 21 | VouchDAO 智能合约状态具有一个 `vouched` 属性。每当用户进行验证时,状态将会更新。`vouched` 对象以以下格式存储一系列接受背书的地址: 22 | ``` 23 | VOUCH_USER_ADDRESS:[ 24 | { 25 | service:"SERVICE_ADDRESS_1" 26 | transaction:"TX_ID" 27 | }, 28 | { 29 | service:"SERVICE_ADDRESS_2" 30 | transaction:"TX_ID" 31 | } 32 | ] 33 | ``` 34 | 35 | 获得验证的用户将在他们的钱包中收到 ANS-109 令牌,表示该钱包已经由该服务进行了背书。 36 | 37 | ## ANS-109 交易格式 38 | | 标签名 | _是否可选_ | 标签值 | 39 | |---|---|---| 40 | |App-Name|否|`Vouch`| 41 | |Vouch-For|否|正在此交易中为其提供背书的 Arweave `address`| 42 | |App-Version|是|`0.1`| 43 | |Verification-Method|是|验证此人的身份的方法。例如 - `Twitter`/`In-Person`/`Gmail`/`Facebook`| 44 | |User-Identifier|是|基于验证方法的用户标识符。例如 - `abhav@arweave.org`| 45 | 46 | ## 资源 47 | * [VouchDAO](https://vouch-dao.arweave.dev) 48 | * [VouchDAO 合约](https://sonar.warp.cc/?#/app/contract/_z0ch80z_daDUFqC9jHjfOL8nekJcok4ZRkE_UesYsk) -------------------------------------------------------------------------------- /docs/src/zh/getting-started/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Permaweb中的烹饪 5 | 6 | Permaweb Cookbook 是一个开发者资源,提供了在长久网络(Permaweb)上构建应用所需的基本概念和参考资料。每个概念和参考资料都将重点介绍 Permaweb 开发生态系统的特定方面,并提供额外的细节和用法示例。 7 | 8 | ## 开发者们 9 | 10 | 欢迎来到 Arweave 开发社区,在这里历史会永远镌刻在区块链中,未来充满了无限可能。让我们一起构建去中心化的网络! 11 | 12 | [了解更多](welcome.md) 13 | 14 | ## 贡献 15 | 16 | Cookbook 使新进入 Permaweb 的开发者可以更轻松的构建应用并做出贡献。即使您不知道如何做某件事,贡献Cookbook 也是学习的好方法! 17 | 18 | 在此查看所有开放问题。在此查看贡献指南。如果您发现烹饪书缺少某个概念、指南或参考资料,请添加一个问题。 19 | 20 | [了解更多](contributing.md) 21 | 22 | 23 | ## 如何阅读烹饪书 24 | 25 | Permaweb Cookbook分为不同的部分,每个部分旨在实现不同的目标。 26 | 27 | | 部分 | 描述 | 28 | | ---- | ---- | 29 | | 核心概念 | Permaweb的构建块,对开发有益的基本概念 | 30 | | 指南 | 关于不同开发工具的简单指南 | 31 | | 参考 | 常用代码片段参考 | 32 | | 入门套件 | 前端框架入门套件,可帮助您在长久网络上快速开始构建 | 33 | 34 | ## 快速开始 35 | 36 | 这些是小型指南,可以帮助开发者从任何经验水平上构建代码到 Permaweb 中。 37 | 38 | - [Hello World (NodeJS)](quick-starts/hw-nodejs.md) 39 | -------------------------------------------------------------------------------- /docs/src/zh/getting-started/contributing.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 贡献流程 5 | 6 | 我们欢迎社区中的任何人为Permaweb Cookbook做出贡献,作为社区成员,我们希望有一个高质量的参考指南,其中包含了一些小块的信息片段。以下是如何为这个项目做出贡献的流程。 7 | 8 | ## 需要了解什么? 9 | 10 | * Git和Github - 将内容发布到github.com。 11 | * Markdown - Markdown是一种基于文本的标记语言,可以转换为HTML。 12 | * Arweave和Permaweb - 对Permaweb有一些了解。 13 | 14 | ## 贡献步骤 15 | 16 | 17 | ![diagram](https://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgQ29udHJpYnV0aW5nIHRvIFBlcm1hd2ViIENvb2tib29rCgoAGglvciAtPiBSZXBvIDogQ2hlY2sgT3V0IG9mIEZvcmsAFAVzaXRvcnkKbm90ZSBvdmVyAFYKb3IgOiBDcmVhdGUgTWFya2Rvd24gRG9jdW1lbnQAFxpvbW1pdCBDaGFuZ2VzAHQXUHVzaCBCcmFuY2gAYRljAHQGUHVsbCBSZXF1ZXMAWxphc3NpZ24gcmV2aWV3ZXIocykKUgAFBwCBdgsADQYAOhgAKAk6IEFwcHJvdmUgUFIAgjQXbWVyZ2UgdG8gbWFpbg&s=mscgen) 18 | 19 | ## 需要帮助吗? 20 | 21 | 加入我们的[Discord频道](https://discord.gg/haCAX3shxF)并发布一条消息。 22 | 23 | ## 提交工作 24 | 25 | 我们在这个仓库中使用[约定式提交](https://www.conventionalcommits.org/en/v1.0.0/)来提交工作。 26 | 27 | 进行贡献的一般流程: 28 | 29 | 1. 在GitHub上Fork这个仓库 30 | 2. 将项目克隆到自己的机器上 31 | 3. 将更改提交到自己的分支 32 | 4. 将你的工作推送到你的Fork 33 | 5. 提交一个Pull请求以便我们审查你的更改 34 | 35 | **注意**:在发起pull请求之前,一定要合并"upstream"最新的内容! 36 | 37 | ## 风格 38 | 39 | 以下是一些建议的语气和风格: 40 | 41 | ::: 提示 42 | 在编写它们时,我对每个部分适合的语气有了一个感觉。 43 | 核心概念应该比较像课本,是中立、客观的。"这就是Arweave的工作原理" 44 | 对于指南,我认为使用更个人化的语言是可以的。用"你"来称呼读者,并以合作的语音说"接下来我们将来看一下..." 45 | 这可能只是个人偏好,但总的来说,我觉得这种语气在长形式指南中更具支持性和易接近性。 46 | 确实,这是其他生态系统中大多数流行教程所使用的声音。 47 | 对于资源,我认为它与核心概念声音相同,更偏向简洁。 48 | 49 | dmac 50 | ::: 51 | 52 | 53 | ::: 提示 54 | 概念和参考数据应该具有更严谨科学的语气,指南应该是一种支持性甚至幽默的语气。长形式的内容需要吸引读者,不要让他们走神。 55 | 56 | Arch_Druid 57 | ::: 58 | 59 | ## 关于贡献的更多信息,请查阅仓库的风格指南 60 | 61 | [CONTRIBUTING](https://github.com/twilson63/permaweb-cookbook/blob/main/CONTRIBUTING.md) 62 | 63 | -------------------------------------------------------------------------------- /docs/src/zh/getting-started/quick-starts/hw-cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # Hello World(CLI) 6 | 7 | 本指南将引导您通过命令行界面(CLI)以最简单的方式将数据上传到永久网络(permaweb)。 8 | 9 | ## 要求 10 | 11 | - [NodeJS](https://nodejs.org) LTS 或更高版本 12 | 13 | ## 描述 14 | 15 | 使用终端/控制台窗口创建一个名为 `hw-permaweb-1` 的新文件夹。 16 | 17 | ## 设置 18 | 19 | ```sh 20 | cd hw-permaweb-1 21 | npm init -y 22 | npm install arweave @irys/sdk 23 | ``` 24 | 25 | ## 生成钱包 26 | 27 | ```sh 28 | node -e "require('arweave').init({}).wallets.generate().then(JSON.stringify).then(console.log.bind(console))" > wallet.json 29 | ``` 30 | 31 | ## 创建网页 32 | 33 | ```sh 34 | echo "

Hello Permaweb

" > index.html 35 | ``` 36 | 37 | ## 使用 Irys 上传 38 | 39 | ```sh 40 | irys upload index.html -c arweave -h https://node2.irys.xyz -w ./wallet.json 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/src/zh/getting-started/quick-starts/hw-no-code.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Hello World(无需代码) 5 | 6 | 在本快速入门中,我们将无需任何代码即可将图像上传到 permaweb! 7 | 8 | 9 | ## 要求 10 | 11 | * 电脑 12 | * 互联网 13 | * 现代化的网页浏览器 14 | 15 | ## 创建一个钱包 16 | 17 | [https://arweave.app/add](https://arweave.app/add) 或 [https://arconnect.io](https://arconnect.io) 18 | 19 | ## 发送一些数据到 Arweave 20 | 21 | 打开这个网页 https://hello_cookbook.arweave.dev 22 | 输入一些数据并点击发布,连接你的钱包和“BAM” 23 | 24 | 25 | ## 恭喜!! 26 | 27 | 您刚刚没有使用任何代码在 Arweave 上发布了一些数据。 28 | -------------------------------------------------------------------------------- /docs/src/zh/getting-started/quick-starts/hw-nodejs.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # Hello World(NodeJS) 6 | 7 | 本指南将指导您使用`arweave-js`和`Irys`的最简单方法将数据放入永久网络(Permaweb)。 8 | 9 | 由于 Arweave 2.6 每个区块仅允许 1000 个项目,直接发布到网关(例如使用`arweave-js`)的情况可能很少见。 10 | 11 | ## 要求 12 | 13 | - [NodeJS](https://nodejs.org) LTS 或更高版本 14 | 15 | ## 描述 16 | 17 | 请在终端/控制台窗口中创建一个名为 `hw-nodejs` 的新文件夹。 18 | 19 | ## 设置 20 | 21 | ```sh 22 | cd hw-nodejs 23 | npm init -y 24 | npm install arweave @irys/sdk 25 | ``` 26 | 27 | ## 生成一个钱包 28 | 29 | ```sh 30 | node -e "require('arweave').init({}).wallets.generate().then(JSON.stringify).then(console.log.bind(console))" > wallet.json 31 | ``` 32 | 33 | ## 使用 Irys 上传(免费交易) 34 | 35 | ```js:no-line-numbers 36 | import Irys from "@irys/sdk"; 37 | import fs from "fs"; 38 | 39 | const jwk = JSON.parse(fs.readFileSync("wallet.json").toString()); 40 | 41 | const irys = new Irys({} 42 | "http://node2.irys.xyz", 43 | "arweave", 44 | jwk 45 | }); 46 | 47 | irys 48 | .upload("你好,世界") 49 | .then((r) => console.log(`https://arweave.net/${r.id}`)) 50 | .catch(console.log); 51 | ``` 52 | 53 | ## 使用 ArweaveJS 上传 54 | 55 | 如果您正在运行最新版本的`nodejs`,那么此`arweavejs`脚本将按原样工作。对于其他版本,您可能需要使用`--experimental-fetch`标志。 56 | 57 | ```js:no-line-numbers 58 | import Arweave from "arweave"; 59 | import fs from "fs"; 60 | 61 | // 从磁盘加载JWK钱包密钥文件 62 | const jwk = JSON.parse(fs.readFileSync('./wallet.json').toString()); 63 | 64 | // 初始化arweave 65 | const arweave = Arweave.init({ 66 | host: "arweave.net", 67 | port: 443, 68 | protocol: "https", 69 | }); 70 | 71 | const tx = await arweave.createTransaction( 72 | { 73 | data: "Hello world!", 74 | }, 75 | jwk 76 | ); 77 | 78 | await arweave.transactions.sign(tx, jwk); 79 | 80 | arweave.transactions.post(tx).then(console.log).catch(console.log); 81 | console.log(`https://arweave.net/${tx.id}`); 82 | ``` 83 | 84 | ## 资源 85 | 86 | - [Irys Irys 软件开发工具包)](https://github.com/irys-xyz/js-sdk) 87 | - [Arweave JS SDK(Arweave JavaScript 软件开发工具包)](https://github.com/ArweaveTeam/arweave-js) 88 | - [Irys 文档:免费上传](http://docs.irys.xyz/faqs/dev-faq#does-irys-offer-free-uploads) 89 | -------------------------------------------------------------------------------- /docs/src/zh/getting-started/welcome.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 在永久网络上进行开发 5 | 6 | ## 欢迎来到永久网络 7 | 8 | 在Arweave协议上构建永久网(permaweb)应用程序,和构建传统的应用程序类似,但是有些关键差别。 9 | 10 | 一个主要的差异是数据永久存储在永久网络上,而不是存储在集中服务器上,正如其名称所暗示的那样。这意味着一旦数据上传到永久网络上,就无法被删除或修改。这对于需要防篡改数据存储的应用程序,如供应链管理或投票系统,可以带来益处。 11 | 12 | 另一个差异是,永久网络是去中心化的,意味着没有中心控制点或故障点。这可以为应用程序提供增强的安全性和可靠性。 13 | 14 | 此外,永久网络使用一种称为AR的代币来支付在网络上存储数据的费用。这可能增加应用程序开发的复杂性,开发人员需要考虑如何将AR集成到他们的应用程序中并处理支付事务。 15 | 16 | 总体而言,在永久网络上创建应用程序的经验可能具有挑战性,但也具有传统网络开发所没有的独特优势。 17 | 18 | ## 你好世界 19 | 20 | * [Hello World(无代码)](./quick-starts/hw-no-code.md) 21 | * [Hello World(CLI)](./quick-starts/hw-cli.md) 22 | -------------------------------------------------------------------------------- /docs/src/zh/guides/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # 指南 6 | 7 | Permaweb 建设模块的简明指南 8 | 9 | - [ArProfile](arprofile.md) 10 | - [DNS 集成](dns-integration/server-side.md) 11 | - [服务器端](dns-integration/server-side.md) 12 | - [Spheron](dns-integration/spheron.md) 13 | - [部署应用](deployment/irys-cli.md) 14 | - [arkb](deployment/arkb.md) 15 | - [irys-cli](deployment/irys-cli.md) 16 | - [github-action](deployment/github-action.md) 17 | - [部署 PathManifests](deploying-manifests/deployingManifests.md) 18 | - [arweave.app](deploying-manifests/arweave-app.md) 19 | - [ardrive](deploying-manifests/ardrive.md) 20 | - [irys.xyz](deploying-manifests/irys.md) 21 | - [部署 PSTs](deploying-psts.md) 22 | - [GraphQL](querying-arweave/queryingArweave.md) 23 | - [ArDB](querying-arweave/ardb.md) 24 | - [ar-gql](querying-arweave/ar-gql.md) 25 | - [搜索服务](querying-arweave/search-indexing-service.md) 26 | - SmartWeave 27 | - [原子代币](atomic-tokens/intro.md) 28 | - [担保](vouch.md) 29 | - Warp Contracts 30 | - [介绍](smartweave/warp/intro.md) 31 | - [部署合约](smartweave/warp/deploying-contracts.md) 32 | - [读取合约状态](smartweave/warp/readstate.md) 33 | - [编写合约互动](smartweave/warp//write-interactions.md) 34 | - [演化合约](smartweave/warp//evolve.md) 35 | - [测试](testing/arlocal.md) 36 | 37 | > 您是否认为缺少 Permaweb 的指南?在[Github](https://github.com/twilson63/permaweb-cookbook/issues)上创建一个问题或考虑[贡献](../getting-started/contributing.md)。 38 | -------------------------------------------------------------------------------- /docs/src/zh/guides/deploying-manifests/ardrive.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | ### ArDrive 5 | 6 | --- 7 | 8 | 您可以使用[ArDrive CLI](https://github.com/ardriveapp/ardrive-cli)的`ardrive create-manifest`命令为文件夹或一组文件夹创建清单。 9 | 10 | 进一步阅读:[ArDrive CLI文档](https://github.com/ardriveapp/ardrive-cli) 11 | 12 | --- 13 | 14 | 或者,您还可以在[ArDrive](https://ardrive.io)的Web应用程序中选择New → Create manifest来创建清单。 15 | 16 | ![ArDrive Web App清单](~@source/images/ardrive-manifests.png) -------------------------------------------------------------------------------- /docs/src/zh/guides/deploying-manifests/arseeding-js.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | ### Arseeding JS SDK 6 | 7 | --- 8 | 9 | *下面将为大家介绍如何便捷的在 Arseeding 中使用 Manifest 功能。* 10 | ## 使用 11 | 12 | ### 安装 SDK 13 | ```bash 14 | npm i arseeding-js 15 | ``` 16 | 17 | 创建一个 demo.js, 将以下代码复制进去。 18 | 19 | ```jsx 20 | import {uploadFolderAndPay} from "arseeding-js/cjs/uploadFolder"; 21 | 22 | const run = async () => { 23 | const path = 'Your Folder path' 24 | const priv = 'YOUR PRIVATE KEY' 25 | const arseedUrl = 'https://arseed.web3infra.dev' 26 | const tag = '' // everPay 支持的 token tag (chainType-symbol-id) 27 | const indexFile = '' 28 | 29 | const res = await uploadFolderAndPay(path,priv,arseedUrl,tag, indexFile) 30 | console.log(res) 31 | } 32 | 33 | // review manifest Data 34 | curl --location --request GET 'https://arseed.web3infra.dev/{res.maniId}' 35 | ``` 36 | 37 | 38 | 配置说明: 39 | 40 | - 将你的 ECC 密钥填充到`YOUR PRIVATE KEY`。确保 private key 对应的钱包在 everPay 拥有资产。 41 | - `arseedUrl` 是 Arseeding 后端服务地址,这里我们使用 permadao 提供的 public Arseeding 服务:https://arseed.web3infra.dev。 42 | - `payUrl`是需要配置的 everPay 服务的 URL:[https://api.everpay.io](https://api.everpay.io/) 43 | - path 为你想要上传的文件夹的路径,例如,部署静态网站,前端项目编译后会生成 build 或 dist 文件夹,选择该文件夹的路径即可。 44 | - `tag` 是需要选择的支付 `token tag`,如果你的 MetaMask 地址在 everPay 持有的是 usdc,可通过 [getTokenTagByEver('usdc')](./9.getTokenTag.md) 来获取 usdc tag。如果想通过其他代币支付,填入代币名称获取 指定 tag 即可。 45 | - `indexFile` 是可选参数,你可以传入一个该文件夹下最重要的文件名(e.g main.txt),如果你上传的是一个前端项目的 build 文件夹,则不需要传入此参数。 46 | 47 | 在准备好配置后,调用 uploadFolderAndPay(path,priv,url,payCurrency) 就可以将你的文件夹下的所有文件通过 manifest 的方式上传到 web3infra 的 Arseeding 节点。 48 | 49 | ```bash 50 | node demo.js 51 | ``` 52 | 53 | 正确执行后终端将返回: 54 | 55 | ```tsx 56 | { 57 | fee: '0.004218', 58 | maniId: 'EHeDa8b428L38b972qyHI87YELuZKue1jDI_JWC-aGE', 59 | everHash:[ 60 | '0x46744320be6529c48bf18c348fa181facef3d9d6d920a24687dc9964ba3ead0a' 61 | ] 62 | } 63 | ``` 64 | 65 | ## 下载数据-页面访问 66 | 67 | 在返回的结果中可以找到`maniId`,上文中 maniId 为:EHeDa8b428L38b972qyHI87YELuZKue1jDI_JWC-aGE 。 68 | 69 | 在本教程中,我们上传的是一个 docusaurus 前端项目,在该项目下运行 `yarn build` 会生成一个build 文件夹,我们上传的正是这个文件夹。现在,我们可以通过 maniId 来访问这个站点了! 70 | 71 | 在你的浏览器中输入: 72 | 73 | ```bash 74 | https://arseed.web3infra.dev/EHeDa8b428L38b972qyHI87YELuZKue1jDI_JWC-aGE 75 | ``` 76 | 77 | 就可以访问到这个网站了,并且是永久可用的! 78 | --- 79 | 80 | 参考资料和阅读更多内容: 81 | * [Arseeding 文档](https://web3infra.dev/docs/arseeding/introduction/lightNode) 82 | * 使用 Arseeding 上传 Manifest 教程[在此处](https://web3infra.dev/docs/arseeding/sdk/arseeding-js/manifest/)。 -------------------------------------------------------------------------------- /docs/src/zh/guides/deploying-manifests/arweave-app.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | ### Arweave.app 5 | 6 | --- 7 | 8 | 通过[Arweave.app](http://Arweave.app)上传一个目录将自动为目录中的所有文件创建一个清单。 9 | 10 | ![ArweaveApp 清单上传](~@source/images/arweaveapp-manifest.png) 11 | 12 | 或者,您可以手动上传自己的清单文件,添加以下标签,然后提交交易。 13 | 14 | ![ArweaveApp 清单标签](~@source/images/arweaveapp-tags.png) -------------------------------------------------------------------------------- /docs/src/zh/guides/deploying-manifests/deployingManifests.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 创建和部署清单 5 | 6 | --- 7 | 8 | 本指南介绍如何手动创建和部署路径清单。 9 | 10 | 路径清单核心概念页面提供了更多关于清单的信息,以及为什么清单可能对您的项目有用。 11 | 12 | 如果您按照本指南部署路径清单,它需要按照[核心概念](https://cookbook.arweave.dev/concepts/manifests.html)页面中列出的清单结构。 -------------------------------------------------------------------------------- /docs/src/zh/guides/deploying-manifests/irys.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | ### Irys CLI 6 | 7 | --- 8 | 9 | `irys upload-dir ` 将本地目录上传到 Arweave,并自动生成文件清单。 10 | 11 | 如果您想手动上传自己的文件清单,请在任何交易中使用 `--content-type "application/x.arweave-manifest+json"` 标志来标识它为一个文件清单交易。 12 | 13 | ### Irys JS 客户端 14 | 15 | --- 16 | 17 | 使用以下代码片段将本地目录上传到 Arweave,并自动生成文件清单: 18 | 19 | ```js 20 | await irys.uploadFolder("./path/to/folder", { 21 | indexFile: "./optionalIndex.html", // 可选的索引文件(用户在访问文件清单时加载的文件) 22 | batchSize: 50, // 一次上传的项目数量 23 | keepDeleted: false, // 是否保留之前上传中已删除的项目 24 | }); // 返回文件清单的 ID 25 | ``` 26 | 27 | 如果您想手动上传自己的文件清单, `await irys.upload(data, { tags: [{ name: "Content-type", value: "application/x.arweave-manifest+json" }] } )` 将把上传的 `data` 标识为一个文件清单交易。 28 | 29 | --- 30 | 31 | 参考资料和阅读更多内容:[Irys 文档](https://docs.irys.xyz) 32 | -------------------------------------------------------------------------------- /docs/src/zh/guides/deployment/arkb.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # arkb 6 | 7 | ## 要求 8 | 9 | 使用`arkb`进行部署时需要一个 Arweave 钱包以支付数据交易费用。 10 | 11 | ## 安装 12 | 13 | 要安装`arkb`,请运行 14 | 15 | 16 | 17 | ```console:no-line-numbers 18 | npm install -g arkb 19 | ``` 20 | 21 | 22 | 23 | 24 | ```console:no-line-numbers 25 | yarn add ar-gql 26 | ``` 27 | 28 | 29 | 30 | 31 | ## 部署 32 | 33 | 当上传文件目录或 Permaweb 应用程序时,默认情况下`arkb`将每个文件单独部署为 L1 交易,并提供使用 Irys 捆绑交易的选项。 34 | 35 | ## 静态构建 36 | 37 | Permaweb 应用程序是静态生成的,这意味着代码和内容是提前生成并存储在网络上的。 38 | 39 | 下面是一个静态网站的示例。要将其部署到 Permaweb,将`build`目录作为`deploy`标志的参数传入。 40 | 41 | ```js 42 | |- build 43 | |- index.html 44 | |- styles.css 45 | |- index.js 46 | ``` 47 | 48 | #### 默认部署 49 | 50 | 作为 L1 交易部署可能需要更长时间来确认,因为它直接上传到 Arweave 网络。 51 | 52 | ```console 53 | arkb deploy [folder] --wallet [钱包路径] 54 | ``` 55 | 56 |
57 | 58 | 59 | #### 捆绑部署 60 | 61 | 要使用 irys 进行部署,您需要为 Irys 节点提供资金。 62 | 63 | Irys node2 允许在 100kb 以下的免费交易。 64 | 65 | 您可以使用`tag-name/tag-value`语法为部署添加自定义标识标签。 66 | 67 | ```console 68 | arkb deploy [folder] --use-bundler [irys节点] --wallet [钱包路径] --tag-name [标签名称] --tag-value [标签值] 69 | ``` 70 | 71 |
72 | 73 | 74 | ## 其他命令 75 | 76 | #### 为 Irys 提供资金 77 | 78 | ```console 79 | arkb fund-bundler [金额] --use-bundler [irys节点] 80 | ``` 81 | 82 | \* 为 Irys 实例提供资金可能需要多达 30 分钟的处理时间 83 | 84 | #### 保存密钥文件 85 | 86 | ```console 87 | arkb wallet-save [钱包路径] 88 | ``` 89 | 90 | 保存密钥后,您现在可以像这样运行不带 --wallet-file 选项的命令 91 | 92 | ```console 93 | arkb deploy [目录路径] 94 | ``` 95 | 96 | #### 检查钱包余额 97 | 98 | ```console 99 | arkb balance 100 | ``` 101 | -------------------------------------------------------------------------------- /docs/src/zh/guides/deployment/irys-cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # Irys CLI (Previously Bundlr) 6 | 7 | ## 要求 8 | 9 | 部署需要一个 Arweave 钱包。如果目录的大小超过 100kb,则需要一个资助的 Irys 实例。 10 | 11 | ## 安装 12 | 13 | 要安装 Irys CLI,请运行以下命令 14 | 15 | 16 | 17 | ```console:no-line-numbers 18 | npm install -g @irys/sdk 19 | ``` 20 | 21 | 22 | 23 | 24 | ```console:no-line-numbers 25 | yarn global add @irys/sdk 26 | ``` 27 | 28 | 29 | 30 | 31 | ## 静态构建 32 | 33 | Permaweb 应用程序是静态生成的,这意味着代码和内容是预先生成并存储在网络上的。 34 | 35 | 下面是一个静态网站的示例。要将其部署到 Permaweb 上,将`build`目录作为`upload-dir`标志的参数传递进去。 36 | 37 | ```js 38 | |- build 39 | |- index.html 40 | |- styles.css 41 | |- index.js 42 | ``` 43 | 44 | ## 部署 45 | 46 | ```console 47 | irys upload-dir [文件夹路径] -w [钱包路径] --index-file [index.html] -c [货币] -h [Irys] 48 | ``` 49 | 50 |
51 | 52 | 53 | ## 其他命令 54 | 55 | #### 资助 Irys 56 | 57 | ```console 58 | irys fund [金额] -h [Irys节点] -w [钱包路径] -c [货币] 59 | ``` 60 | 61 | \* 资助 Irys 实例可能需要最多 30 分钟的处理时间 62 | 63 | #### 检查 Irys 余额 64 | 65 | ```console 66 | irys balance [钱包地址] -h [Irys节点] -c arweave 67 | ``` 68 | -------------------------------------------------------------------------------- /docs/src/zh/guides/dns-integration/server-side.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 服务器端DNS集成 5 | 6 | 所以你有一个永久网(permaweb)应用,并且它在永久网(permaweb)上,但你也有一个特定的域名,你希望用户使用该域名来访问此应用。mydomain.com,为了将你的域名连接到永久网(permaweb)应用,你有几个选择,我们将在这里展示的选项被称为服务器端重定向。重定向发生在反向代理中,以便用户在他们的浏览器中仍然停留在mydomain.com,而应用则是从永久网(permaweb)上提供服务。 7 | 8 | ::: tip 9 | 您可以使用任何反向代理来设置服务器端重定向,在本指南中,我们将使用Deno和deno.com作为一个轻量级的边缘托管服务。 10 | ::: 11 | 12 | ## 设置反向代理的所需材料使用Deno.com 13 | 14 | * 一个Deno.com帐户,在写作本文时是免费的。 15 | * 一个具有访问DNS设置的域名 16 | * 一个永久网(permaweb)应用的标识符并且已经部署在永久网(permaweb)上 17 | 18 | ## 在Deno.com上创建代理 19 | 20 | Deno Deploy是一个分布式系统,在全球有35个地区。将浏览器打开到[https://deno.com](https://deno.com),然后点击登录或注册,如果您没有帐户。 21 | 22 | 点击`新项目`,然后点击`Play` 23 | 24 | Deno Playground将允许我们在不离开浏览器的情况下创建一个代理。 25 | 26 | 复制以下代码: 27 | 28 | ```ts 29 | import { serve } from "https://deno.land/std/http/mod.ts"; 30 | 31 | const APP_ID = "你的Arweave应用标识符" 32 | 33 | const fileService = `https://arweave.net/${APP_ID}`; 34 | 35 | // 处理请求 36 | async function reqHandler(req: Request) { 37 | const path = new URL(req.url).pathname; 38 | // 代理到arweave.net 39 | return await fetch(fileService + path).then(res => { 40 | const headers = new Headers(res.headers) 41 | // 指示服务器利用边缘缓存 42 | headers.set('cache-control', 's-max-age=600, stale-while-revalidate=6000') 43 | 44 | // 返回arweave.net的响应 45 | return new Response(res.body, { 46 | status: res.status, 47 | headers 48 | }) 49 | }); 50 | } 51 | 52 | // 监听请求 53 | serve(reqHandler, { port: 8100 }); 54 | ``` 55 | 56 | 该代理服务器将接收来自mydomain.com的请求,并将请求代理到arweave.net/APP_ID,然后将响应作为mydomain.com返回。你的APP_ID是你永久网(permaweb)应用的TX_ID标识符。 57 | 58 | 点击`保存并部署` 59 | 60 | ## 连接到DNS 61 | 62 | 在项目设置中,进入域部分,然后点击添加域。 63 | 64 | 输入`mydomain.com`域名,然后根据说明修改你的DNS设置,将其指向Deno Deploy边缘网络。 65 | 66 | 可能需要几分钟才能解析到DNS,但一旦解析成功,你的应用将从mydomain.com渲染。 67 | 68 | :tada: 祝贺你已经发布了一个服务器端重定向到你的永久网(permaweb)应用。 69 | 70 | ::: warning 71 | 请注意,对应用的任何更改将生成一个新的TX_ID,您需要修改该TX_ID以将新更改发布到您的域名。 72 | ::: 73 | 74 | ## 自动化部署 75 | 76 | 如果你想要自动部署你的永久网(permaweb)应用的新版本,请查看GitHub Actions,并使用Deno Deploy GitHub Action:[https://github.com/denoland/deployctl/blob/main/action/README.md](https://github.com/denoland/deployctl/blob/main/action/README.md) 77 | 78 | 79 | ## 总结 80 | 81 | 服务器端重定向非常适合为用户提供域名系统 URL 以访问你的永久网(permaweb)应用。我们希望你在永久网(permaweb)开发之旅中找到这个指南有用! -------------------------------------------------------------------------------- /docs/src/zh/guides/dns-integration/spheron.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Spheron 5 | 6 | Spheron协议是一个去中心化平台,旨在简化现代dapps的创建。它为开发人员提供无缝体验,可以在去中心化网络上快速部署、自动扩展和个性化内容分发。 7 | 8 | Spheron使用GitHub集成来处理持续部署,并使我们能够将自定义DNS集成到任何给定的部署中。 9 | 10 | ## 设立Spheron账户所需的内容 11 | 12 | * 一个GitHub账户 13 | * 一个permaweb应用标识符并部署在permaweb上 14 | 15 | ::: tip 16 | 要使用Spheron部署Arweave应用,您需要Pro Plan,价格为每月20美元。 17 | ::: 18 | 19 | ## 认证/登录 20 | 21 | Spheron依赖于GitHub、GitLab或BitBucket repo的部署,与Vercel类似。 22 | 23 | 要登录Spheron,请转到[Spheron Aqua仪表板](https://app.spheron.network/),并选择您首选的认证方式。 24 | 25 | ## 导入repo 26 | 27 | 登录后,您将看到用户仪表板。在仪表板右上角点击"New Project"按钮导入一个repo。选择您想要的repo,并选择对Arweave进行部署的选项。 28 | 29 | ## 连接到DNS 30 | 31 | 现在您已导入项目并完成部署,请转到"Domains"选项卡。输入域名、环境,并选择将部署指向的域名。 32 | 33 | 在继续之前,系统会要求您验证已配置的记录。请在域名管理器中更新记录。更新DNS可能需要最多72小时。你会看到类似下方图片的内容: 34 | 35 | 36 | 37 | 更新完成后,您需要在Spheron中进行验证。点击"Verify"按钮,您应该一切就绪,准备就绪。现在,每当您在GitHub上部署新版本时,您的域名将更新为最新版本!🎉 38 | 39 | ::: tip 40 | 要创建完全分散化的应用程序,请确保使用[ArNS](https://ar.io/arns)或任何分散式DNS服务器。 41 | ::: 42 | 43 | ## 总结 44 | 45 | Spheron是将Permaweb应用程序部署到Arweave并将其重定向到自定义域的简单方法。通过组合持续集成和持续部署,确保开发人员在各方面都能获得顺畅的体验! -------------------------------------------------------------------------------- /docs/src/zh/guides/exm/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 执行机器 API 令牌 5 | 6 | EXM 旨在成为与加密无关,只需一个 API 令牌(也称为密钥)即可进行交互。此 API 密钥在 EXM 中大多数操作(如部署和写操作)中是必需的。 7 | 8 | ## 创建 API 令牌 9 | 10 | 要创建 API 令牌,必须执行以下步骤: 11 | 12 | - 前往[主页](https://exm.dev/)。 13 | - 选择首选的注册/登录方式。 14 | 15 | ![EXM 登录选项](~@source/images/exm-sign-in-options.png) 16 | 17 | - 在重定向到仪表板后,点击“新建令牌”。 18 | 19 | ![创建新的 API 令牌](~@source/images/exm-create-token.png) 20 | 21 | - 复制生成的令牌,并在 SDK 或 CLI 中使用它。 22 | 23 | ## 安全处理 API 令牌 24 | 25 | 该令牌是对我们帐户的标识,允许我们访问与之相关的功能。因此,确保保持此令牌的机密性以防止任何垃圾邮件和攻击对我们的功能至关重要。最佳方法是使用环境变量来实现。 26 | 27 | 有两种存储环境变量的方法: 28 | 29 | 1. 通过命令行: 30 | 31 | 在项目目录中执行以下命令: 32 | 33 | ```bash 34 | export EXM_PK= 35 | ``` 36 | 37 | 2. 通过 `dotenv` SDK: 38 | 39 | - 在命令行中运行以下命令: 40 | 41 | ```bash 42 | npm install dotenv 43 | 44 | #OR 45 | 46 | yarn add dotenv 47 | ``` 48 | - 在文件中导入库并使用变量: 49 | 50 | ```jsx 51 | import dotenv from "dotenv"; 52 | dotenv.config(); 53 | ``` 54 | 55 | 然后,可以在文件中引用此密钥作为 `process.env.EXM_PK`,而无需将其暴露或推送到版本控制系统中,例如 GitHub。 -------------------------------------------------------------------------------- /docs/src/zh/guides/exm/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 执行机 (EXM) 5 | 6 | **执行机 (EXM)** 是一个开发者平台,提供了创建和利用**基于区块链的(永久的)无服务器函数(Serverless Functions)**的能力,无需了解或访问钱包和代币等区块链技术。 7 | 8 | 这进一步实现了以无摩擦的方式创建**可组合**,**不可变**和**无信任**的应用程序。 9 | 10 | ## 在 Arweave 上的无服务器函数 11 | 12 | 无服务器函数通过中间件 EXM 存储在 Arweave 上,同时也将副本存储为缓存,以便随时提供应用程序。这些函数是有状态的(存储数据),因此,一个函数 ID 可以指向一些数据以及与该数据进行交互和更新的逻辑。 13 | 14 | EXM 处理存储和执行的过程,消除了保持专用服务器的需要,同时降低了维护成本并增加了一层模块化。 15 | 16 | 模块化还带来了组合性,可以选择和组装各种函数以创建适合我们需求的自定义应用程序。这些函数及其与之的交互都**永久存储在链上**,它们无法被篡改且可供任何人查看,使其具有**不可变性**和**无信任性**。 17 | 18 | 此外,EXM 覆盖了将数据上传到 Arweave 的成本,并使开发者的流程在加密方面具有通用性。 19 | 20 | ![在专用服务器上的函数与在区块链上的无服务器函数的对比](~@source/images/exm-serverless-functions.png) 21 | 22 | ## 背后的工作原理是什么? 23 | 24 | 用户向专用 EXM 服务器发送事务请求。借助可验证计算,执行机能够以快速和高效的方式处理用户请求,而无需使用令牌和钱包等区块链技术,同时保持去中心化的结果。EXM 然后使用更新后的状态更新其缓存层,并将数据上传到 Arweave。缓存层用作在任何时候快速提供应用程序的辅助。 25 | 26 | 此外,EXM 能够保持最小化的信任环境,因为用户可以使用惰性评估来验证合约/函数的事务和当前状态。 27 | 28 |
29 | 可验证计算的解释 30 | 31 | 可验证计算是一种利用集中式系统的优势并保证去中心化结果的计算形式。 32 | 33 | 每个无服务器函数要么具有读取某些信息状态的能力,要么具有更新某些信息状态的能力。使用可验证计算,这些状态被缓存在集中式服务器中,这可以提高性能,因为在处理过程中不需要共识,但信息始终可以被用户验证。这使得用户可以在存储在缓存层上之前“惰性评估”。 34 | 35 | ![可验证计算的解释](~@source/images/exm-verifiable-computing.png) 36 | 37 | 为了使可验证计算无缝工作,必须实施一些核心部分。 38 | 39 | - 执行者:一种处理用户事务请求并缓存在其中的软件。 40 | - 处理器:负责接收单个或多个用户的事务的集中化流水线(系统)。在接收到不同的发送的交易组块后,处理器必须使用新数据重新评估智能合约。随着交易的接收,智能合约的最新状态必须升级并保存,并对用户可访问。处理器负责对交易进行排序,通常是按时间戳排序。 41 | - 传送带:建立数据基于区块链之间桥梁的集中化系统。处理器接收到的所有交易必须发送到传送带,传送带将确保在数据基于区块链(如 Arweave)中存储这些操作的成功。 42 |
43 |
44 | 45 |
46 | 懒加载解释 47 | 48 | ![懒加载解释](~@source/images/exm-lazy-evaluation.png) 49 | 50 | 惰性评估,顾名思义,是一种在区块链上惰性评估智能合约及其当前状态的方法。智能合约本身和与之的任何交互(写操作)都存储在链上,任何用户都可以访问。 51 | 52 | 它旨在将处理的负担从节点转移给用户。用户可以选择在本地评估和解释智能合约代码及其与之的交互,以验证合约的当前状态。 53 | 54 | 这消除了节点存储链上当前状态的完整副本并就其达成共识的需求。从而分别降低了成本和提高性能。 55 | 56 | 由于每个人都可以访问相同的数据,每个人都会以相同的方式解释它,确保每个人都可以访问相同的当前信息状态。 57 |
58 |
59 | 60 | ## 使用无服务器函数的优势 61 | 62 | - 无服务器函数增加了一层模块化,可以根据各种应用程序需求进行组合。 63 | - 通过定向实施修复程序和新功能集成更容易实现。 64 | - 执行机具有用于快速提供应用程序的缓存层。 65 | - 执行机利用了集中式系统同时保证了去中心化的结果。 66 | - 执行机力求成为加密通用技术。 -------------------------------------------------------------------------------- /docs/src/zh/guides/exm/js-sdk/sdk-deploy.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 使用 Execution Machine SDK 部署无服务器函数 5 | 6 | 对于使用 JavaScript 中的 SDK 部署无服务器函数(serverless function),我们在这里创建一个脚本,告诉计算机如何将我们的函数部署到网络上。 7 | 8 |
9 | 函数逻辑示例 10 | 11 | 在安装了我们需要的包之后,我们需要一个在项目中定义函数逻辑的文件。 12 | 13 | 14 | 15 | 16 | ```js 17 | export async function handle(state, action) { 18 | state.counter++; 19 | return { state }; 20 | } 21 | ``` 22 | 23 | 24 | 25 | 26 | 定义函数的语法基于 SmartWeave 在 JavaScript 中为智能合约实现的标准。每个函数都有一个 `state`,它是一个 JSON 对象,其中存储了值,并且有 `actions` 用于与这些值进行交互。 27 | 28 | 上述函数向一个用户数组中添加名称,可以使用以下代码完成: 29 | 30 | ```js 31 | state.users.push(action.input.name); 32 | ``` 33 | 34 | 在部署函数时,我们初始化了一个空数组,命名为 `users`,它在读取和写入调用期间帮助函数来识别此状态变量(函数状态中存储的变量)。在初始化时,`state` 如下所示: 35 | 36 | ```js 37 | { users: [] } 38 | ``` 39 | 40 | 此外,在向函数写入时,我们使用名为 `name` 的键来帮助函数识别我们正在输入的值。在处理多个值时,这两个定义变得更为重要。 41 |
42 |
43 | 44 | 一旦函数逻辑被定义且 API 令牌被正确设置,如[此处](../api.md)所示,创建部署文件的步骤如下: 45 | 46 | 47 | 48 | 49 | ```js 50 | import { Exm, ContractType } from '@execution-machine/sdk'; 51 | import { readFileSync, writeFileSync } from 'fs'; 52 | 53 | // 初始化新的 EXM 实例 54 | const exm = new Exm({ token: process.env.EXM_API_TOKEN }); 55 | 56 | // 获取函数源代码 57 | const functionSource = readFileSync('function.js'); 58 | 59 | // .deploy(source, initState, contractType) 60 | const data = await exm.functions.deploy(functionSource, { users: [] }, ContractType.JS); 61 | 62 | // 将函数 ID 写入本地文件 63 | writeFileSync('./functionId.js', `export const functionId = "${data.id}"`) 64 | ``` 65 | 66 | 67 | 68 | 69 | 在部署时,我们需要传入函数逻辑、函数的初始状态和函数定义的编程语言作为参数。要进行部署,请在项目相应目录的命令行中运行以下命令: 70 | 71 | ```bash 72 | node deploy.js 73 | ``` 74 | 75 | 在部署完成后,我们会收到一些数据,其中我们将函数的 `functionId` 存储在本地文件中。正如其名称所示,`functionId` 是一个用于进一步与无服务器函数进行交互(例如读取和写入操作)的唯一标识符。 76 | 77 | 以下各节介绍了使用 EXM 函数进行读取和写入的过程。 -------------------------------------------------------------------------------- /docs/src/zh/guides/exm/js-sdk/sdk-intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 执行机器 SDK 5 | 6 | JavaScript SDK允许在JavaScript和TypeScript应用程序中使用执行机器(EXM)。要使用SDK,需要执行以下设置步骤。 7 | 8 | ## 安装 9 | 10 | 要在项目中安装EXM,可以使用`npm`或`yarn`。 11 | 12 | 13 | 14 | 15 | ```bash 16 | npm install @execution-machine/sdk 17 | ``` 18 | 19 | 20 | 21 | 22 | ```bash 23 | yarn add @execution-machine/sdk 24 | ``` 25 | 26 | 27 | 28 | 29 | ## 导入 30 | 31 | 当在项目中使用EXM时,必须按以下方式导入该包。 32 | 33 | 34 | 35 | 36 | ```js 37 | import { Exm } from '@execution-machine/sdk'; 38 | ``` 39 | 40 | 41 | 42 | ## 创建实例 43 | 44 | 在安装并导入EXM后,必须创建一个实例才能与其进行交互。 45 | 46 | 47 | 48 | 49 | ```js 50 | const exmInstance = new Exm({ token: 'MY_EXM_TOKEN' }); 51 | ``` 52 | 53 | 54 | 55 | ## 摘要 56 | 57 | 以下指南将展示如何使用EXM JS SDK部署无服务器函数以及如何与它们进行交互。 -------------------------------------------------------------------------------- /docs/src/zh/guides/exm/js-sdk/sdk-read.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 通过 Execution Machine SDK 从无服务函数中读取 5 | 6 | 有两种方法可以从 EXM(Execution Machine)无服务函数(serverless function)中读取状态。如在 [介绍](../intro.md#serverless-functions-on-arweave) 中所述,EXM 将函数存储在缓存层以便快速提供应用程序,但也将函数上传到 Arweave 以维护分散性及其相关的优势。因此,函数状态可以从 EXM 的缓存层或直接从 Arweave 中读取。 7 | 8 | 1. 从 EXM 的缓存层读取: 9 | 10 | read 调用读取作为存储在 EXM 缓存层上的最新状态。该层专为快速提供应用程序而设计。它采用乐观的方法,并在接收到事务请求后立即更新函数状态。 11 | 12 | 13 | 14 | 15 | ```js 16 | import { Exm } from '@execution-machine/sdk'; 17 | import { functionId } from './functionId.js'; 18 | 19 | // 初始化 EXM 实例 20 | const exm = new Exm({ token: process.env.EXM_API_TOKEN }); 21 | 22 | // 从缓存层读取 23 | const readResult = await exm.functions.read(functionId); 24 | console.log(readResult); 25 | ``` 26 | 27 | 28 | 29 | 30 | 2. 直接从 Arweave 中读取(评估): 31 | 32 | evaluate 调用返回成功在 Arweave 上处理的最新状态。这个最新状态是通过[惰性评估](../intro.md#how-does-it-work-in-the-background)计算得出的,它按照事件发生的顺序评估初始状态和与函数的交互,以达到最新状态。 33 | 34 | 35 | 36 | 37 | ```js 38 | import { Exm } from '@execution-machine/sdk'; 39 | import { functionId } from './functionId.js'; 40 | 41 | // 初始化 EXM 实例 42 | const exm = new Exm({ token: process.env.EXM_API_TOKEN }); 43 | 44 | // 从 Arweave 中评估 45 | const evalResult = await exm.functions.evaluate(functionId); 46 | console.log(evalResult); 47 | ``` 48 | 49 | 50 | 51 | 52 | ::: tip 53 | 仅推荐从 Arweave 中进行验证目的的读取。可以将 evaluate 调用返回的函数状态与缓存层返回的信息进行对比,以确保其真实性。在发布事务请求和在网络上进行更新之间可能存在轻微延迟。 54 | ::: -------------------------------------------------------------------------------- /docs/src/zh/guides/posting-transactions/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | 请参考“发送交易核心概念”部分附带的示例: 6 | 7 | - [arweave-js](/guides/posting-transactions/arweave-js.md) 示例 8 | - [irys.xyz](/guides/posting-transactions/irys.md) 示例 9 | - [dispatch](/guides//posting-transactions/dispatch.md) 示例 10 | - [arseeding-js](/guides//posting-transactions/arseeding-js.md) 示例 11 | -------------------------------------------------------------------------------- /docs/src/zh/guides/posting-transactions/arseeding-js.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 使用 arseeding.js 发布交易 5 | 使用 `arseeding-js` JavaScript SDK 包可以将交易发布到 Arweave 网络。 Arseeding 会自动把交易广播到网络中所有的 Arweave 节点, 确保所有 Arweave 节点的 pending pool 中能及时接收到这笔交易,提高交易被打包的速率。 6 | 7 | ## 安装 arseeding.js 8 | 要安装`arseeding.js`,运行以下命令: 9 | 10 | 11 | 12 | 13 | ```console:no-line-numbers 14 | npm install arseeding-js 15 | ``` 16 | 17 | 18 | 19 | 20 | ```console:no-line-numbers 21 | yarn add arseeding-js 22 | ``` 23 | 24 | 25 | 26 | 27 | ## 上传数据的交易 28 | 在使用 Arseeding 时,您必须提前在 [everpay](https://app.everpay.io/) 上存入余额。该余额可以使用AR代币或其他加密货币进行存入。另一个区别是,Arseeding 服务保证您的数据将到达链上。 29 | 30 | ```js:no-line-numbers 31 | const { genNodeAPI } = require('arseeding-js') 32 | 33 | const run = async () => { 34 | const instance = genNodeAPI('YOUR PRIVATE KEY') 35 | const arseedUrl = 'https://arseed.web3infra.dev' 36 | const data = Buffer.from('........') 37 | const payCurrencyTag = 'ethereum-usdc-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' // everPay 支持的 token tag (chainType-symbol-id) 38 | const options = { 39 | tags: [{ name: 'Content-Type', value: 'image/png' }] 40 | } 41 | const res = await instance.sendAndPay(arseedUrl, data, payCurrencyTag, options) 42 | console.log('res', res) 43 | } 44 | run() 45 | ``` 46 | 47 | 48 | ## 资源 49 | * 有关发布交易的所有方式的概述,请参阅操作手册中的[发布交易](../../concepts/post-transactions.md)部分。 50 | 51 | * 可以在[ Arseeding 网站](https://web3infra.dev/docs/arseeding/introduction/lightNode/)上找到完整的 Arseeding 客户端文档。 52 | 53 | * 使用 Arseeding 上传 Manifest 教程[在此处](https://web3infra.dev/docs/arseeding/sdk/arseeding-js/manifest/)。 -------------------------------------------------------------------------------- /docs/src/zh/guides/posting-transactions/dispatch.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 使用 Dispatch 发布交易 5 | Arweave 浏览器钱包具有分发交易的概念。如果交易大小不超过100KB,可以免费发布! 6 | ## 发布交易 7 | 客户端应用程序可以在不依赖任何软件包的情况下进行。只要用户启用了浏览器钱包,并且数据大小不超过100KB,发送的交易就是免费的,并且保证在网络上得到确认。 8 | 9 | ```js:no-line-numbers 10 | // 使用 arweave-js 创建交易 11 | let tx = await arweave.createTransaction({ data:"Hello World!" }) 12 | 13 | // 向交易添加一些自定义标签 14 | tx.addTag('App-Name', 'PublicSquare') 15 | tx.addTag('Content-Type', 'text/plain') 16 | tx.addTag('Version', '1.0.1') 17 | tx.addTag('Type', 'post') 18 | 19 | // 使用浏览器钱包分发()交易 20 | let result = await window.arweaveWallet.dispatch(tx); 21 | 22 | // 输出交易 ID 23 | console.log(result.id); 24 | ``` 25 | 26 | ## 资源 27 | * 有关发送交易的所有方法概述,请参阅[发布交易](../../concepts/post-transactions.md)相关部分的参考手册。 -------------------------------------------------------------------------------- /docs/src/zh/guides/posting-transactions/irys.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # 使用 irys.xyz 发布交易 6 | 7 | 使用`irys.xyz/sdk` JavaScript 软件包可以将交易发布到 irys.xyz。捆绑服务可以通过交易捆绑在每个区块中支持数千个交易,并确保发布的交易获得确认。 8 | 9 | ## 安装 irys.xyz/sdk 10 | 11 | 要安装`irys.xyz/sdk`,运行以下命令: 12 | 13 | 14 | 15 | 16 | ```console:no-line-numbers 17 | npm install @irys/sdk 18 | ``` 19 | 20 | 21 | 22 | 23 | ```console:no-line-numbers 24 | yarn add @irys/sdk 25 | ``` 26 | 27 | 28 | 29 | 30 | ## 初始化 Irys 网络客户端 31 | 32 | 使用 Irys 进行 Layer 1 和捆绑 Layer 2 交易的区别之一是,在使用 Irys 时,您必须提前在 Irys 节点上存入保证金。该保证金可以使用 AR 代币或其他加密货币进行存入。另一个区别是,Irys 服务保证您的数据将到达链上。 33 | 34 | ```js:no-line-numbers 35 | import Irys from '@irys/sdk'; 36 | import fs from "fs"; 37 | 38 | // 从磁盘加载JWK钱包密钥文件 39 | let key = JSON.parse(fs.readFileSync("walletFile.txt").toString()); 40 | 41 | // 初始化IrysSDK 42 | const irys = new Irys({ "http://node1.iryz.xyz", "arweave", key }); 43 | ``` 44 | 45 | ## 发布捆绑交易 46 | 47 | ```js:no-line-numbers 48 | // 从磁盘加载数据 49 | const imageData = fs.readFileSync(`images/myImage.png`); 50 | 51 | // 添加一个自定义标签,告诉网关如何向浏览器提供此数据 52 | const tags = [ 53 | {name: "Content-Type", value: "image/png"}, 54 | ]; 55 | 56 | // 创建捆绑交易并对其进行签名 57 | const tx = irys.createTransaction(imageData, { tags }); 58 | await tx.sign(); 59 | 60 | // 将交易上传到Irys以便包含在要发布的捆绑包中 61 | await tx.upload(); 62 | ``` 63 | 64 | ## 资源 65 | 66 | - 有关发布交易的所有方式的概述,请参阅操作手册中的[发布交易](../../concepts/post-transactions.md)部分。 67 | 68 | - 可以在[irys.xyz 网站](https://docs.irys.xyz/)上找到完整的 Irys 客户端文档。 69 | 70 | - 使用 Irys 上传 NFT 合集的教程和工作坊[在此处](http://docs.irys.xyz/hands-on/tutorials/uploading-nfts)。 71 | -------------------------------------------------------------------------------- /docs/src/zh/guides/querying-arweave/ar-gql.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # ar-gql 5 | 这个软件包是在GraphQL之上的一个最小层,它支持带有参数的查询和查询变量。它还实现了分页结果的管理。 6 | 7 | ## 安装 8 | 9 | 要安装`ar-gql`,运行以下命令 10 | 11 | 12 | 13 | ```console:no-line-numbers 14 | npm i ar-gql 15 | ``` 16 | 17 | 18 | 19 | ```console:no-line-numbers 20 | yarn add ar-gql 21 | ``` 22 | 23 | 24 | 25 | ## 示例 26 | ```js:no-line-numbers 27 | import { arGql } from "ar-gql" 28 | 29 | const argql = arGql() 30 | 31 | (async () => { 32 | let results = await argql.run(`query( $count: Int ){ 33 | transactions( 34 | first: $count, 35 | tags: [ 36 | { 37 | name: "App-Name", 38 | values: ["PublicSquare"] 39 | }, 40 | { 41 | name: "Content-Type", 42 | values: ["text/plain"] 43 | }, 44 | ] 45 | ) { 46 | edges { 47 | node { 48 | id 49 | owner { 50 | address 51 | } 52 | data { 53 | size 54 | } 55 | block { 56 | height 57 | timestamp 58 | } 59 | tags { 60 | name, 61 | value 62 | } 63 | } 64 | } 65 | } 66 | }`, {count: 1}); 67 | console.log(results); 68 | })(); 69 | ``` 70 | 71 | ## 资源 72 | * [ar-gql的GitHub页面](https://github.com/johnletey/arGql) -------------------------------------------------------------------------------- /docs/src/zh/guides/querying-arweave/ardb.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # ArDB 5 | 一个构建在 GraphQL 之上的库,可以从 arweave 查询交易和区块数据,而无需记住 GraphQL 参数名称。只需在您喜欢的代码编辑器中使用自动完成构建查询。 6 | 7 | ## 安装 8 | ```console:no-line-numbers 9 | yarn add ardb 10 | ``` 11 | 12 | ## 示例 13 | ```js:no-line-numbers 14 | import Arweave from 'arweave'; 15 | import ArDB from 'ardb'; 16 | 17 | // 初始化arweave实例 18 | const arweave = Arweave.init({}); 19 | 20 | // arweave是Arweave客户端实例 21 | const ardb = new ArDB(arweave); 22 | 23 | // 通过id获取单个交易 24 | const tx = await ardb.search('transaction') 25 | .id('A235HBk5p4nEWfjBEGsAo56kYsmq7mCCyc5UZq5sgjY') 26 | .findOne(); 27 | 28 | // 获取一个交易数组,并且只包含第一个结果 29 | const txs = await ardb.search('transactions') 30 | .appName('SmartWeaveAction') 31 | .findOne(); 32 | 33 | // 这与以下操作相同: 34 | const txs = await ardb.search('transactions') 35 | .tag('App-Name', 'SmartWeaveAction') 36 | .limit(1) 37 | .find(); 38 | 39 | // 搜索来自特定所有者/钱包地址的多个交易 40 | const txs = await ardb.search('transactions') 41 | .from('BPr7vrFduuQqqVMu_tftxsScTKUq9ke0rx4q5C9ieQU') 42 | .find(); 43 | 44 | // 使用以下方式继续翻页... 45 | const newTxs = await ardb.next(); 46 | 47 | // 或者可以通过以下方式一次获取所有结果: 48 | const txs = await ardb.search('blocks') 49 | .id('BkJ_h-GGIwfek-cJd-RaJrOXezAc0PmklItzzCLIF_aSk36FEjpOBuBDS27D2K_T') 50 | .findAll(); 51 | ``` 52 | 53 | ## 资源 54 | * [ArDB NPM包](https://www.npmjs.com/package/ardb) -------------------------------------------------------------------------------- /docs/src/zh/guides/smartweave/warp/evolve.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Warp (SmartWeave) SDK - Evolve 5 | 6 | **演进**(Evolve)是一种功能,允许开发人员更新智能合约的源代码,而无需部署新合约。要使用此功能,您必须首先使用保存函数提交新的源代码。一旦更新的代码在永久网络上得到确认,您可以使用演进函数将合约指向新的源代码标识符。这样就可以更新合约的行为,而无需创建新的合约实例。 7 | 8 | ## 为什么要使用演进功能? 9 | 10 | 编写SmartWeave合约可能很困难,并且有时需要随着时间的推移添加更新或新功能。演进功能允许您对合约进行更改,而无需从头开始创建新的合约实例。要使用此功能,您的合约状态对象必须包含一个evolve属性,该属性设置为新合约源交易标识符。这使您可以修改和改进现有合约,而无需从头开始。 11 | 12 | ```json 13 | { 14 | ... 15 | "evolve": "YOUR SOURCE CODE TX_ID" 16 | } 17 | ``` 18 | 19 | ## 将您的新源代码发布到永久网络(Permaweb) 20 | 21 | 在对现有合约进行演进之前,您需要将新的源代码发布到永久网络(Permaweb),您可以使用“save”功能来完成此操作。 22 | 23 | ```ts 24 | import { WarpFactory } from 'warp-contracts' 25 | import fs from 'fs' 26 | 27 | const src = fs.readFileSync('./dist/contract.js', 'utf-8') 28 | const jwk = JSON.parse(fs.readFileSync('./wallet.json', 'utf-8')) 29 | const TX_ID = 'VFr3Bk-uM-motpNNkkFg4lNW1BMmSfzqsVO551Ho4hA' 30 | const warp = WarpFactory.forMainnet() 31 | 32 | async function main() { 33 | const newSrcTxId = await warp.contract(TX_ID).connect(jwk).save({src }) 34 | console.log('NEW SRC ID', newSrcTxId) 35 | } 36 | 37 | main() 38 | ``` 39 | 40 | ## 对合约进行演进 41 | 42 | ::: warning 43 | **验证**您的新源TX_ID是否已确认,请访问[Sonar](https://sonar.warp.cc)以确保TX_ID已确认。 44 | ::: 45 | 46 | ```ts 47 | import { WarpFactory } from 'warp-contracts' 48 | import fs from 'fs' 49 | 50 | const src = fs.readFileSync('./dist/contract.js', 'utf-8') 51 | const jwk = JSON.parse(fs.readFileSync('./wallet.json', 'utf-8')) 52 | const TX_ID = 'VFr3Bk-uM-motpNNkkFg4lNW1BMmSfzqsVO551Ho4hA' 53 | const warp = WarpFactory.forMainnet() 54 | 55 | async function main() { 56 | const newSrcTxId = await warp.contract(TX_ID).connect(jwk).evolve('SRC TX ID') 57 | console.log(result) 58 | } 59 | 60 | main() 61 | ``` 62 | 63 | ::: tip 64 | 值得注意的是,演进功能只适用于未来的操作,这意味着您不能将新源代码应用于合约演进之前发生的操作。 65 | ::: 66 | 67 | ## 总结 68 | 69 | 演进是一种强大的功能,可以为您的合约提供可扩展性,但也可以成为一种**攻击**向量,因此在使用时确保您充分了解自己在做什么。以下是一个在您的合约中可能会用到的演进函数的常见代码片段。 70 | 71 | ```js 72 | export async function handle(state, action) { 73 | ... 74 | if (action.input.function === 'evolve') { 75 | if (action.caller === state.creator) { 76 | state.evolve = action.input.value 77 | } 78 | return { state } 79 | } 80 | ... 81 | } 82 | ``` -------------------------------------------------------------------------------- /docs/src/zh/guides/smartweave/warp/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 5 | # Warp (SmartWeave) SDK 介绍 6 | 7 | Warp 是一个流行的 SmartWeave Protocol SDK。使用 Warp 和 Irys,您的 SmartWeave 部署和交互可以非常快速。 8 | 9 | ## 介绍 10 | 11 | 本指南是 Warp SDK 及其某些 API 方法的简短介绍。如果您想了解有关 SmartWeave 合同的更多信息,请访问[核心概念:SmartWeave](/concepts/smartweave.html)。 12 | 13 | ::: 提示 14 | 您可以在[github](https://github.com/warp-contracts)上找到 Warp SDK。如果要深入了解 Warp SmartWeave,请访问[Warp 网站](https://warp.cc)。 15 | ::: 16 | 17 | 在服务器上使用 SDK,您将需要访问 wallet.json 文件;在浏览器中使用 SDK,您将需要连接到一个支持 arweave 的钱包。 18 | 19 | ## 安装 20 | 21 | 要在您的项目中安装 warp,您可以使用`npm`或`yarn`或其他 npm 客户端。 22 | 23 | 24 | 25 | 26 | ```console 27 | npm install warp-contracts 28 | ``` 29 | 30 | 31 | 32 | 33 | ```console 34 | yarn add warp-contracts 35 | ``` 36 | 37 | 38 | 39 | 40 | ## 导入 41 | 42 | 在使用 Warp 与您的项目时,根据您的项目设置,有多种导入 sdk 的方式可供选择。 43 | 44 | 45 | 46 | 47 | ```ts 48 | import { WarpFactory } from "warp-contracts"; 49 | ``` 50 | 51 | 52 | 53 | 54 | ```js 55 | import { WarpFactory } from "warp-contracts/mjs"; 56 | ``` 57 | 58 | 59 | 60 | 61 | ```js 62 | const { WarpFactory } = require("warp-contracts"); 63 | ``` 64 | 65 | 66 | 67 | 68 | ## 连接到环境 69 | 70 | 有几个不同的环境可以进行交互,您可以使用`forXXXX`辅助函数连接到这些环境。 71 | 72 | 73 | 74 | 75 | ```ts 76 | const warp = WarpFactory.forMainnet(); 77 | ``` 78 | 79 | 80 | 81 | 82 | ```js 83 | const warp = WarpFactory.forTestnet(); 84 | ``` 85 | 86 | 87 | 88 | 89 | ```js 90 | const warp = WarpFactory.forLocal(); 91 | ``` 92 | 93 | 94 | 95 | 96 | ```js 97 | const warp = WarpFactory.custom( 98 | arweave, // arweave-js 99 | cacheOptions, // { ...defaultCacheOptions, inMemory: true} 100 | environment, // 'local', 'testnet', 'mainnet' 101 | ); 102 | ``` 103 | 104 | 105 | 106 | 107 | ::: 警告 108 | 在使用本地环境时,需要在端口 1984 上运行 arLocal。 109 | ::: 110 | 111 | ## 摘要 112 | 113 | 本简介指南旨在帮助您设置 Warp。以下指南将向您展示如何使用 Warp SDK 部署 SmartWeave 合同,如何与这些合同进行交互,以及如何发展 SmartWeave 合同。 114 | -------------------------------------------------------------------------------- /docs/src/zh/guides/smartweave/warp/readstate.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Warp (SmartWeave) SDK - ReadState 5 | 6 | 通过延迟计算,SmartWeave合约状态是通过读取而不是写入进行计算的。在读取合约时,SDK会收集所有状态交互,并对它们进行排序,然后使用reduce或fold模式执行它们来更新源合约。 7 | 8 | ## 基本读取状态 9 | 10 | ```ts 11 | const warp = WarpFactory.forMainnet() 12 | const CONTRACT_ID = '_z0ch80z_daDUFqC9jHjfOL8nekJcok4ZRkE_UesYsk' 13 | 14 | const result = await warp.contract(CONTRACT_ID).readState() 15 | 16 | // 记录当前状态 17 | console.log(result.cachedValue.state) 18 | ``` 19 | 20 | ## 高级读取状态 21 | 22 | 有些合约要么读取其他合约的状态,要么调用或写入其他合约,当请求这些合约的状态时,需要设置评估选项。 23 | 24 | ```ts 25 | const warp = WarpFactory.forMainnet() 26 | const CONTRACT_ID = 'FMRHYgSijiUNBrFy-XqyNNXenHsCV0ThR4lGAPO4chA' 27 | 28 | const result = await warp.contract(CONTRACT_ID) 29 | .setEvaluationOptions({ 30 | internalWrites: true, 31 | allowBigInt: true 32 | }) 33 | .readState() 34 | 35 | // 记录当前状态 36 | console.log(result.cachedValue.state) 37 | ``` 38 | 39 | ### 常见的评估选项 40 | 41 | | 名称 | 描述 | 42 | | ---- | ----------- | 43 | | internalWrites | 评估包含对其他合约的内部写入的合约 | 44 | | allowBigInt | 评估使用BigInt原始数据类型的合约,可以在[MDN文档](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)中了解更多关于BigInt的信息 | 45 | | unsafeClient | 此值可以是`allow`、`skip`或者`throw`。在合约中避免使用unsafeClient,因为它可能导致不确定的结果。 | 46 | 47 | ## 根据特定的BlockHeight或Sortkey读取状态 48 | 49 | 您可能希望查看之前的状态,而不是当前状态,通过提供blockHeight,您可以读取合约在特定block height时的状态。 50 | 51 | ```ts 52 | const { sortKey, cachedValue } = await contract.readState(1090111) 53 | ``` 54 | 55 | ## 总结 56 | 57 | 通过拉取所有交互并通过 fold 方法处理每个交互,读取 SmartWeave 合约的当前状态可以执行状态评估。这种方法是 permaweb 独有的,需要对您的 SmartWeave 合约代码执行方式有独特的理解。 -------------------------------------------------------------------------------- /docs/src/zh/guides/smartweave/warp/write-interactions.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Warp WriteInteractions 5 | 6 | 要调用 SmartWeave 合约上的函数,您可以创建一个称为 SmartWeave 操作的交易。此操作包括 SmartWeave 合约上函数的函数名称和必要的输入参数。您可以使用 Contract.writeInteraction 函数创建 SmartWeave 操作。 7 | 8 | ## 代码 9 | 10 | ```ts 11 | import { WarpFactory } from 'warp-contracts' 12 | 13 | const warp = WarpFactory.forMainnet() 14 | const STAMP_PROTOCOL = 'FMRHYgSijiUNBrFy-XqyNNXenHsCV0ThR4lGAPO4chA' 15 | 16 | async function doStamp() { 17 | const result = await warp.contract(STAMP_PROTOCOL) 18 | .connect('use_wallet') 19 | .writeInteraction({ 20 | function: 'stamp', 21 | timestamp: Date.now(), 22 | transactionId: 'zQhANphTO0DOsaWXhExylUD5cBN3a6xWvfn5ZCpmCVY' 23 | }) 24 | console.log(result) 25 | } 26 | ``` 27 | 28 | 在调用 writeInteraction 时,你需要传递输入参数。这些参数是合约期望接收的参数。 29 | 30 | ::: warning 31 | 由于SmartWeave合约在惰性流中进行评估,你在评估合约到当前状态之前无法知道你的操作是否成功执行。使用[Warp readState](./readstate.md)来访问合约并确定操作是否成功应用。 32 | ::: 33 | 34 | ## 模拟写入 35 | 36 | `DryWrite`允许您在当前状态上测试和验证一个交互,而不必在永久网络(permaweb)上执行它。这个功能允许您在本地模拟交互并确保它在应用之前会成功。 37 | 38 | ```ts 39 | import { WarpFactory } from 'warp-contracts' 40 | 41 | const warp = WarpFactory.forMainnet() 42 | const STAMP_PROTOCOL = 'FMRHYgSijiUNBrFy-XqyNNXenHsCV0ThR4lGAPO4chA' 43 | 44 | async function doStamp() { 45 | const result = await warp.contract(STAMP_PROTOCOL) 46 | .connect('use_wallet') 47 | .dryWrite({ 48 | function: 'stamp', 49 | timestamp: Date.now(), 50 | transactionId: 'zQhANphTO0DOsaWXhExylUD5cBN3a6xWvfn5ZCpmCVY' 51 | }) 52 | console.log(result) 53 | } 54 | ``` 55 | 56 | ::: warning 57 | 在使用模拟写入时需要注意的一点是,对于使用 readState 或 internalWrites 的合约,需要在本地评估整个状态。这可能会导致执行速度较慢。 58 | ::: 59 | 60 | ## 速度优化 61 | 62 | 默认情况下,writeInteractions会被提交到Warp Sequencer并捆绑并发布到Arweave。您可以通过禁用捆绑直接发布到Arweave。 63 | 64 | ```ts 65 | const result = await contract.writeInteraction({ 66 | function: 'YOUR_FUNCTION_NAME', 67 | ... 68 | }, { disableBundling: true }) 69 | ``` 70 | 71 | ## 摘要 72 | 73 | SmartWeave协议允许使用writeInteractions在一个不可变的、仅追加的存储系统上修改动态数据。这些交互使得与SmartWeave合约进行无信任和无权限的通信成为可能。Warp SDK为开发人员提供了一个用户友好的API,用于与SmartWeave协议和其writeInteractions功能进行交互。 74 | 75 | 获取额外资源: 76 | 77 | * Warp SDK [https://github.com/warp-contracts/warp](https://github.com/warp-contracts/warp) 78 | * Warp文档 [https://warp.cc](https://warp.cc) -------------------------------------------------------------------------------- /docs/src/zh/guides/using-vue.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | 在Markdown中使用Vue 5 | 6 | ## 浏览器API访问限制 7 | 8 | 由于VuePress应用程序在生成静态构建时在Node.js中进行服务器渲染,因此任何Vue使用都必须符合[通用代码要求](https://ssr.vuejs.org/en/universal.html)。简而言之,请确保只在`beforeMount`或`mounted`钩子中访问浏览器/DOM API。 9 | 10 | 如果您使用或演示的组件不符合服务器端渲染要求(例如包含自定义指令),您可以将它们包装在内置的``组件中: -------------------------------------------------------------------------------- /docs/src/zh/guides/vouch.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Vouch 5 | 有几种查询 Arweave 地址以验证是否已由服务认证的方式。以下是其中两种方法。 6 | ## VouchDAO 包 7 | `isVouched` 函数可直接在应用程序中使用。 8 | 9 | #### 安装 10 | 使用 npm 添加包: 11 | ```console:no-line-numbers 12 | npm i vouchdao 13 | ``` 14 | 或者使用 yarn: 15 | ```console:no-line-numbers 16 | yarn add vouchdao 17 | ``` 18 | 19 | #### 使用 20 | 在异步函数中,您可以使用 `isVouched` 函数,如果用户已经获得认证,它将返回 true。 21 | 22 | ```js:no-line-numbers 23 | import { isVouched } from 'vouchdao' 24 | (async () => { 25 | const res = await isVouched("ARWEAVE_ADDRESS") // true || undefined 26 | // ... 27 | })(); 28 | ``` 29 | 30 | ## 使用 GraphQL 31 | 您可以使用 GraphQL 查询 Arweave 网络,以了解给定的 Arweave 地址是否已获得认证。 32 | 33 | ```graphql 34 | query { 35 | transactions( 36 | tags:{name:"Vouch-For", values:["ARWEAVE_ADDRESS"]} 37 | ) { 38 | edges { 39 | node { 40 | id 41 | tags { 42 | name 43 | value 44 | } 45 | } 46 | } 47 | } 48 | } 49 | ``` 50 | 51 | 如果地址已获得认证,将返回一组与发布 ANS-109 的服务相关的节点标签。您可以将 “owner address” 的值与通过 VouchDAO 的社区投票中的[社区投票](https://community.xyz/#_z0ch80z_daDUFqC9jHjfOL8nekJcok4ZRkE_UesYsk/votes)进行交叉参考,以确保该服务已通过社区投票验证。 52 | 53 | ```graphql 54 | "owner": { 55 | "address": "Ax_uXyLQBPZSQ15movzv9-O1mDo30khslqN64qD27Z8" 56 | }, 57 | "tags": [ 58 | { 59 | "name": "Content-Type", 60 | "value": "application/json" 61 | }, 62 | { 63 | "name": "App-Name", 64 | "value": "Vouch" 65 | }, 66 | { 67 | "name": "App-Version", 68 | "value": "0.1" 69 | }, 70 | { 71 | "name": "Verification-Method", 72 | "value": "Twitter" 73 | }, 74 | { 75 | "name": "Vouch-For", 76 | "value": "ARWEAVE_ADDRESS" 77 | } 78 | ] 79 | ``` 80 | 81 | ## 资源 82 | * [VouchDAO](https://vouch-dao.arweave.dev) 83 | * [VouchDAO 合约](https://sonar.warp.cc/?#/app/contract/_z0ch80z_daDUFqC9jHjfOL8nekJcok4ZRkE_UesYsk) 84 | * [Arweave/GraphQL Playground](https://arweave.net/graphql) -------------------------------------------------------------------------------- /docs/src/zh/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | onboarding: true 4 | --- 5 | 6 | # 在Permaweb上烹饪 7 | 8 | Permaweb Cookbook 是一个开发者资源,提供了在Permaweb上构建应用程序的基本概念和参考资料。每个概念和参考都将专注于Permaweb开发生态系统的特定方面,并提供额外的详细信息和使用示例。 9 | 10 | ## 开发者 11 | 12 | 欢迎来到Arweave开发社区,在这里过去会永远镌刻在区块链上,未来充满无限可能。让我们一起建设去中心化的Web! 13 | 14 | [了解更多](getting-started/welcome.md) 15 | 16 | ## 贡献 17 | 18 | Cookbook的设计方式使得新的Permaweb开发者能够轻松贡献。即使你不知道如何做某事,贡献到Cookbook是学习的好途径! 19 | 20 | 点击此处查看所有开放的问题。 点击此处获取贡献指南。如果你发现Cookbook缺少某个概念、指南或参考,请添加一个问题。 21 | 22 | [了解更多](getting-started/contributing.md) 23 | 24 | ## 如何阅读Cookbook 25 | 26 | Permaweb Cookbook分为不同的部分,每个部分都针对不同的目标。 27 | 28 | | 部分 | 描述 | 29 | | ------------- | ----------------------------------------------------------------------------------- | 30 | | 核心概念 | Permaweb的基本构建模块,开发时需要了解的内容 | 31 | | 指南 | 关于开发不同工具的简洁指南 | 32 | | 参考 | 常用代码片段的参考 | 33 | | 入门套件 | 前端框架入门套件,让您快速开始在Permaweb上构建应用程序 | 34 | 35 | ## 快速入门 36 | 37 | 这些是一些小指南,帮助开发者从各个经验水平开始在Permaweb上发布代码。 38 | 39 | - [Hello World(无代码)](getting-started/quick-starts/hw-no-code.md) 40 | -------------------------------------------------------------------------------- /docs/src/zh/kits/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 入门套件 5 | 6 | 入门套件是针对特定框架配置好并准备好进行构建的示例代码库,可用于搭建永久网络。 7 | 8 | - [Svelte](./svelte/index.md) 9 | - [React](./react/index.md) 10 | - [Vue](./vue/index.md) -------------------------------------------------------------------------------- /docs/src/zh/kits/react/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # React 入门套件 5 | 6 | React 是一种常用的库,用于构建用户界面。除了其他常用工具如 create-react-app 之外,React 项目可以被编译成一个捆绑包(bundle)。这个捆绑包可以作为一个事务上传到永久网(Permaweb)中,作为单页应用程序提供服务。 7 | 8 | React 入门套件指南: 9 | 10 | * [Vite](./vite.md) - 使用 Vite 构建 React 永久网应用 11 | * [Create React App](./create-react-app.md) - 使用 Create React App 构建 React 永久网应用 12 | 13 | ::: info 永久网应用限制条件 14 | * 100% 前端应用程序(无后端服务器) 15 | * 应用程序从子路径(https://[gateway]/[TX_ID])提供服务 16 | ::: 17 | -------------------------------------------------------------------------------- /docs/src/zh/kits/svelte/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Svelte起始套件 5 | 6 | Svelte是一个编译成JavaScript捆绑包的框架,同时从应用程序的分发中删除了该框架。这将使它比其他框架占用的空间更小。Svelte是PermaWeb应用程序的完美框架。PermaWeb应用程序是建立在单页应用程序原则的基础上,但是他们存在Arweave网络上并由PermaWeb网关分发。 7 | 8 | Svelte起始套件指南: 9 | 10 | * [Minimal](./minimal.md) - 构建Svelte PermaWeb应用程序所需的最低要求 11 | * [Vite](./vite.md) - Svelte,Typescript和Vite 12 | 13 | ::: info PermaWeb应用程序限制条件 14 | * 100%前端应用程序(无服务器后端) 15 | * 应用程序从子路径提供服务(https://[gateway]/[TX_ID]) 16 | ::: 17 | -------------------------------------------------------------------------------- /docs/src/zh/kits/vue/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # Vue 起始套件 5 | 6 | Vue.js 是一个渐进式的 JavaScript 框架,可用于构建用户界面。与其他框架不同,它在运行时将模板编译成 JavaScript,从而生成更小的文件大小和更快的性能。Vue 非常适合构建高效且可扩展的单页面应用程序,因此成为前端开发人员的热门选择。 7 | 8 | Vue 起始套件指南: 9 | 10 | **注意:**- 因为 `npm init vue@latest` 已经使用了 vite,所以我们沒有为 Vue 包含 vite 的指南。 11 | 12 | - [创建 Vue 应用](./create-vue.md) - 使用 Create Vue 高效地构建一个基于 TypeScript 和 Vite 永久网应用程序 13 | 14 | ::: info 永久网应用限制 15 | 16 | - 100% 前前端用程序(无服务后端) 17 | - 应用程序从子路径提供服务(https://[gateway]/[TX_ID]) 18 | ::: 19 | -------------------------------------------------------------------------------- /docs/src/zh/references/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | locale: zh 3 | --- 4 | # 参考资料 5 | 6 | [1] Arweave Whitepaper: [link](https://arweave.org/whitepaper.pdf) 7 | 8 | [2] "Understanding Blockchain Technology: A Comprehensive Introduction" by Nakamoto S., 2019 9 | 10 | [3] "Blockchain Basics: A Non-Technical Introduction in 25 Steps" by Engels P., 2018 11 | 12 | [4] "Mastering Blockchain: Unlocking the Power of Cryptocurrencies, Smart Contracts, and Decentralized Applications" by Antonopoulos A., 2017 13 | 14 | [5] "Introduction to Cryptography and its Applications in Blockchain Technology" by Lee H., 2020 15 | 16 | [6] "Blockchain Revolution: How the Technology Behind Bitcoin Is Changing Money, Business, and the World" by Tapscott D. and Tapscott A., 2016 17 | 18 | [7] "The Age of Cryptocurrency: How Bitcoin and Digital Money Are Challenging the Global Economic Order" by Vigna P. and Casey M.J., 2015 19 | 20 | [8] "Blockchain: Blueprint for a New Economy" by Swan M., 2015 21 | 22 | [9] "Bitcoin and Cryptocurrency Technologies: A Comprehensive Introduction" by Narayanan A., Bonneau J., Felten E., Miller A. and Goldfeder S., 2016 23 | 24 | [10] Wang, X. (2021). "Blockchain and Arweave: A Comparative Study". *Journal of Blockchain Studies*, 8(2), 45-62. --------------------------------------------------------------------------------