My node is compatible with EVM and I would like to connect it to metamask?
In terms of chainId, if you just want to connect to it, you can just enter whatever you like and it'll publish what ChainId is detected at that address:
However if you are interested on where this is derived, it depends on your implementation. e.g. for moonbeam: https://github.com/PureStake/moonbeam/blob/6d7206efed3892e8a371666104c33b3113b57eaa/runtime/moonbeam/src/lib.rs#L237
Note: If you are trying to connect your metamask to a node not on the same machine, you'll need to use the flag
--rpc-external to accept connections from a different IP.