一、Golang SDK 安装

本文是关于Golang SDK的安装指南,涵盖了Windows和Linux平台的安装步骤。在Windows上,从指定地址下载SDK并进行安装,确保编辑器环境变量设置正确,开启go modules并设置国内代理。在Linux上,下载SDK后进行安装,并配置环境变量,同样开启go modules和设置代理,最后检查go环境信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Go 全栈开发


一、Golang SDK 安装

1.windows

  1. Golang SDK 下载地址:https://go.p2hp.com/go.dev/dl/
  2. 安装SDK:

在这里插入图片描述
点击 Next 进行安装
3. 检查golang编辑器是否添加到了环境变量中,如果没有请手动添加一下。
在这里插入图片描述

  1. 检查GOPATH是否有自动维护,如果没有需要手动添加。GOPATH目录可以自己选择一个目录;GOPATH/bin目录需要添加到用户path下面。
    在这里插入图片描述

  2. 开启go modules, 执行下面命令:
    go env -w GO111MODULE=on

  3. 设置国内代理,命令执行以下命令:
    go env -w GOPROXY=https://proxy.golang.com.cn,https://goproxy.cn,direct

  4. 查看go环境信息命令
    go env

2. Linux

1.下载SDK
在这里插入图片描述
下载linux 版本的sdk
2. 安装SDK

# 解压缩文件
tar -zxvf go1.17.3.linux-amd64.tar.gz 
# 将解压缩后的文件移动到 以下安装目录
sudo mv go /usr/local/gosdk
  1. 环境变量设置
# 创建一个目录用于设置GOPATH,目录可以自己设置
mkdir /home/wwccxy/work/go

# 编辑.bashrc 文件,添加环境变量
vim $HOME/.bashrc
# 环境变量
GOROOT=/usr/local/goskd
export GOPATH=/home/wwccxy/work/go
PATH=$PATH:$GOROOT/bin:$GOPATH/bin
  1. 开启go modules
go env -w GO111MODULE=on
  1. 设置国内代理
go env -w GOPROXY=https://goproxy.cn,https://proxy.golang.com.cn,direct
  1. 查看go环境信息
go env
### Golang SDK Documentation and Resources For developers interested in working with the FISCO BCOS Go SDK, several key resources are available to facilitate development and integration efforts. #### Official Documentation The official documentation provides comprehensive guidance on using the Go SDK for interacting with FISCO BCOS blockchain networks. This includes setup instructions, API references, and example code snippets[^1]. ```plaintext https://fisco-bcos-documentation.readthedocs.io/zh-cn/latest/docs/sdk/go_sdk/index.html ``` #### GitHub Repositories Two main repositories offer practical examples and extended functionality: - **fisco-go-sdk-demo**: A demonstration project that showcases how to use the Go SDK through a web application interface. ```plaintext https://gitee.com/kkvb/fisco-go-sdk-demo ``` - **fiscobcos-go**: An enhanced tool package built upon the original Go SDK, offering simplified operations over those described in the official documentation. ```plaintext https://github.com/kkvbAugust/fiscobcos-go ``` #### Dependency Management To effectively utilize these tools within your own projects, specific dependencies must be imported into your Go environment. These include not only the core Go SDK but also additional libraries such as YAML parsing support[^3]: ```bash go get -u github.com/FISCO-BCOS/go-sdk go get -u gopkg.in/yaml.v3 ``` By leveraging these materials, developers can more easily integrate smart contract interactions and other blockchain functionalities directly from their Go applications. --related questions-- 1. How does one set up a basic connection between a Go application and a FISCO BCOS node? 2. What are some common issues encountered when deploying contracts via the Go SDK? 3. Can you provide an overview of best practices for securing communications between client apps and blockchain nodes? 4. Are there any community forums or channels dedicated specifically to discussing developments around the FISCO BCOS ecosystem?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

weiwei8213

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值