Hot answers tagged

24

On the daemon side (bitmonerod) P2P Port is the one used to connect with the other nodes on the network (or locally in some cases). RPC port (Remote Procedure Call) is used to let other applications such as simplewallet or the GUI interact with the daemon, for instance to get information about a block. Default ports for the daemon are P2P: 18080 for the ...


11

I cannot speak to all of the pros/cons of using zmq, as it was decided upon before I started work on it. So far, I'd say that if you use it well it gets out of your way, but does all the networking things that are simply tedious and error-prone. I'm sure there are other solutions that are adequate for this, but zmq seems to be pretty good and is available ...


9

Knowing the transaction fee in advance is not possible [1], due to two reasons: the output selection is randomized, so sending, eg, 100 monero several times will potentially need different fees, for example if one tx needs just one 150 monero input (small tx, small fee), but a second attempt happens to pick many 1 or 2 monero inputs (larger tx, larger fee). ...


9

You can run Monero without an open port but others will not be able to connect to your node in order to help synchronize their nodes. Open port 18080 to allow incoming P2P connections. The RPC port is 18081. print_cn will help you verify your incoming connections are working


8

Ok i managed to do it, here is the code: String curlCode ="./getBalance"; System.out.println(curlCode); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream old = System.out; System.setOut(ps); InputStream is = Runtime.getRuntime().exec(curlCode).getInputStream(); InputStreamReader isr = new ...


7

In addition to efficiency improvements over the current RPC system, OMQ will enable walletnotify and blocknotify functionality. After OMQ is merged, the new RPC API notification can be made compatible with Bitcoin. This compatibility will help streamline Monero integration by merchants and service providers. OMQ will also help facilitate RPC ...


7

The dev branch has been canned, and the 0MQ effort is being refactored / partially rewritten by tewinget. Unfortunately the net_skeleton licensing issue isn't one we can work around, as far as we can tell, so we are actively looking at an alternative. Note that you can, right now, stick something like nginx in front of it to handle both authentication and ...


7

The bitmonerod defaults are: Mainnet: P2P: 18080 RPC:18081 Testnet: P2P: 28080 RPC: 28081 The wallet's RPC port has no default. Wallet and daemon may use 53 for DNS, which is optional. It is recommended to only open the RPC port on your firewall if you need to access RPC from the outside, especially for the wallet.


7

The method is get_outs. Here is an example of a query: curl -X POST http://127.0.0.1:18081/get_outs \ -d '{"outputs" : [{"amount":500000000000, "index":154735}]}' \ -H 'Content-Type: application/json' Result: { "outs": [{ "height": 141288, "key": "29a5f6af06999f1c61c97a415c4ac02a38be8a09be090a76fcf5abc2dad3fc1e", "...


6

Yep! That can totally work. We'll call your headless node the Monerodo for simplicities sake (Monerodo = Monero Node). On the Monerodo you want to launch monero with the following flag: monerod --rpc-bind-ip IP.OF.YOUR.MONERODO This tells your daemon to listen to RPC calls on the IP address provided. Then on your other computers, you just run the wallet ...


6

This is a basic networking question, not specific to Monero. 0.0.0.0 means "any address" - it will bind to every network interface on the machine. So it will listen to requests from anywhere. Using a specific address means it will only bind to that single address. Using 127.0.0.1 is the loopback address, so it will only listen to requests originating on ...


5

I think you should have a look at Monero's official Wallet RPC documentation. There's an example for each command. Update: Those examples use the curl utility to send the HTTP request. The meaning of the parameters can be looked up in the man page.


5

If you previously ran simplewallet in CLI mode (or 0.10's monero-wallet-cli in RPC mode) then you would simply transition to using monero-wallet-rpc with the same flags. As always, running the binary with --help will give you a list of all possible flags.


5

This isn't available in the wallet software yet, but it is technically possible to set an "unlock_time" on a transaction: How to use unlock_time? The idea being that you could pass a future date in UNIX time into this RPC call which would cause funds to be locked until that time has passed. You could then use this to send all of your funds back to your own ...


5

Run a local daemon, and then use the daemon RPC API to query it for blocks: https://getmonero.org/knowledge-base/developer-guides/daemon-rpc


5

The "human friendly" amounts have a decimal place at 12 digits, so in this case, 140000000000 atomic units would be 0.140000000000 monero.


5

The getbklocktemplate RPC returns a blockhashing_blob and a blocktemplate_blob. You can either try to find a nonce (4 bytes) by mining using the blockhashing_blob, or you can try to find two nonces (4 bytes in the block header, reserved_size bytes in the extra field of the mining reward transaction) using the blocktemplate_blob and computing the transaction ...


5

Quoting the relevant commit message: daemon, wallet: new pay for RPC use system Daemons intended for public use can be set up to require payment in the form of hashes in exchange for RPC service. This enables public daemons to receive payment for their work over a large number of calls. This system behaves similarly to a pool, so payment takes the form of ...


4

Here's the curl command I use: curl -X POST http://127.0.0.1:5000/json_rpc -d '{"jsonrpc":"2.0","method":"getbalance","id":"test"}' -H "Content-Type: application/json" Your JSON seems to be formatted entirely incorrectly, as name=value pairs, so check the library you're using to produce the JSON.


4

The HTTP url is: http://127.0.0.1:18082/json_rpc When you mean with HTTP url, a url that you can type into your browser, than its not possible to achieve the same request with only the HTTP url. Alternative to curl you could use the chrome App Postman to play around with the json_rpc api. Postman Post is the called HTTP method. The -d is the payload, in ...


4

To set the user agent, when you are launching simplewallet you want to do something like the following: ./simplewallet --wallet-file <filename> --password <password> --user-agent <user-agent> --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18082 So you use the --user-agent flag. At this time, I do not know the limitations of user agent ...


4

A "node" is the monerod daemon. It can support arbitrarily many wallets connecting to it concurrently. A wallet generally supports only one user at a time.


4

It looks like you are attempting to bind to your public internet address, which is the address of your router. This will not work, because you need to bind to an IP address that is actually attached to your local network interface (the IP address of your computer on your local network). If you bind to that, then traffic that hits your router's public ...


4

Since Monero 0.15.0.0, you can use the public_nodes command in monero-wallet-cli. It will query your daemon, as the list is now shared over the P2P network. This can be used in tandem with the bootstrap daemon mode, so you can use RPC services before your node has finished syncing. Similarly, the print_pl daemon command now accepts a publicrpc parameter to ...


3

Once you have setup the tunnel, it is equivalent to having monerod running in localhost. It is transparent for monero-wallet-cli and monero-wallet-gui. The only difference, that i noticed so far, is that it doesn't accurately detect network failures, as the connexion with the tunnel manager stays up. You can see here an example of setup using stunnel.


3

I took a look over here: https://en.wikipedia.org/wiki/Digest_access_authentication and from how I understand it you must do the following Get the nonce and realm from that first message: algorithm=MD5,realm="monero-wallet-rpc",nonce="hHQVNuEdyZszjmEPwS/jkQ==" Then use the following flow: HA1=MD5(MD5(username:realm:password):nonce:cnonce) //cnonce is a ...


3

monerod has a get_transaction_pool RPC call: curl -X POST http://127.0.0.1:18081/get_transaction_pool -d '{}' -H 'Content-Type: application/json' This will return the current state of the tx pool. Each transaction in the pool has this information: std::string id_hash; std::string tx_json; // TODO - expose this data directly uint64_t blob_size; ...


3

There is no RPC to create an address. If there would be one, it would be one that would also "forget" the current one, so it would have limited usefulness. If you want to have your own code to create addresses, you can either take code from wallet2.cpp and the cryptonote libraries, or use the Javascript version as a base: https://moneroaddress.org/


3

I probably miss the point of using an external program, but if you want to do it in Java only it can be done as follows: public class MoneroClient { private int requestId = 0; private JSONRPC2Session rpcSession; public MoneroClient(String url) throws MalformedURLException { rpcSession = new JSONRPC2Session(new URL(url)); } ...


3

There is none. This is a good candidate to open a bug on https://github.com/monero-project/bitmonero/issues. It's also a good first task for a new contributor, and if none pick it up, it'll get done by an existing one.


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