Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

How to Encrypt & Restrict RPC Communication to Trusted Clients #10917

Answered by zicklag
zicklag asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, nevermind, I think I just figured it out!

In the node template we have:

let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
		network: network.clone(),
		client: client.clone(),
		keystore: keystore_container.sync_keystore(),
		task_manager: &mut task_manager,
		transaction_pool: transaction_pool.clone(),
		rpc_extensions_builder,
		backend,
		system_rpc_tx,
		config,
		telemetry: telemetry.as_mut(),
	})?;

The rpc_handlers object can be used to send and receive requests from the RPC server. I can create my custom websocket server separately and then send it the decrypted requests using the rpc_handlers struct.

Then all I have to do is set the Configuration so th…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@zicklag
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by zicklag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants