进入geth交互平台的命令大全解释
来源:互联网 发布:贵州省食品安全大数据 编辑:程序博客网 时间:2024/06/05 15:35
这里有很多进入geth平台的命令参数来确保你的链是私链
- nodiscover:不被其他节点发现,但是如果有相同创世块和networkid的节点可以连接进私链
--nodiscoverUse this to make sure that your node is not discoverable by people who do not manually add you. Otherwise, there is a chance that your node may be inadvertently added to a stranger's node if they have the same genesis file and network id.
- maxpeers 私链最大的界点数量
--maxpeers 0Use maxpeers 0 if you do not want anyone else connecting to your test chain. Alternatively, you can adjust this number if you know exactly how many peers you want connecting to your private chain.
- rpc 一般是默认,用于节点提供rpc接口
--rpcThis will enable RPC interface on your node. This is generally enabled by default in Geth.
- rpcapi 通过rpc可以连接的API接口 ,一般默认有”db,eth,net,web3”
--rpcapi "db,eth,net,web3"This dictates what APIs that are allowed to be accessed over RPC. By default, Geth enables the web3 interface over RPC.IMPORTANT: Please note that offering an API over the RPC/IPC interface will give everyone access to the API who can access this interface (e.g. DApp's). Be careful which API's you enable. By default geth enables all API's over the ipc interface and only the db,eth,net and web3 API's over the RPC interface.
- rpcport “8080” 任何本地网络打开的接口
--rpcport "8080"Change 8000 to any port that is open on your network. The default for geth is 8080 and althzero is 8545.
- rpccorsdomain 用来连接网址
--rpccorsdomain "*"This dictates what URLs can connect to your node in order to perform RPC client tasks. Be very careful with this and when possible, put a specific URL rather than the wildcard (*) which allows any URL to connect to your RPC instance. Since this is a private chain that will not hold real Ether, I usually put a wildcard so I can use sites such as Browser Solidity or DApps like Notareth. When you build DApps outside of Mist or Alethzero, you will need to connect your website to an Ethereum node.
- datadir 用来存放私链数据的目录
--datadir "/home/HudsonChain1"This is the data directory that your private chain data will be stored in. Choose a location that is separate from the public Ethereum chain folder.
- 网络监听端口,用来其他节点的连接
--port "30303"This is the "network listening port", which you will use to connect with other peers manually.
- nat “any” 一般不做处理
--nat "any"I use the NAT any setting, but this will be dependent on your network configuration.
- identity 给节点命名
--identity "HudsonMainNode" This will set up an identity for your node so it can be identified more easily in a list of peers. Here is an example of how these identities show up on the network.Notice the lines with "HudsonMainNode" and "Hudson2ndNode"Putting it All Together
每次运行私链都需要geth 命令
You will need to start your geth instance with your custom chain command every time you want to access your custom chain. If you just type “geth” in your console, it will not remember all of the flags you have set.After you have created your custom genesis block JSON file and created a directory for your chain to go into, type the following command into your console that has access to geth:
进入geth
geth --identity "MyNodeName" --genesis CustomGenesis.json --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "C:\chains\VPSChain" --port "30303" --nodiscover --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --autodag --networkid 1900 --nat "any" console
可以用shell脚本自动运行
Note: Please change the flags to match your custom settings.You will need to start your geth instance with your custom chain command every time you want to access your custom chain. If you just type "geth" in your console, it will not remember all of the flags you have set. Different operating systems have ways to make this easier. Most allow you to make a shortcut file that will automatically open a console window and run commands that you specify. On Windows systems, look up how to create a .bat or .cmd file that runs the commands you require. On Linux/Unix/Mac systems, look up .sh files.
阅读全文
0 0
- 进入geth交互平台的命令大全解释
- 进入注册表一些常用的命令大全汇总
- stk-matlab 交互命令大全
- truffle 的geth
- geth的使用入门
- geth web3提供的接口
- 制作geth 的镜像
- 以太坊geth客户端基本命令
- DOS下常用网络命令解释大全
- DOS下常用网络命令解释大全
- 常用DOS网络命令解释大全
- 命令行下常用网络命令解释大全
- MAC终端命令大全 简单解释
- GDB常用命令大全 GDB 命令详细解释
- mingoe-实用的交互平台
- dd命令的解释
- dd命令的解释
- dd命令的解释
- DedeCMS 栏目属性:最终列表、频道封面、外部连接以及栏目内容
- Django学习笔记11-使用表单
- Ubuntu下两种修改ip地址的方式
- 分享两个免费在线shell
- 关于官方的micropython demo 的使用
- 进入geth交互平台的命令大全解释
- 安装 Laravel 出问题了?你可能需要修改 composer.json 文件
- errorcode: 230 uid: -1 appid -1 msg: APP Scode码校验失败
- 字符串与字节数组 字符数组的转换
- ViewPager+Fragment实现3D立方体滑动效果
- 洛谷上的2道简单的01背包问题
- Freemark学习(三):流程控制语句&list&map获
- java转换字符串的编码
- [LeetCode] Search in Rotated Sorted Array II