标签: blockchain

使用随机对等点发现模拟私有比特币网络

我正在寻找一种在我的专用LAN/Wifi网络上模拟1000节点比特币网络的方法.

我阅读了开发人员指南:https://bitcoin.org/en/developer-examples#regtest-mode,它提到了regtest主要用于单个节点或指定节点的模式,而不是像实际网络那样的随机节点.

有些人可能会建议使用该testnet模式,但这对我没用,因为我想检查一个新的协议,因为比特币不会被testnet网络上的未知节点支持.

简单来说,我希望在我的LAN/Wifi网络中模拟一个完整的比特币网络.

bitcoin bitcoind blockchain bitcoin-testnet

10
推荐指数
1
解决办法
935
查看次数

在 Solidity 中,pure 修饰符和 view 修饰符有什么区别?

该代码产生相同的输出。

pragma solidity ^0.5.0;
contract mycontract
{

   function add(uint c, uint d) public pure returns(uint)
  { uint e=c+d;


   return e;

  } 
   function add(uint j, uint k) public view returns(uint)
  { uint f=j+k;


   return f;

  } 

}
Run Code Online (Sandbox Code Playgroud)

functional-programming blockchain ethereum solidity smartcontracts

10
推荐指数
2
解决办法
6947
查看次数

无法为“librocksdb-sys v6.11.4”运行自定义构建命令时发生一些错误

我尝试创建我的第一个底物链。创建您的第一个 Substrate 链

但是我在编译基质时遇到了一些错误。

无法运行自定义构建命令librocksdb-sys v6.11.4

有人知道如何解决这个问题吗?

rust blockchain substrate

10
推荐指数
3
解决办法
1万
查看次数

如何从 Solana 的助记词中获取正确的公共地址?

我正在尝试在我的反应本机测试项目中使用solana-web3.js获取 Solana 钱包的正确公共地址Solflare 钱包截图

import { Keypair} from '@solana/web3.js';
import * as bip39 from 'bip39';
import * as bip32 from 'bip32';

const derivePath = "m/44'/501'/0'/0'";
const mnemonic = "...12 word phrase"

const seed: Buffer = yield bip39.mnemonicToSeed(mnemonic);
// also tried to slice seed.slice(0, 32);
const derivedSeed = bip32.fromSeed(seed).derivePath(derivePath).privateKey;
const keypair = Keypair.fromSeed(derivedSeed);
const publicKey = keypair.publicKey.toString();
Run Code Online (Sandbox Code Playgroud)

我采用了应该用于 Phantom 钱包的派生路径(并且可以在 Solflare 钱包中选择),但问题是 - 我没有获得与这些浏览器钱包相同的公钥。

那么我在上面的代码中可能在哪里犯了错误呢?

更新:当我使用“ed25519-hd-key”lib 而不是“bip32”来获取派生种子时,问题就消失了。

import * as ed25519 from 'ed25519-hd-key';

const derivedSeed = ed25519.derivePath(derivePath, seed.toString('hex')).key;
Run Code Online (Sandbox Code Playgroud)

javascript seed mnemonics blockchain solana

10
推荐指数
1
解决办法
1万
查看次数

遇到错误无法完成基材前端模板的纱线安装

按照此处提供的安装步骤进行操作

\n

https://docs.substrate.io/tutorials/v3/create-your-first-substrate-chain/

\n

使用节点版本 v16.14.0 采取的步骤

\n
git clone https://github.com/substrate-developer-hub/substrate-front-end-template\nyarn install\n
Run Code Online (Sandbox Code Playgroud)\n

错误代码

\n
Resolution step\n\xe2\x9e\xa4 YN0002: \xe2\x94\x82 eslint-config-react-app@npm:7.0.0 [e199f] doesn\'t provide @babel/plugin-syntax-flow (p79568), requested by eslint-plugin-flowtype\n\xe2\x9e\xa4 YN0002: \xe2\x94\x82 eslint-config-react-app@npm:7.0.0 [e199f] doesn\'t provide @babel/plugin-transform-react-jsx (p2880e), requested by eslint-plugin-flowtype\n\xe2\x9e\xa4 YN0002: \xe2\x94\x82 react-dev-utils@npm:12.0.0 doesn\'t provide typescript (p08c91), requested by fork-ts-checker-webpack-plugin\n\xe2\x9e\xa4 YN0002: \xe2\x94\x82 react-dev-utils@npm:12.0.0 doesn\'t provide webpack (pf80ce), requested by fork-ts-checker-webpack-plugin\n\xe2\x9e\xa4 YN0002: \xe2\x94\x82 react-scripts@npm:5.0.0 [9c894] doesn\'t provide autoprefixer (peca2e), requested by tailwindcss\n\xe2\x9e\xa4 YN0060: \xe2\x94\x82 react-scripts@npm:5.0.0 [9c894] provides eslint (p3d1f2) with version 8.6.0, …
Run Code Online (Sandbox Code Playgroud)

node.js blockchain substrate polkadot

10
推荐指数
1
解决办法
8028
查看次数

将 Remix Ethereum IDE 连接到本地主机

我想将 Remix - Ethereum IDE ( https://remix.ethereum.org ) 连接到本地主机。

我按照说明进行操作https://remix-ide.readthedocs.io/en/latest/remixd.html#update-to-the-latest-remixd

  1. npm install -g @remix-project/remixd使用 npm 安装了 remix 守护进程。
  2. 我创建了文件夹mkdir ~/shared_project.
  3. chmod u+rw shared_project我为本地用户授予了该文件夹的读/写权限。
  4. 我启动了 remix 守护进程sudo remixd -s ~/shared_project --remix-ide https://remix.ethereum.org

问题是,当我想将浏览器中的 Remix IDE 连接到本地主机时,我可以看到带有错误消息的弹出窗口Cannot connect to the remixd daemon. Please make sure you have the remixd running in the background.

我尝试重新启动守护进程:

  1. ps -ef | grep remixd
  2. sudo kill 1007
  3. sudo remixd -s ~/shared_project --remix-ide https://remix.ethereum.org

我尝试重新安装守护进程:

  1. sudo …

bash blockchain ethereum remix

10
推荐指数
1
解决办法
1052
查看次数

将属性添加到IBM Bluemix区块链CA(membersrvc.yaml)

我正在研究区块链的概念证明.我正在使用bluemix网络进行区块链和部署我在本地开发的应用程序.我想测试CA功能,并希望向用户添加属性membersrvs.yaml,并执行基于属性的访问控制.但是,当我的网络托管在bluemix上时,我无法找到如何编辑/更新文件.请原谅我,如果这看起来很基本,我仍然对事情有所了解.

ca blockchain hyperledger ibm-cloud

9
推荐指数
1
解决办法
365
查看次数

区块链是一个分散的数据库吗?

我理解比特币使用区块链技术来维护所有交易的分散分类账.我还阅读了许多帖子,暗指未来区块链技术的应用,我都不清楚这一点.

区块链技术只是一个分散的数据库,对数据进行了共识验证吗?如果是这种情况,数据库肯定会变得太大而无法有效地分散?

为了帮助我理解,有人能指出一个非比特币区块链应用程序的明确例子吗?

提前致谢.

bitcoin blockchain ethereum hyperledger corda

9
推荐指数
1
解决办法
1617
查看次数

hyperledger锯齿湖 - 英特尔与否?

我知道hyperledger锯齿湖使用新的安全CPU指令来实现经过时间的证明(PoET)

这是否意味着hyperledger锯齿湖只能用于英特尔硬件?可以使用其他芯片吗?

x86 intel blockchain hyperledger hyperledger-sawtooth

9
推荐指数
3
解决办法
732
查看次数

私有以太坊区块链的数据在几天后丢失/消失

我正在Azure上的虚拟机上部署私有以太坊区块链(geth).在区块链上部署我的Solidity合同并启动我的NodeJS应用程序后,我能够通过nodejs Loopback App的web apis正常添加数据,一切正常,我可以使用GET apis查看添加的数据.

然而,在1-2-3天(随机)后,我无法检索通过我的GET apis添加的数据,而我仍然能够添加新数据,确认Geth正常运行并且没有中断.

我正在运行geth使用:

geth --datadir ./myDataDir --rpc --networkid 1441 console 2>> myEth.log
Run Code Online (Sandbox Code Playgroud)

myEth.log没有显示任何错误,nodejs日志也是干净的.

eth.syncing显示false哪个网络已同步.

myDataDir文件夹的大小仍然在增加,所以逻辑上数据应该在某处,但它没有显示.

blockchain ethereum solidity smartcontracts go-ethereum

9
推荐指数
1
解决办法
217
查看次数