diff --git a/docs/SolanaAction/001.md b/docs/SolanaAction/001.md index 249c512..345780c 100644 --- a/docs/SolanaAction/001.md +++ b/docs/SolanaAction/001.md @@ -545,11 +545,11 @@ export const GET = async (req: Request) => { }; ``` -这样的代码就可以按照规范显示出3个发送SOL的按钮,同时还会显示一个输入框,让用户可以自己定制发送SOL的数额 +这样的代码就可以按照规范显示出 3 个发送 SOL 的按钮,同时还会显示一个输入框,让用户可以自己定制发送 SOL 的数额 -[捐款action的完整代码在这里](https://github.com/Fankouzu/solana-action/blob/main/src/app/api/actions/donate/route.ts) +[捐款 action 的完整代码在这里](https://github.com/Fankouzu/solana-action/blob/main/src/app/api/actions/donate/route.ts) -修改好代码之后提交GitHub +修改好代码之后提交 GitHub ```sh git add . @@ -557,35 +557,30 @@ git commit -m "add donate" git push ``` -提交代码后vercel会自动部署前端,稍微等待几秒钟,修改就会在前端生效,这是你就拥有了一个新的捐款的Solana action链接: +提交代码后 vercel 会自动部署前端,稍微等待几秒钟,修改就会在前端生效,这是你就拥有了一个新的捐款的 Solana action 链接: -将链接提交到创建捐款的Blink +将链接提交到创建捐款的 Blink ![blink-donate](/blink-donate.png) -## 6.使用模版定制自己的 +## 6.使用模版一键部署 Solana Action -1. 打开[我的GitHub仓库](https://github.com/Fankouzu/solana-action/tree/main/cloudflare-workers-template),Fork到自己的GitHub,然后点击模版部署按钮 +1. 注册[GitHub](https://github.com/)和[Vercel](https://vercel.com/) -![cloudflare-apikey](/cloudflare-apikey1.png) +2. 打开[我的 GitHub 仓库](https://github.com/Fankouzu/solana-action) 点击 README 中的 Deploy 按钮 + ![deploy-action-button](/deploy-action-button.png) +3. 页面这是跳转到了 Vercel,在这里首先选择一个仓库名称,这个名称不影响运行,只要和自己的其它仓库名不重复即可,默认仓库名称为:my-blink-donate-action,不修改也可以,然后点击 Create 按钮 + ![deploy-action-repo-name](/deploy-action-repo-name.png) +4. 创建仓库之后接下来需要设置环境变量,这里包括收款地址,金额,卡片标题简介头像,设置好之后点击 Deploy 按钮 + ![deploy-action-config](/deploy-action-config.png) +5. 然后 Vercel 将自动运行部署,等待几分钟 -2. 在打开的页面中链接GitHub,之后需要输入用户id和api token - -![cloudflare-apikey2](/cloudflare-apikey2.png) - -3. 用户id在这里复制 - -![cloudflare-apikey2](/cloudflare-apikey3.png) - -4. api token[在这个地址](https://dash.cloudflare.com/profile/api-tokens)创建,创建时选择通过模版创建Edit Cloudflare Workers,创建时Account选择all,zone选择all - -![cloudflare-apikey4](/cloudflare-apikey4.png) - -5. 有了用户id和api token之后粘贴继续下一步,点击部署 - -![cloudflare-apikey5](/cloudflare-apikey5.png) - -6. 部署完成后,在cloudflareworks & pages页面中选择对应的works,然后点击右上角的访问按钮 - -![cloudflare-apikey6](/cloudflare-apikey6.png) + - 部署中 + ![deploy-action-deploying](/deploy-action-deploying.png) + - 部署成功 + ![deploy-action-finnish](/deploy-action-finnish.png) +6. 部署成功后,访问 `https://<你的仓库名>.vercel.com/api/actions/donate` 看到 json 返回结果就代表部署正确,并且核对你输入的环境变量 + - [演示地址](https://my-blink-donate-action.vercel.app/api/actions/donate) +7. 访问`https://dial.to/?action=solana-action%3Ahttps%3A%2F%2F<你的仓库名>.vercel.app%2Fapi%2Factions%2Fdonate` 可以看到你的 Blink 链接 + - [演示地址](https://dial.to/?action=solana-action:https://my-blink-donate-action.vercel.app/api/actions/donate) diff --git a/docs/public/cloudflare-apikey1.png b/docs/public/cloudflare-apikey1.png deleted file mode 100644 index fc0f5a5..0000000 Binary files a/docs/public/cloudflare-apikey1.png and /dev/null differ diff --git a/docs/public/cloudflare-apikey2.png b/docs/public/cloudflare-apikey2.png deleted file mode 100644 index 8a19a44..0000000 Binary files a/docs/public/cloudflare-apikey2.png and /dev/null differ diff --git a/docs/public/cloudflare-apikey3.png b/docs/public/cloudflare-apikey3.png deleted file mode 100644 index af1f08c..0000000 Binary files a/docs/public/cloudflare-apikey3.png and /dev/null differ diff --git a/docs/public/cloudflare-apikey4.png b/docs/public/cloudflare-apikey4.png deleted file mode 100644 index 5954ef0..0000000 Binary files a/docs/public/cloudflare-apikey4.png and /dev/null differ diff --git a/docs/public/cloudflare-apikey5.png b/docs/public/cloudflare-apikey5.png deleted file mode 100644 index cee3bbb..0000000 Binary files a/docs/public/cloudflare-apikey5.png and /dev/null differ diff --git a/docs/public/cloudflare-apikey6.png b/docs/public/cloudflare-apikey6.png deleted file mode 100644 index c3dbf29..0000000 Binary files a/docs/public/cloudflare-apikey6.png and /dev/null differ diff --git a/docs/public/deploy-action-button.png b/docs/public/deploy-action-button.png new file mode 100644 index 0000000..d2016f8 Binary files /dev/null and b/docs/public/deploy-action-button.png differ diff --git a/docs/public/deploy-action-config.png b/docs/public/deploy-action-config.png new file mode 100644 index 0000000..e29828a Binary files /dev/null and b/docs/public/deploy-action-config.png differ diff --git a/docs/public/deploy-action-deploying.png b/docs/public/deploy-action-deploying.png new file mode 100644 index 0000000..8c70d4f Binary files /dev/null and b/docs/public/deploy-action-deploying.png differ diff --git a/docs/public/deploy-action-finnish.png b/docs/public/deploy-action-finnish.png new file mode 100644 index 0000000..484993a Binary files /dev/null and b/docs/public/deploy-action-finnish.png differ diff --git a/docs/public/deploy-action-repo-name.png b/docs/public/deploy-action-repo-name.png new file mode 100644 index 0000000..50a0086 Binary files /dev/null and b/docs/public/deploy-action-repo-name.png differ