摘要: 个人微博:https://weibo.com/u/2434823180 Blog: https://apenote.github.io 知乎:https://www.zhihu.com/people/3-33-52-32 vx: apedamoon 区块链通识 区块链技术基础 区块链原理 挖矿原理 阅读全文
posted @ 2022-12-08 13:18 apeNote 阅读(147) 评论(0) 推荐(0)
摘要: 一、阻塞的核心场景 无缓冲通道(Unbuffered Channel) 发送操作会阻塞,直到另一个goroutine准备好接收。 接收操作会阻塞,直到另一个goroutine准备好发送。 带缓冲通道(Buffered Channel) 发送操作仅在缓冲区满时阻塞。 接收操作仅在缓冲区空时阻塞。 其他 阅读全文
posted @ 2025-05-28 10:11 apeNote 阅读(39) 评论(0) 推荐(0)
摘要: defer 是一个非常有用的关键字,它的核心功能是 延迟执行函数调用。这个机制常用于资源清理、错误处理和代码流控制等场景。 一、defer 的 3 大核心规则 延迟执行defer 后的函数调用会被推迟到外层函数返回前执行。 func example() { defer fmt.Println("最后 阅读全文
posted @ 2025-05-22 08:47 apeNote 阅读(130) 评论(0) 推荐(0)
摘要: 启动访问 psql -h 127.0.0.1 -p 5432 -U postgres -d mydatabase 2 psql -h localhost -p 5432 -U postgres -d database_name 阅读全文
posted @ 2025-05-09 14:27 apeNote 阅读(9) 评论(0) 推荐(0)
摘要: 首次启动失败 以管理员的身份运行cmd.exe: pg_ctl register -N PostgreSQL -D "......\postgresql\data" 阅读全文
posted @ 2025-05-06 09:29 apeNote 阅读(11) 评论(1) 推荐(0)
摘要: truffle migrate --network sepolia 报错 Error: There was a timeout while attempting to connect to the network at undefined. Check to see that your provid 阅读全文
posted @ 2024-10-08 20:37 apeNote 阅读(29) 评论(0) 推荐(0)
摘要: 运行 truffle migrate 报错 *** Deployment Failed *** "TestT**" hit an invalid opcode while deploying. Try: * Verifying that your constructor params satisfy 阅读全文
posted @ 2024-10-04 16:36 apeNote 阅读(69) 评论(0) 推荐(0)
摘要: 运行 truffle compile 报错 Error: Truffle is currently using solc 0.8.13, but one or more of your contracts specify "pragma solidity ^0.8.20". 修改 truffle-c 阅读全文
posted @ 2024-10-04 16:25 apeNote 阅读(25) 评论(0) 推荐(0)
摘要: 运行以下 // SPDX-License-Identifier: MIT pragma solidity 0.7.5; import {Counters} from "@openzeppelin/contracts/utils/Counters.sol"; contract MyToken is E 阅读全文
posted @ 2024-10-04 08:55 apeNote 阅读(121) 评论(0) 推荐(0)
摘要: contract目录下 Storage.sol // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.8.2 <0.9.0; /** * @title Storage * @dev Store & retrieve value in a va 阅读全文
posted @ 2024-10-02 15:22 apeNote 阅读(26) 评论(0) 推荐(0)
摘要: 打印 ganache环境的账户列表 const localhost = "http://127.0.0.1:7545"; const {Web3} = require("web3"); const web3 = new Web3(new Web3.providers.HttpProvider(loc 阅读全文
posted @ 2024-10-02 10:42 apeNote 阅读(16) 评论(0) 推荐(0)