#link-shortener #gear #deployment #url #deno #io #script

gurls

Gear URL 短链接生成器 (GURLS)

3 个版本

0.0.2 2024年1月21日
0.0.1 2023年12月4日
0.0.0 2022年11月13日

#1530 in 神奇豆子

每月 24 次下载

MITGPL-3.0 许可证

25KB
529

Gitpod

Gear URL 短链接生成器 (GURLS)

基于Deno Deploy和Gear构建的URL短链接生成器,灵感来自 goo.glgit.ioyaus

在线演示

访问其中一个链接以查看实时版本

部署

在继续之前,请确保已安装 gityarnrustupdenonodejq

$ git clone https://github.com/btwiuse/gurls && cd gurls
$ make init
...
$ make deploy
...
Deploying program...
CodeID already exists, skipping upload...
{
  codeId: "0x83239c38c37f77a1943c7ac4d44ab5f09fae588c50ca6c602b1c7a93763b9fc8",
  programId: "0x648df8e155670708c61327f0d9e0aefdea21c257acd5638d6a9a3d31e127ef3d"
}
Posting metadata...
{
  name: "github.com/btwiuse/gurls",
  meta: '{"types":"0x180010146775726c7314636f64656318616374696f6e18416374696f6e0001041841646455726c080110636f...',
  title: "github.com/btwiuse/gurls",
  metaWasm: "AGFzbQEAAAABTw1gAX8AYAF/AX9gAAF/YAN/f38Bf2AAAGADf39/AGACf38Bf2ACf38AYAR/f39/AGAEf39/fwF/YAV/f39/fwBg...",
  signature: "0x2e778426cd1ff638eba215ee6f210828bb7703cd320a45dd80b04f7bb3c7681a6a7d99f45b90d2cce58f887a93551b9439...",
  programId: "0x648df8e155670708c61327f0d9e0aefdea21c257acd5638d6a9a3d31e127ef3d",
  genesis: "0xd144f24baf0b991be22ea8dc7dd4540d9d1e971e6bf17b1770b9fc9c88272484"
}
Program deloyed: https://idea.gear-tech.io/programs/0x648df8e155670708c61327f0d9e0aefdea21c257acd5638d6a9a3d31e127ef3d?node=wss://rpc-node.gear-tech.io

目录布局

.
├── Makefile               // Make targets: build, deploy, publish, clean, ...
├── script/                // Utility scripts
├── dist/                  // Artifacts to be published at https://unpkg.com/browse/gurls/dist/

├── lib.rs                 // Gear contract
├── build.rs               // Custom build script
├── Cargo.toml             // Cargo crate config
├── rust-toolchain         // Rust toolchain config
├── target/                // Cargo build cache

├── gurls.ts               // Browser script
├── esbuild.config.mjs     // Esbuild bundler config
├── package.json           // Npm package config
├── node_modules/          // Node module cache

└── README.md              // This file

目标

在本研讨会中,您将学习如何

  • 实现基本的合约逻辑
  • 使用 Gear Idea 部署您的合约
  • 使用 @gear-js/api
    • 与已发布的合约交互
      • 读取(获取程序状态)
      • 写入(发送消息)
    • 从前端和后端
      • 浏览器
      • nodejs
      • deno

参考资料

依赖

~5.5–9MB
~150K SLoC