同步以太坊,配置rpc地址

mkdir /opt/blockchain
nohup geth --syncmode "fast" --cache=1024 --maxpeers 30 --datadir /opt/blockchain --rpc --rpcapi db,eth,net,web3,personal,admin,miner --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" &

https://www.51chain.net/portal/book/EthereumFrontierGuide/JSONRPCAPI-121.html

https://luren5.gitbooks.io/dapp-develop/content/43-调用json-rpc-api.html

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1}'  http://127.0.0.1:8545

# 返回 {"jsonrpc":"2.0","id":1,"result":"Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9.2"}

JSON-RPC methods

web3_clientVersion
web3_sha3 net_version
net_peerCount
net_listening eth_protocolVersion
eth_syncing
eth_coinbase
eth_mining
eth_hashrate
eth_gasPrice
eth_accounts
eth_blockNumber
eth_getBalance
eth_getStorageAt
eth_getTransactionCount
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getUncleCountByBlockHash
eth_getUncleCountByBlockNumber
eth_getCode
eth_sign
eth_sendTransaction
eth_sendRawTransaction
eth_call
eth_estimateGas
eth_getBlockByHash
eth_getBlockByNumber
eth_getTransactionByHash
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionReceipt
eth_getUncleByBlockHashAndIndex
eth_getUncleByBlockNumberAndIndex
eth_getCompilers
eth_compileLLL
eth_compileSolidity
eth_compileSerpent
eth_newFilter
eth_newBlockFilter
eth_newPendingTransactionFilter
eth_uninstallFilter
eth_getFilterChanges
eth_getFilterLogs
eth_getLogs
eth_getWork
eth_submitWork
eth_submitHashrate db_putString
db_getString
db_putHex
db_getHex shh_post
shh_version
shh_newIdentity
shh_hasIdentity
shh_newGroup
shh_addToGroup
shh_newFilter
shh_uninstallFilter
shh_getFilterChanges
shh_getMessages
# too many file open
prlimit -n150000 -p $(pidof geth)
# 关于 fast full light三种同步模式
Depending on your internet connection, and how fast your computer is, it can take a few hours, a few days, possibly even a few weeks. Yes, you can stop and resume at any time. It is a peer to peer technology that is designed to work with unstable networks, and with peers that go online and offline regularly. After you turn it back on it will pick up where it left off and start synchronizing again. Geth has the `—fast` option which can be used the first time you start downloading the blockchain. This reduces the amount of data that has to be downloaded by cutting out the parts that don’t absolutely need to be there when you get the chain for the first time. This option only works if you are syncing the blockchain from the beginning though. If you stop it part way through you cannot resume in fast mode. After fast mode is complete, it automatically switches you to full mode going forward. Geth also has the new experimental `—light` mode. Rather than downloading the complete chain, it downloads only the headers, then relies on the network for any other data it needs. Using fast mode, the blockchain size will be about 30GB or less, but then will switch to full mode, and continue to grow at a faster pace. Using full mode, the blockchain size will probably be near or over 100GB. Using light mode, the blockchain size will be under 1GB.

geth访问公有链的更多相关文章

  1. geth建立私链以及发布第一个智能合约

    原博客地址 https://blog.csdn.net/qq_36124194/article/details/83686740 geth建立私链 初始化genesis.json文件 geth --d ...

  2. geth搭建以太坊私链及常用操作

    一.下载安装geth客户端 https://www.ethereum.org/ 二.搭建私有链 1.准备创世区块配置文件 要运行私有链,我们就需要定义自己的创世区块,创世区块信息写在一个json格式的 ...

  3. 如何从零开始学习区块链技术——推荐从以太坊开发DApp开始

    很多人迷惑于区块链和以太坊,不知如何学习,本文简单说了一下学习的一些方法和资源. 一. 以太坊和区块链的关系 从区块链历史上来说,先诞生了比特币,当时并没有区块链这个技术和名词,然后业界从比特币中提取 ...

  4. 转:区块链开发(一)搭建基于以太坊go-ethereum的私有链环境

    区块链开发(一)搭建基于以太坊go-ethereum的私有链环境 wo541075754 · 2016-11-07 13:00:03 · 3730 次点击 · 预计阅读时间 3 分钟 · 约1小时前  ...

  5. Mac环境搭建以太坊私有链

    原文地址: 石匠的blog 为了测试以太坊智能合约,最方便的是在本地搭建一个以太坊私有链.在mac上搭建环境主要需要以下步骤. geth安装 geth是go-ethereum的简写,是一个用go语言编 ...

  6. HyperLedger Fabric 1.4 区块链开发平台(4.1)

    目前区块链开发平台分“公有链平台”和“联盟链系统”两类,“公有链平台”主要以以太坊为主的平台,可以在该类平台上进行代币的发行和根据各种模块搭建应用:“联盟链系统”主要以超级账本为主的开源系统,该类开源 ...

  7. [区块链] 共识算法之争(PBFT,Raft,PoW,PoS,DPoS,Ripple)

    近几天对区块链中几种常见的共识机制(PBFT,Raft,PoW,PoS,DPoS,Ripple)进行了总结.尽量使用简单易懂语言,篇幅较大,想了解的可以只读每个算法介绍中前边的原理.本篇文章主要参考& ...

  8. 微软刚发布的区块链去中心化身份识别系统DID

    https://mp.weixin.qq.com/s?__biz=MzAwMDU1MTE1OQ==&mid=2653549389&idx=1&sn=158f9feb10d76a ...

  9. 联盟链初识以及Fabric环境搭建流程

    这篇文章首先简单介绍了联盟链是什么,再详细的介绍了Fabric环境搭建的整个流程. 区块链分类: 以参与方式分类,区块链可以分为:公有链.联盟链和私有链. 定义: 我们知道区块链就是一个分布式的,去中 ...

随机推荐

  1. PHP 实时生成并下载超大数据量的 Excel 文件

    //另外由于excel数据是从数据库里逐步读出然后写入输出流的所以需要将PHP的执行时间设长一点 //(默认30秒)set_time_limit(0)不对PHP执行时间做限制. set_time_li ...

  2. C++_代码重用3-私有继承

    使用包含:易于理解,类声明中包含表示被包含类的显式命名对象,代码可以通过名称引用这些对象: 使用继承:将使关系更抽象,且继承会引起很多问题,尤其是从多个基类继承时. 私有继承所提供的特性确实比包含多. ...

  3. 【算法笔记】B1008 数组元素循环右移问题

    1008 数组元素循环右移问题 (20 分) 一个数组A中存有N(>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(≥0)个位置,即将A中的数据由(A​0​​A​1​​⋯A​N ...

  4. 把磁力下载站改为python系统

    已经一年半载没有写博客了,搞得上来不知道写些什么. 索马里影视下载  WWW.IBMID.COM  现在用的是CENTOS 7 系统, 经历了多次点技术变更.开源版本使用了django网站框架重写,之 ...

  5. P4174 [NOI2006]最大获利

    传送门 把用户群和中转站都看成点 用户群权值为正,中转站权值为负 为了获得用户群的权值,我们不得不一起获得中转站负的权值 发现就是裸的最大权闭合子图 那么从用户群连边向中转站,边值INF 从 S 连向 ...

  6. centos yum安装高版本php,apache,mysql

    1.检查当前安装的PHP包 yum list installed | grep php 或者   yum list installed php* 如果要删除,可执行 yum remove php.x8 ...

  7. PIE软件介绍

    1. 产品概述 PIE(Pixel Information Expert)软件是北京航天宏图信息技术股份有限公司自主研发的新一代遥感影像处理软件,北京航天宏图信息技术股份有限公司是国内知名的卫星应用服 ...

  8. PIE SDK图像镜像

      1.算法功能简介 图像镜像可生成图像的水平镜像.垂直镜像和水平垂直镜像.水平镜像是图像以垂直中线为轴, 将图像左右半部对调:垂直镜像是图像以水平中线为轴,将图像上下半部对调. PIE支持算法功能的 ...

  9. shiro app

    写在前面 我们知道,shiro框架在Java Web应用中使用时,本质上是通过filter方式集成的. 也就是说,它是遵循过滤器链规则的:filter的执行顺序与在web.xml中定义的顺序一致,如下 ...

  10. Python-2.7 配置 tab 自动补全功能

    作者博文地址:http://www.cnblogs.com/liu-shuai/ 之前一直使用shell编程,习惯了shell的 tab 自动补全功能,而Python的命令行却不支持 tab 自动补全 ...