Hot answers tagged

9

--rpcaddr 127.0.0.1 starts the JSON RCP on the localhost network and only connections from your local machine reach the geth server --rpcaddr 0.0.0.0 starts the JSON RPC on all interfaces and any network can initiate the connection to your geth server If you need to allow connections only from the localhost network you should use 127.0.0.1 If you need to ...


4

geth --rpc starts the rpc interface. The rpc interface is required to be able to connect with clients (websites, for example) that want to access the Ethereum blockchain. Use options --rpcaddress and --rpcport to set address and port of the rpc interface. With --rpcapi you can limit access via rpc to certain apis. Also, --rpccorsdomain has to be set in many ...


4

web3.eth.getCoinbase() returns the account that your mining rewards go to. web3.eth.getAccounts()[0] returns the first account you created (index 0) Web3.js doesnt expose this API (probably because from an application level , there aren't strong use cases for it ), but it is possible to set your Coinbase (Etherbase) to any of your accounts using from the ...


3

In general you need support from the contract to be able to query for existing token holders. If the token is ERC-20 compliant then you can retrieve all Transfer events generated by the contract. Then sender and recipient can be token holders, to ensure that you have to check if their balance is non zero. If the token contract do not to generate events, ...


3

db enables these functions: db_putString db_getString db_putHex db_getHex net enables these functions: net_version net_peerCount net_listening As stated in: https://github.com/ethereum/wiki/wiki/JSON-RPC


3

ChainId can be considered to be derived from the signature of a transaction, as described in EIP 155 - in the case of all of these transactions, they have the previous transaction format, where chainId is not present, which you can verify by checking the v value of these transactions (they are all 27 or 28, 0x1c or 0x1b).


2

As discussed here, I think rpc.NewIPCClient is deprecated and replaced by rpc.Dial("****"). herefore, you can use : client = ethclient.Dial("http://*.*.*.*:8545"). From this example you'll find this snippet code: func getBalance(address common.Address) { client, err := ethclient.Dial("http://localhost:8545") if err != nil { fmt.Printf("%...


2

Below steps is what you need to do: 1. Open the SSH console for transaction node by running ETHEREUM-RPC-ENDPOINT Ssh script on powerShell. You can find the script on Azure portal, sthing like ssh -p 3000 gethadmin@yourVM.southeastasia.cloudapp.azure.com 2. Edit the file start-private-blockchain.sh. In order to edit this file, or you use VIM editor (...


2

IPC-RPC API honors unix system users rights. You can control the IPC access via tools like chmod on the IPC socket. HTTP-RPC API is agnostic to the user account and should work for any users connecting to the HTTP endpoint locally or remotely. However, you have control over the access via Parity config: --no-jsonrpc Disable the JSON-RPC ...


2

Using QuickBlocks: https://www.youtube.com/watch?v=c_KNulh3PF4&t=2s to build a cap table of an ERC20 token.


2

To connect to AWS instance via RPC you have to assign the public IP of that instance as the rpc address. geth --rpc --rpcaddr "Public IP of AWS" --rpcport "8545" --rpccorsdomain "*" console If it was behind any proxy server then you have to redirect the request from a proxy server to your AWS server through port forwarding.


2

try to use the option : --nat value NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>) (default: "any") if your router supports upnp go for : --nat upnp


2

Well, have been searching all day long. At last I tried posting the question on stackexchange and just 20 minutes later I seem to find the answer to my own question. https://github.com/paritytech/parity/wiki/Public-Node running parity with --public-node seems to do the trick.


2

Someone can take your ether provided: The eth_* APIs are exposed over RPC (at a minimum). They usually are. You have at least one unlocked account, or accounts are unlocked during regular node operations (by other scripts, for example, or via the console). There are a number of bots out there that actively scan for ethereum nodes, and will continuously try ...


2

Setting up geth as a service - https://github.com/bas-vk/config/blob/master/geth-systemd-service.md Create a file geth.service: [Unit] Description=Ethereum go client [Service] Type=simple ExecStart=geth 2>%h/.ethereum/geth.log [Install] WantedBy=default.target Enable service $ systemctl --user enable geth.service $ systemctl --user start geth....


2

You may listen to many addresses via one subscription: https://web3js.readthedocs.io/en/1.0/web3-eth-subscribe.html#subscribe-logs Also you may omit address parameter and listen for all Transfer events from all tokens.


2

For 1 you may use web3.eth.getCode(address) function of Web3 API. For contract addresses it returns contract byte code, while for non-contract addresses it returns something like "0x". For 3 it depends on what "public" means for you. If you mean whether smart contract has verified source code published at Etherscan.io, then you may use either API call to ...


1

Thanks for the comments @carver and @Chris. Just as carver said in the comments, the problem is that personal api is not enabled by default and I didn't add the --rpcapi flag. solution option 1 : start geth with the flag --rpcapi personal,web3,eth and any other flags necessary. option 2 : use the eth.accounts, which is enabled by default.


1

Eth client's will use Devp2p protocol. Devp2p nodes communicate by sending messages using RLPx, an encrypted and authenticated transport protocol. Peers are free to advertise and accept connections on any TCP ports they wish, however, a default port on which the connection may be listened and made will be 30303. Devp2p nodes communicate in terms of ...


1

Better try to use ethereum transaction builed library for generating and signing transaction offline. And after just call sendSignedTransaction method: var Tx = require('ethereumjs-tx'); var privateKey = new Buffer('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex') var rawTx = { nonce: '0x00', gasPrice: '0x09184e72a000', ...


1

yes, do: eth.getBlock(0) If the hash is 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3 then it is public, otherwise it is private, test net or any other net that is not Ethereum Main Net. Though, it is not 100% certain, because you may also run a public net in isolated network, and create a chain split.


1

The newSymKey(); function returns a promise, which needs to be resolved, to get the returned value. This is why the error in version web3@1.0.0-beta.34 gives you a promise pending message with UnhandledPromiseRejectionWarning, and in the web3@0.20.5 version, the error states shh_newSymKey does not exist/is not available. [yet] So try var kId = web3.shh....


1

Do not unlock account on rpc provider node. If you are mining from same node, use separate nodes for mining and rpc. Connect them as peers and they will be safe from such attacks. How to secure a private chain? You can run geth on default setting provided you follow the secure procedures.


1

Geth's JSON-RPC API supports the ability to send/sign transactions. You will need to explicitly allow access to an unlocked account. If you don't care about security, you can allow personal via RPC and unlock the test account that way. See this answer on keeping insecure geth accounts. For signing and sending transactions, see eth_sign and ...


1

In order to call a function in a contract you need to encode the function name and parameters following Solidity ABI specification. If you want to do that for any functions and parameters it can be quite complex and using an existing library is easier. But implementing a subset for a known contract should be doable.


1

A good way to test rpc calls is to run a node locally, either a real ethereum node like Parity or Geth or a simulator like Ganache (formerly known as testrpc). Alternatively, you can interact with the live network or testnets via Infura, which provides free live RPC endpoints


1

Something like this. Just look for geth --help and you'll get the list of commands. Sorry, don't have a machine to check them now. :) "C:\Program Files\Geth\geth.exe" --networkid 2301 --datadir "D:\TestEth\node1" --identity "node1" --port 5001 --ipcpath "node1.ipc" --rpc --rpcport 7001 --rpccorsdomain "*" --rpcapi "admin,personal,eth,web3" --nodiscover


1

I had the same issue with web3 v1.0.0 beta 30. Never got to the bottom of it but skipping the provider construction appeared to fix it: var Web3=require('web3'); var web3 = new Web3('ws://10.244.5.43:8546');


1

I assume that you're using a version of Web3.js older than 1.0. I believe that the WebsocketProvider was added in 1.0.


1

If it is possible to connect through ssh then the ssh port is open. As such, try by connecting directing to the port through metamask. Another option would be to connect and open the browser remotely using X11 with the -X when ssh-ing. This option requires more connection power. Finally, try doing ssh tunneling from the local browser through the ssh port, ...


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