📘
Edge Matrix Documentation
中文
中文
  • 🌐EMC Network
    • EMC 概述
    • 核心产品
      • 公链
        • 链网络信息
        • 共识机制 PoAW
        • 区块参数
        • 交易Performance
        • JSON RPC
        • 链桥
          • 链桥合约
          • 链桥工作机制
          • 支持的跨链资产对
        • Dex
      • EMC Hub
        • EMC Protocol
        • 工作方式及拓扑图
    • EMC DAO
      • DAO 架构:去中心化治理原则与流程
      • 提案与投票机制:代币持有者如何参与决策
      • 社区基金运作:资源分配与社区激励规则
    • 代币经济模型
      • 代币分配
      • 代币用途
      • 产品收入模式
    • 未来规划与发展
    • 常见问题 (FAQ)
Powered by GitBook
On this page
  • EMC Go 代理
  • 基本用法
  • 其他语言 SDK
  • Stable Diffusion AI 样例
  • 算力节点测试工具
  • 教程
  • License
  1. Openverse

EMC Go SDK

EMC Go 代理

View ./emc-go-agent/agnet_test.go to get help.

基本用法

func TestCallEdgeApi_post(t *testing.T) {
	privateKey, err := crypto.BytesToECDSAPrivateKey([]byte("03b7dfc824b0cbcfe789ec0ce4571f3460befd0490e3d0d2aad8e3c07dbcce14"))
	if err != nil {
		t.Fatalf("unable to extract private key, %v", err)
	}

	a, _ := NewDefaultAgent(
		hclog.NewNullLogger(),
		privateKey,
		rpc.NewClientWithRpcUrl(rpc.TESTNET_ID, "https://oregon.edgematrix.xyz"))

	// Sample for stable diffusion
	// Api path: /sdapi/v1/txt2img
	prompt := "white cat and dog"
	data := `{"enable_hr":false,"denoising_strength":0,"firstphase_width":0,"firstphase_height":0,"hr_scale":2,"hr_upscaler":"","hr_second_pass_steps":0,"hr_resize_x":0,"hr_resize_y":0,"prompt":"%s","styles":[""],"seed":-1,"subseed":-1,"subseed_strength":0,"seed_resize_from_h":-1,"seed_resize_from_w":-1,"sampler_name":"","batch_size":1,"n_iter":1,"steps":50,"cfg_scale":7,"width":512,"height":512,"restore_faces":false,"tiling":false,"do_not_save_samples":false,"do_not_save_grid":false,"negative_prompt":"","eta":0,"s_churn":0,"s_tmax":0,"s_tmin":0,"s_noise":1,"override_settings":{},"override_settings_restore_afterwards":true,"script_args":[],"sampler_index":"Euler","script_name":"","send_images":true,"save_images":false,"alwayson_scripts":{}}`
	info, err := a.CallEdgeApi(
		"16Uiu2HAm14xAsnJHDqnQNQ2Qqo1SapdRk9j8mBKY6mghVDP9B9u5",
		"/sdapi/v1/txt2img",
		fmt.Sprintf(data, prompt),
		METHOD_POST)
	if err != nil {
		t.Error(err)
	} else {
		t.Log("TelegramHash: ", info.TelegramHash)
		t.Log("Response: ", info.Response)
		t.Log("Err: ", info.Err)
	}
}

其他语言 SDK

Stable Diffusion AI 样例

算力节点测试工具

教程

License

Apache 2.0

Last updated 1 year ago

GitHub 仓库:

Address:

GitHub 仓库:

地址:

GitHub 仓库:

For tutorials, check

👐
https://github.com/EMCProtocol-dev/
https://6tq33-2iaaa-aaaap-qbhpa-cai.icp0.io/
https://github.com/EMCProtocol-dev/EMC-SD
https://57hlm-riaaa-aaaap-qbhfa-cai.icp0.io
https://github.com/EMCProtocol-dev/EMC-Requester
https://edgematrix.pro/start