Noobs questions about Full node, it's not on the Wiki v0.1 (will be helpful for all)

Hello everyone, I deployed a full node according to Wiki via Docker (instrucion), I have few questions, from simple to complex, for example:

  1. The Wiki has commands for Bor and Heimdall, but they are for packages and Binaries, but not for Docker, please tell me a couple of examples
eth.syncing.currentBlock * 100 / eth.syncing.highestBlock - Calculates the remaining percentage for block synchronization.

`admin.nodeInfo.enode` -  Retrieves the public enode URL of the node.
  1. how to get information about a block, please show me an example of a command (including Docker) that will display information about a any block from my server, like etherscan

  2. please tell me how to make remote access so that you can request commands from step 2 remotely

Sorry for the possibly stupid questions, but I deployed a node so as not to contact other servers, but to receive information about blocks and transactions from a local computer on the network, for example, to search for all transactions in my wallet (if anyone knows such a command via docker in the blockchain - I will be extremely grateful)

The commands are the same whether you use docker or not. With docker, the binaries and dependencies are bound within the container. You can use the same commands in the docs to interact with your node, but you’ll need to either enter the container or use docker exec. You’ll have to familiarize yourself with the docker image and the locations of binaries, whether the image contains bash or sh, possibly build your own image to suit your preferences. If you’re hoping to use your node to connect a dapp to for querying, you might need to expose certain ports in your container and modify listening addresses to listen outside of localhost.

The local node you’ve deployed will still need to “interact with other servers” in order to remain synced and fetch blocks from other nodes. If you’re trying to do this without connecting to the internet, you wouldn’t stay synced.

This is how you can fetch the latest block from your node, as an example:

curl -s -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://url:port ```

If you wanted to enter a current running instance of bor to execute ipc commands inside of a docker container, named bor_node, you could try something like docker exec -it bor_node bor attach /path_to_data/bor.ipc

First, Thank you Sir for the answers ))

I would like to continue the dialogue with you and with other participants who read this topic

you wrote:

If you’re hoping to use your node to connect a dapp to for querying, you might need to expose certain ports in your container and modify listening addresses to listen outside of localhost.

yes, I understood this, but the main questions what the ports and where the manual for using this ports (seen in configs some points)?

If you’re hoping to use your node to connect a dapp to for querying, you might need to expose certain ports in your container and modify listening addresses to listen outside of localhost.

yes, ofcource, but again the question - where I need to open port/access and what query language is used there

curl -s -X POST -H ‘Content-Type: application/json’ -d ‘{“jsonrpc”:“2.0”,“method”:“eth_blockNumber”,“params”:,“id”:1}’ http://url:port ```

doesn’t work because I don’t know the port (again)

f you wanted to enter a current running instance of bor to execute ipc commands inside of a docker container, named bor_node, you could try something like docker exec -it bor_node bor attach /path_to_data/bor.ipc

doesn’t work but…

root@nft:/w/data/bor# ls
bor  bor.ipc  config.toml  genesis.json  keystore

root@nft:/w/data/bor# docker exec -it bor bor attach /w/data/bor/bor.ipc
Fatal: Unable to attach to remote bor: dial unix /w/data/bor/bor.ipc: connect: no such file or director

for those who have just connected ))), a short story - I built a Full node according to Wiki, everything works, but now the question is how to view a block locally or over the network, how to view the details of any transactions, and so on, the configuration is done on Docker

How do you know everything works if you’re not able to query the node? lol.

The polygon wiki shows you how to map ports in a docker run command, using the -p flag. One tricky element is the listening address, which is mentioned sort of in the docs

[jsonrpc]
    ipcpath = "/var/lib/bor/bor.ipc"
    [jsonrpc.http]
        enabled = true
        port = 8545
        host = "0.0.0.0"
        api = ["eth", "net", "web3", "txpool", "bor"]
        vhosts = ["*"]
        corsdomain = ["*"]
    [jsonrpc.ws]
        enabled = true
        port = 8546
        prefix = ""
        host = "0.0.0.0"

By default the host is localhost, which won’t respond to requests coming outside of a container, since from the perspective of the container it’s not coming from localhost, and cors might also be blocked, so specifying [“*”] will allow anything, and 0.0.0.0 as the host listens on all addresses, but you might need to be more specific depending on how you plan to use it and how secure you want your exposed apis to be. Anyways, for any of these flags you can ask bor or heimdall for help and it’ll give you help about the flags. bor --help, bor server --help. You can also add any flags there and if you’re not sure how to place it into the config, add the flags you need and dumpconfig to see how to do it. See how I can find where it places the --http.port=9999 into the config like so:
image
image

Lastly, the way you’re using docker exec to attach to bor failed because you tried to access the host path of the container data inside of the container, which will usually have a different path than that of the host. In the docs it has you run bor like this: docker run -p 30303:30303 -p 8545:8545 -v /mnt/data/bor:/bor-home:rw --net polygon --name bor -d --restart unless-stopped 0xpolygon/bor:0.4.0 server --config /bor-home/config.toml

The host data is at /mnt/data/bor and the container places it in /bor-home. So when you exec you might try docker exec -it bor bor attach /bor-home/bor.ipc

I know that everything is fine thanks to the logs.

Anyways, for any of these flags you can ask bor or heimdall for help and it’ll give you help about the flags. bor --help , bor server --help .

yes, yes… go to man, ok )))

Lastly, the way you’re using docker exec to attach to bor failed because you tried to access the host path of the container data inside of the container, which will usually have a different path than that of the host. In the docs it has you run bor like this: docker run -p 30303:30303 -p 8545:8545 -v /mnt/data/bor:/bor-home:rw --net polygon --name bor -d --restart unless-stopped 0xpolygon/bor:0.4.0 server --config /bor-home/config.toml

The host data is at /mnt/data/bor and the container places it in /bor-home. So when you exec you might try docker exec -it bor bor attach /bor-home/bor.ipc

thanks, good advice, I didn’t realize it right away