Goland常用快捷键

安装go

$ wget https://golang.google.cn/dl/go1.15.6.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.15.6.linux-amd64.tar.gz

/etc/profile  ubuntu全局
~/.zshrc  mac
$ vim ~/.profile  ubuntu

export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:/usr/local/go/bin:$GOBIN
export GO111MODULE=on

$ source ~/.profile
$ go version
国内服务器go代理
export GOPROXY=https://mirrors.aliyun.com/goproxy/
  • win10终端使用系统代理
 set HTTP_PROXY=http://127.0.0.1:7890

Cosmos节点数据修剪

pruning = "custom"

# These are applied if and only if the pruning strategy is custom.
pruning-keep-recent = "100"
pruning-interval = "10"
pruning-keep-every = "2000"

Cosmos查看升级情况

https://github.com/quokkastake/tmtop
tmtop --provider-rpc-host http://provider-sentry-02.rs-testnet.polypore.xyz:26657 --rpc-host https://rpc-palvus.pion-1.ntrn.tech

Cosmos下载快照

SYNC_RPC_1=https://rpc.provider-state-sync-01.rs-testnet.polypore.xyz:443
SYNC_RPC_2=https://rpc.provider-state-sync-02.rs-testnet.polypore.xyz:443
SYNC_RPC_SERVERS="$SYNC_RPC_1,$SYNC_RPC_2"

CURRENT_BLOCK=$(curl -s $SYNC_RPC_1/block | jq -r '.result.block.header.height')
TRUST_HEIGHT=$[$CURRENT_BLOCK-1000]
TRUST_BLOCK=$(curl -s $SYNC_RPC_1/block\?height\=$TRUST_HEIGHT)
TRUST_HASH=$(echo $TRUST_BLOCK | jq -r '.result.block_id.hash')
sed -i -e '/enable =/ s/= .*/= true/' $NODE_HOME/config/config.toml
sed -i -e '/trust_period =/ s/= .*/= "8h0m0s"/' $NODE_HOME/config/config.toml
sed -i -e "/trust_height =/ s/= .*/= $TRUST_HEIGHT/" $NODE_HOME/config/config.toml
sed -i -e "/trust_hash =/ s/= .*/= \"$TRUST_HASH\"/" $NODE_HOME/config/config.toml
sed -i -e "/rpc_servers =/ s^= .*^= \"$SYNC_RPC_SERVERS\"^" $NODE_HOME/config/config.toml

使用state sync

  • 修改config.toml
[statesync]
enable = true # whether enable stat_sync; set true
rpc_servers = "34.82.96.8:26657,34.77.68.145:26657" # RPC server address which the node connects to
trust_height = # Set to the block height of the latest snapshot
trust_hash = "" #Set to the hash corresponding to the latest snapshot block height (trust height), which can be checked via https://irishub.iobscan.io/#/block/<trust_height>.
trust_period = "168h0m0s"
discovery_time = "15s"
temp_dir = ""
  • 查询快照区块高度和hash
curl -s http://foo.net:26657/block |  jq -r '.result.block.header.height + "\n" + .result.block_id.hash'

Goland常用快捷键

工作中Goland常用快捷键(windows环境下)

(1)返回上次光标所在位置

Ctrl+window+Alt +左箭头或右箭头

(2)跳转到interface实现

ctrl + alt + 鼠标左键

(3)查看函数被调用

Alt + F7

(4)下载依赖包

Alt + Shift + Enter

Mac技巧

(1)设置终端

iTerm2 + zsh + oh-my-zsh

(2)设置终端速度

搜索keyboard 将按键重复和重复前延迟调整到最快

(3)goland 设置

command + ,

docker 指定文件存储位置

  • DockerFile
volumes:
      - ./config:/opt/taraxa_data/conf
      - /data/data:/opt/taraxa_data/data
      - 主机位置:docker位置
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值