使用密码保护以太坊JSON-RPC API

避开这3个坑!用Geth搭建私有链时JSON-RPC接口的隐藏陷阱(Windows/Mac实测) 本文详细解析了在Windows和macOS环境下使用Geth搭建以太坊私有链时,JSON-RPC接口配置中的三个常见陷阱,包括HTTP监听地址配置、跨域访问限制和端口冲突与防火墙问题。通过实测案例和解决方案,帮助开发者快速排查和解决这些问题,确保私有链的顺利搭建和运行。 阅读详情

本文面向以太坊智能合约应用程序开发人员,并讨论如何在密码保护后,安全地运行你的以太坊节点,以便通过Internet进行安全输出。

Go Ethereum(geth)是以太坊节点最受欢迎的软件。其他流行的以太坊实现是Parity和cpp-ethereum等。分布式应用程序(Dapps)是JavaScript编码的网页,通过JSON-RPC API协议连接到任何这些以太坊节点软件,该协议是在HTTP协议之上自行运行的。

geth或没有节点软件本身不提供安全网络。将Ethereum JSON-RPC API暴露给公共Internet是不安全的,因为即使禁用私有API,这也会为琐碎的拒绝服务攻击打开一扇门。节点软件本身不需要提供安全的网络原语,因为这种内置功能会增加复杂性并为关键区块链节点软件增加攻击面。

Dapps本身是纯客户端HTML和JavaScript,不需要任何服务器,它们可以在任何Web浏览器中运行,包括移动和嵌入式浏览器,如Mist钱包内的一个。

使用Nginx代理作为HTTP基本身份验证器

有几种方法可以保护对HTTP API的访问。最常见的方法包括HTTP头中的API令牌,基于cookie的身份验证或HTTP基本访问身份验证。

HTTP基本身份验证是HTTP协议的一个非常古老的功能,其中Web浏览器打开一个本机弹出对话框,询问用户名和密码。它本质上的保护是有限的,但非常容易实现,非常适合需要为有限的互联网受众暴露私有Dapp的用例。这些用例包括显示Dapp演示,私有和许可的区块链应用程序或将以太坊功能作为软件即服务解决方案的一部分。

Nginx

Nginx是最受欢迎的开源Web服务器应用程序之一。我们将展示如何设置Nginx Web服务器,以便它使用HTTP Bas

以太坊节点geth的rpc采用加密访问方式 1 、为什么RPC要加密访问 geth给用户暴露了很多Json-RPC接口API,可以让web3.js或web3j库来通过这些接口来访问geth节点,可以实现远程查询转账等功能。但是geth暴露的这些接口是未经过任何加密处理的不安全接口。如果geth使用这种方式启动RPC: geth --datadir "/www/ethereum/eth/test" --rpc --rpcapi "eth,web3,miner,admin,personal,net" --rpcaddr "0.0.0.0" --rp 阅读详情

相关推荐

Nginx赋能Web3.0:构建安全高效的去中心化应用(DApps)新时代

随着区块链技术的不断成熟,Web3.0作为下一代互联网的愿景正逐渐成为现实。在这个新的数字世界里,用户不仅能够掌控自己的数据,还能参与到一个更加开放、透明且公平的网络环境中。而去中心化应用程序(Decentralized Applications, DApps)则是实现这一目标的关键组件之一。它们通过智能合约和分布式账本技术打破了传统中心化平台对数据和服务的垄断,为用户提供了一种全新的交互方式。然而,要使这些创新的应用真正落地生根,还需要克服诸多技术和操作上的挑战。

墨夶的博客 966

智能问数系统的完整技术栈与实现逻辑

提取并增强数据库 Schema(含业务语义)选择 LLM(开源 qwen2 / 商业 GPT-4o)构建 RAG 向量库(存储历史问法)实现 SQL 安全校验与权限控制添加结果自然语言解释 + 可视化部署到只读数据库环境🔑核心原则“先保证安全,再追求智能”—— 一个能生成错误 SQL 的智能问数系统,比没有更危险。

我们的征途是星辰大海 1673

快速了解Spyder

一 面板介绍菜单栏:放置所有功能工具栏:放置快捷菜单,可以通过菜单栏中的View的Toolbars的复选框来勾选工作区:写代码的地方属性页的标题栏:可以显示当前代码的名字和位置查看栏:查看文件、调试时的对象及变量输出栏:查看程序的输出信息,也可以作为shell终端来输入Python语句状态栏:用来显示当前文件权限、编码,光标指向位置和系统内存二 注释功能注释功能为编写代码很常用功能,下面介绍Spy...

实践求真知 1万+

昇腾NPU实战:PaddleSpeech语音模型高效部署与性能优化指南

本文详细介绍了如何在华为昇腾NPU上高效部署PaddleSpeech语音识别模型。通过使用官方Docker镜像、解决依赖冲突、修改源码适配NPU算子,并应用混合精度与批处理等优化技巧,实现模型在昇腾平台上的稳定运行与性能提升,为AI语音应用提供高性价比的国产硬件部署方案。

weixin_29214691的博客 182

EGO_Planner代码学习(三):px4ctrl代码流程

上节阅读了EGO_Planner的轨迹服务器部分的代码,其实质是将规划器生成的轨迹进行离散化,间隔10ms计算当前时刻在轨迹上的位置,并发送到话题上。这两天抽空看了下控制器部分的代码,在l这个软件包里,它的功能是进行px4的模式识别和上层控制,通过线性控制器把发布过来的位置命令解算成飞控的控制量,通过mavros发送给px4。下面就详细看一下它的启动过程。

qq_41069236的博客 6815

ASPICE1-配置管理

SUP.8配置管理 BP1:开发配置管理策略 BP2:识别配置项 BP3:建立配置项管理系统 BP4:建立分支管理 BP5:控制变更和发布 BP6: 建立基线 BP7:报告配置项状态 BP8:验证配置项信息 BP9:管理配置项和基线的存储 1.配置管理概念 配置管理(Configuration Management,CM)是通过使用技术或行政手段对软件产品进行控制,以实现对软件开发过程和生命周期进行控制、规范的一系列措施。 完整性、一致性、可控性。 2.配置管理的主要活动: 1.

HDZQ2005的专栏 3692

复旦微FMSH_Procise安装全流程详解:从环境配置到实战避坑指南

通过本文的全流程解析+实战技巧,开发者可快速掌握Procise在复旦微芯片开发中的核心应用。未来随着AKConv轻量级架构(参考往期文章)等创新技术的融入,国产芯片开发生态将更加完善。立即关注本专栏,获取最新多镜像切换指南与Linux SDK实战教程!扩展阅读复旦微在线升级BOOT.BIN全解析H7-TOOL实现复旦微脱机烧录(注:本文实验环境为Windows 10 x64 + FMQL45T-CORE开发板,部分操作可能因版本更新调整)立即行动下载本文配套配置文件:[GitHub链接]加入技术交流群。

QQ_778132974的博客 3259

【Block总结】DiffAttention,差分注意力融入CLIP架构,抑制噪声,增强对相关特征的关注|即插即用

DiffCLIP通过微小的结构改动实现了显著的性能提升,为多模态模型的轻量化与高效化提供了新范式。

AI浩 1571

ATT MTU 交换机制:提升 BLE 数据传输效率的关键

在低功耗蓝牙(BLE)技术的面试中,ATT MTU 交换机制始终是高频考点。无论是芯片厂商的固件开发岗,还是物联网设备的协议栈调试岗,面试官都爱通过这个知识点考察候选人对 BLE 数据传输底层逻辑的理解。本文将系统梳理核心考点,结合历年真题详解应答思路,轻松应对这类问题。​

byte轻骑兵的技术小窝 2419

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

上一篇: 从Java到区块链:如何成为区块链开发人员
下一篇: 用以太坊区块链保证Asp.Net Core的API安全(上)
落叶无声9
博客等级 码龄12年 443粉丝 343原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址