我正在研究区块链的概念证明.我正在使用bluemix网络进行区块链和部署我在本地开发的应用程序.我想测试CA功能,并希望向用户添加属性membersrvs.yaml,并执行基于属性的访问控制.但是,当我的网络托管在bluemix上时,我无法找到如何编辑/更新文件.请原谅我,如果这看起来很基本,我仍然对事情有所了解.
我正在构建一个分散的应用程序,用户可以在其中将他们的加密货币钱包 (Metamask) 连接到我的网站。
They can initiate a connection request by clicking a button. On success, the wallet is connected and my website can interact with it.
Is there any way to initiate a disconnect request? Similar to a 'Log out' button. Currently, the users have to manually disconnect their wallet within Metamask settings which is not a straightforward process.
我创建了一个基本合同。但不知道提现功能。
我尝试创建一个基本功能,但它不起作用
function withdraw() public {
msg.sender.transfer(address(this).balance);
}
Run Code Online (Sandbox Code Playgroud) 连接两个或多个字符串值 -
pragma solidity 0.8.9;
contract StringConcatation{
function AppendString(string memory a, string memory b) public pure returns (string memory) {
return string(abi.encodePacked(a,"-",b));
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Rust/Anchor 编写一个简单的 Solana 程序,该程序使用 PDA,但当我尝试调用它时,我收到 CPI 错误,即使没有发生 CPI(可能是 PDA 帐户初始化?)。
这是程序代码:
use anchor_lang::prelude::*;
declare_id!("51v31qHaEQniLoYuvvtXByZcfiyvog3R2EKC39EPD52p");
#[program]
pub mod solana_sandbox {
use super::*;
pub fn initialize(ctx: Context<Initialize>, bump: u8) -> ProgramResult {
ctx.accounts.sandbox_account.bump = bump;
Ok(())
}
}
#[derive(Accounts)]
#[instruction(bump: u8)]
pub struct Initialize<'info> {
#[account(mut)]
pub signer: Signer<'info>,
#[account(
init,
seeds = [b"seed".as_ref()],
bump,
payer = signer,
)]
pub sandbox_account: Account<'info, SandboxAccount>,
pub system_program: Program<'info, System>,
}
#[account]
#[derive(Default)]
pub struct SandboxAccount {
pub bump: u8,
}
Run Code Online (Sandbox Code Playgroud)
这是客户端代码:
const [sandboxPda, …Run Code Online (Sandbox Code Playgroud) 我正在尝试从一个帐户发送到另一个帐户,但从到 的ETH转换一直让我头疼。在这种情况下,我尝试发送,但在确认窗口中,我收到了。ETHWEI0.11 ETH313.59464925 ETH
// This is my transaction code
await window.ethereum
.request({
method: "eth_sendTransaction",
params: [
{
from: window.ethereum.selectedAddress,
to: "0x4dxxxxxxxxxxxxxxxxxx2dr9820C",
value: String(0.11 * 1000000000000000000), // convert to WEI
},
],
})
.then((result) => console.log(result))
.catch((error) => console.log(error));
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用BigNumber但它不能解决问题,我想我把事情搞砸了。如何准确转换ETH为WEI?
当我在命令提示符中键入以下内容时:
solana airdrop 2 -k ./Wallet/.config/solana/Seller.json
Run Code Online (Sandbox Code Playgroud)
我收到这个错误
Requesting airdrop of 2 SOL
Error: airdrop request failed. This can happen when the rate limit is reached.
Run Code Online (Sandbox Code Playgroud)
我能做些什么?
我想在私人网络上挖掘.
如何在边境以太坊中为私人网络创建一个创世块?
我已经看到:https://blog.ethereum.org/2015/07/27/final-steps/但这是为了获取公共Genesis块.
我在本地计算机上使用单个验证节点进行了超级分层结构网络设置.我正在开发一个链码,想清除我的区块链.我已经读过hyperledger结构将数据库存储在/ var/hyperledger下.但是,我没有在/ var下看到这个hyperledger目录.这个目录还有其他位置吗?我的开发平台是MAC,我使用docker-compose来启动我的超级结构网络.
我正在使用这个bitcore npm包. https://bitcore.io/api/lib
我想监视区块链上的所有事务,并读取与该事务关联的输入地址,输出地址和数量.
但我无法找到要调用的javascript方法来完成此任务.即使我无法找到这方面的例子.
我正在寻找类似的东西
var someLib = require('some-bitcore-lib')
someLib.on('transaction-found', function(){
// print everything
console.log(arguments);
// do something else;
})
Run Code Online (Sandbox Code Playgroud)
有帮助吗?我在哪里可以找到some-bitcore-lib或如何在nodejs中创建它?
blockchain ×10
ethereum ×5
hyperledger ×2
metamask ×2
solana ×2
solidity ×2
anchor ×1
bitcoin ×1
ca ×1
cryptography ×1
encryption ×1
erc20 ×1
ibm-cloud ×1
node.js ×1
rust ×1
solana-cli ×1
typescript ×1
web3js ×1