Skip to main content
35 votes

Retrieve CHAIN_ID of the executing chain from a Solidity contract

chainid is available in native solidity 0.8.0. So you can get chain id like block timestamp or block number. Here is the code. block.chainid; Documentation https://docs.soliditylang.org/en/v0.8.0/...
taijusanagi's user avatar
18 votes
Accepted

Retrieve CHAIN_ID of the executing chain from a Solidity contract

As of version 0.5.12, Solidity includes an assembly function chainid() that provides access to the new CHAINID opcode: function getChainID() external view returns (uint256) { uint256 id; ...
iamdefinitelyahuman's user avatar
10 votes

geth: config file documentation

You can use the dumpconfig option together with the command line parameters you would like use. geth will then create a config file for you which you can use, rather than creating it yourself. In ...
gisdev_p's user avatar
  • 1,801
5 votes
Accepted

What is the --force-sealing option in the parity for

By default you don't "seal", aka actually execute transactions in, a prospective block (in order to prepare to mine on top of it) unless you are mining or it is your turn being an authority in a PoA ...
Joshua Mir's user avatar
5 votes
Accepted

Parity configuration for rinkeby testnet

Parity does very well support proof of authority, but it does not implement the Clique engine required to join the Rinkeby test network. It just wont work out. If you want to join a PoA testnet, you ...
q9f's user avatar
  • 32.9k
4 votes

How to configure go-ethereum? (Config File)

First of all, there may be not such a conf file as you're looking for. Read this: Ubuntu The below relates to installs compiled from source. === C++ === AlethZero ~/.ethereum/ (contains the ...
KanekiDev's user avatar
  • 671
4 votes

Authentication of Ethereum Node on a private block chain

In a private blockchain, a new node cannot get automatically connected to the private network. That's why the network is private. Regarding authentication, the unique --networkid of your network and ...
galahad's user avatar
  • 3,930
4 votes

Authentication of Ethereum Node on a private block chain

you could take some measure to prevent undesirable nodes : 1- use the option --nodiscover Use this option to make sure that your node is not discoverable by people who do not manually add you. ...
Badr Bellaj's user avatar
  • 18.8k
4 votes
Accepted

Explain the relation between geth --miner.gaslimit and etherscan Gas Limit

Each block has a gasLimit field. A miner can increase or decrease it. This change is small, less than 0.05 % of the parent's value. So it cannot be changed immediately to an arbitrary value, usually ...
Ismael's user avatar
  • 30.5k
3 votes
Accepted

Is there a way to read hardhat config inside a script at runtime and console.log certain attributes?

Great question; try something like this: Use hre.network.config.url; Here is an example of how you can get the RPC Provider URL at runtime in your deploy.js script: const hre = require("hardhat&...
Isaac Lau's user avatar
3 votes

Is there a way to read hardhat config inside a script at runtime and console.log certain attributes?

If I understand correctly what you are trying to get in the updated part of the question, I think you can use hre.network.name, which is the name of the current network set in the config file that the ...
hellopeach's user avatar
3 votes

Retrieve CHAIN_ID of the executing chain from a Solidity contract

There isn't as of yet, but Istanbul (the upcoming hardfork) includes eip-1344, which includes a CHAINID opcode that pushes the chain id to the stack. I assume Solidity will add block.chainId or ...
natewelch_'s user avatar
  • 12.1k
3 votes

how to connect ethereumj with private node

Here is some sample code to connect ethereumj to a testnet from github - ethereumj-core/.../samples/TestNetSample.java: private final String config = // network has no discovery, ...
BokkyPooBah's user avatar
  • 40.3k
3 votes

Different use of .yaml and .toml file

I think you have to different types of configuration files because: .yaml file is to configure the smart contracts .toml file is to configure the blockchain itself with the genesis.json file. Once ...
FrenchieiSverige's user avatar
3 votes
Accepted

How can I configure Mist to use a non-default IPC path?

These answers must already be "old" :) .... On my Mac, Mist version 0.8.2, /Applications/Mist.app/Contents/MacOS/Mist --rpc /my/path/to/geth.ipc works fine. It works with RPC too (and an ...
Bruno Grieder's user avatar
3 votes

Setting up demo ethereum PoA

You need to map the external/public IP of your VM to its internal interface. You can use curl ifconfig.co or curl -4 http://l2.io/ip to get the external ip of your machine and set it for your ...
Igor Barinov's user avatar
  • 2,138
2 votes

Setting up demo ethereum PoA

From what I can tell, you're using two internal ip spaces. They will not talk to each other unless its on the same network. You should bind the public ip or replace the interface with interface star....
dunowat's user avatar
  • 31
2 votes

How to extract private keys from Ethereum Wallet?

The keystore is encrypted and default location in Linux is ~/.ethereum/keystore. You can use https://www.myetherwallet.com to get the raw private key. If you want to script this, you can for instance ...
ivicaa's user avatar
  • 7,519
2 votes

What do Ethhash and CliqueConfig refer to in the genesis config?

Ethash is the Proof-of-Work algorithm used by Ethereum. Design rationale and an explanation of the algorithm in pseudo-code can be found on the wiki (and has been discussed in previous questions - see:...
Richard Horrocks's user avatar
2 votes
Accepted

Can I add inline comments in peers.txt?

Doesn't look like it at present, though IMO it'd be a sensible addition to allow it. Perhaps open a new ticket with the Parity folks. The code is in configuration.rs. The only check it runs is using ...
Richard Horrocks's user avatar
2 votes

ERC-721 price control

There are a few concepts here a bit mixed up: a) Token value vs token cost If it's about value, the token price is linked to an offer-demand balance determined by the market, so nothing related to the ...
Sergi Juanati's user avatar
2 votes
Accepted

MetaMask - Quorum - Network - Custom RPC - Could not fetch chain ID. Is your RPC URL correct?

I believe you need to have cors enabled for Metamask, even though it's a local node. I suggest enabling cors and trying it. Note that you must use quorum geth for the init. If you use upstream geth ...
Satpal Sandhu's user avatar
2 votes

How does one run a Geth node with a configuration file?

As outlined in this blog post, as of Geth 1.6 there is support for specifying configuration parameters for your node in an external .toml configuration file. You can generate a configuration file by ...
Thomas Clowes's user avatar
2 votes

Is there a way to read hardhat config inside a script at runtime and console.log certain attributes?

The hre contains the default RPC at hre.ethers.provider.connection.url which will return something like http://localhost:8545.
hexcowboy's user avatar
1 vote
Accepted

I am getting a Source error when importing @Chainlink. My project will compile. How can I avoid this error, or should I just ignore it?

Linting issues If you see something along the lines of: ParserError: Source "OpenZeppelin/[email protected]/contracts/access/Ownable.sol" not found: File not found. import "@...
Patrick Collins's user avatar
1 vote

Brownie AttributeError: 'NoneType' object has no attribute 'get'

fixing indentation on Brownie config: file solved that problem for me but now i have this problem: 'dictionary update sequence element #0 has length 1; 2 is required'
s.a's user avatar
  • 11
1 vote

Run Geth with a configuration file

You must specify the --ropsten parameter geth --ropsten --config /home/path-to-config If for some reason you don't want to use the ropsten parameter, follow the instructions below. dump the ropsten ...
Giuseppe Bertone's user avatar
1 vote
Accepted

What is the use case of Parity's passive sync mode?

Parity passive basically lets you to fine tune the way how active your node is. This can be due to multiple reasons: energy consumption of IoT devices (less CPU cycles, etc.) bandwidth consumption on ...
q9f's user avatar
  • 32.9k
1 vote
Accepted

Different use of .yaml and .toml file

The prior answer regarding the file types is correct. The TOML format is simpler and is used throughout Eris (Monax) configuration files, e.g. chain configuration or docker image versions (~/.eris/...
BTCETHswap's user avatar
1 vote

How do I configure a home.parity address for my parity node browser?

Parity is using https://en.wikipedia.org/wiki/Proxy_auto-config (the file you pasted). You have two options: Configure your system to use that proxy auto-configuration file (you will be able to use ...
todr's user avatar
  • 361

Only top scored, non community-wiki answers of a minimum length are eligible