Skip to content

RFC: Explore running a node and wallet in the same process - #778

Draft
wiesche89 wants to merge 23 commits into
mimblewimble:stagingfrom
wiesche89:embedded_node
Draft

RFC: Explore running a node and wallet in the same process#778
wiesche89 wants to merge 23 commits into
mimblewimble:stagingfrom
wiesche89:embedded_node

Conversation

@wiesche89

Copy link
Copy Markdown

Adds an optional --embedded-node mode that runs a Grin node and wallet in the same process.

Example:
grin-wallet --embedded-node --testnet owner_api --run_foreign

ardocrat and others added 23 commits May 14, 2026 12:58
* build: update rust edition 2021

* cargo: format all

* build: fix tests and warnings
* scan: save last scanned block info for initial wallet scanning

* scan: save start height at scanned block info on outputs collecting

* scan: 10k blocks batches

* fix: include last height into batch on scan

* scan: save hash of last block

* scan: add larger window (2880 blocks) to scan outputs when updating wallet state

* add test batched scan and resume, add scan doc

* rename corrupted restore test

---------

Co-authored-by: Joerg <wiesche89@googlemail.com>
* wallet: update lmdb from store crate, migrate single backend from trait to struct, update tests cargo deps and design doc

* backend: do not panic on iter and directory creation

* return  iterator errors

* build: update to last node revision

* fix: height selection for scan, remove unused mutability for wallet

* wallet: remove unused mutability conversion

* tx: store slate state at database

* build: cargo fmt

* fix: do not return error when slate not found on tx slate state update

* lmdb: do not collect all tx log records at iterator, show read errors at log

* fix: save slate state, return error if slate not found

* tx: specify amount of bad txs on slate state update error

---------

Co-authored-by: Joerg <wiesche89@googlemail.com>
* build: use node submodule as dependency

* ci: checkout submodules

* docs: add contributing and build instruction

* ci: update release build

* git: remove old submodule

* git: grin staging submodule

* git: add submodule dir
* tor: integrated client for listener, update tokio to last version

* tor: send transaction with integrated client

* build: code format

* tor: optimize bootstrap percent check

* tor: handle config build error

* tor: do not show slatepack address if tor not launched

* tor: handle keystore errors

* tor: keep service launched

* tor: bootstrap timeout, clean cache before client launch

* tor: post request timeout

* fix: post timeout

* build: update deps after merge

* tor: store arti runtime

* tor: do not send over tor if `manual` arg presents or `skip_send_attempt` set at config

* fix: arg name

* tor: handle arti runtime creation error

* tor: handle connection error

* tor: handle bootstrap error

* tor: handle start service name error

* tor: handle service config creation error

* tor: service proxy errors

* tor: handle service key creation emptiness

* build: format code

* build: update arti to 0.43, hyper to 0.10.1

* api: start foreign listener before tor connection

* tor: handle json parse errors

* tor: prevent to create several client runtimes, ability to recreate

* tor: return bootstrap error

* tor: handle host parse error

* tor: restart proxy on error

* tor: do not use integrated client when config value use_integrated is missing, add logging

* build: update lock file
* tor: global client state

* tor: optimize init client thread-safety

* tor: handle config change on client init

* tor: add logging for client reuse or reinit

* tor: do not reuse arti client for requests
… slate state after tor finalization on receive
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	api/Cargo.toml
#	api/src/foreign.rs
#	api/src/owner.rs
#	config/Cargo.toml
#	controller/Cargo.toml
#	controller/tests/common/mod.rs
#	impls/Cargo.toml
#	libwallet/Cargo.toml
#	util/Cargo.toml
* build: update grin submodule to last staging

* build: update grin submodule

* build: remove remove_dir_all dependency

* build: update rpassword

* build: update semver

* build: remove unused deps

* build: update ring

* build: update lock file deps

* build: update rustyline

* build: update ed25519-dalek

* build: update curve25519-dalek

* build: update age

* build: update uuid

* fix: uuid test

* build: update x25519-dalek

* fix: x25519-dalek build

* build: update arti

* build: update grin submodule

* build: update hyper

* fix: initialize rustls provider for tests

* build: update grin submodule

* fix: rustls install provider

* tor: share getting private key

* fix: show an error on node version parse

* cli: renamed prompt password method

* fix: replace into_boxed_slice with try_from

* fix: dalek tests for onion

* config: comment expanded secret key

* fix: import api body for controller

* password: handle prompt error

* wallet: parse node error message

* tests: do not use random values for sign messages

* build: make hook executable

* build: cargo format all

* rustls: do not install provider at tests and globally

* build: update grin submodule

* build: fix api channel from grin submodule

* args: use read_password for piped prompt

* build: remove unused dep

* test: fixed signature

* preserve piped pw input

---------

Co-authored-by: wiesche <wiesche89@googlemail.com>
* build: update lodash to 4.18.1

* fix: readme

* docs: add owner api authentication setup

* build: update package-lock.json to version 3

* fix: token result, inline some vars

---------

Co-authored-by: ardocrat <ardocrat@gri.mw>
* config: global instance

* fix: cli tests

* fix: owner api tests

* config: save tor config

* fix: owner rpc tests

* fix: set config file path on init and owner api call

* tor: store launched services, get global config at command loop, remove unused listen args, check for empty global config to set default, do not save empty tor config at owner

* api: update config in memory after successful file write

* arti: restart proxy in loop

* fix: comment for tor config save

* config: set or init, update without error

* config: scoped tor config

* build: update lock file

* config: ability to store multiple configurations at memory from config path

* tor: restart service on config change

* fix: owner api test

* foreign: pass tor config from args, stop service, error handling

* arti: move runtime wrapper to single file

* config: read existing config from file at create_config

* config: handle error on read

* arti: single dir for cache

* foreign: register config listener before launch

* config: save temp

* config: remove unused error type

* config: make path and members not optional, return an error on config creation if it exists, pass default tor config to send if not set

* arti: non public runtime wrapper

* config: migrate comments

* fix: rpc tests

* config: return from cache if exists

* config: save disabled tor config when null provided at owner and tor section was not set

* config: update tor with args at listener

* config: pass pathbuf directly on creation

* config: unique tmp file name, setting permissions and providing config version

* fix global config handling

* fix config persistence

* fix tor service restart

* fix config synchronization

* require wallet close before changing data directory

* unify global config updates

---------

Co-authored-by: wiesche <wiesche89@googlemail.com>

@ardocrat ardocrat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean wallet should be able to use client commands to see node stats?

@aglkm

aglkm commented Jul 26, 2026

Copy link
Copy Markdown

What's the use-case for this feature?

@wiesche89

wiesche89 commented Jul 27, 2026

Copy link
Copy Markdown
Author

Does it mean wallet should be able to use client commands to see node stats?

Not at the moment. This PR only starts the node and connects the wallet to its local API. It doesn’t expose the grin client commands through grin-wallet

What's the use-case for this feature?

This is mainly meant as a starting point for discussion.. The idea is to make setups like a Stratum server with a wallet, or a wallet bot, easier to run. They can start the wallet and node together instead of having to manage a separate grin process. It’s optional, so the normal wallet setup stays unchanged.

@wiesche89 wiesche89 changed the title Add embedded node mode RFC: Explore running a node and wallet in the same process Jul 27, 2026
@wiesche89
wiesche89 marked this pull request as draft July 27, 2026 19:02
@wiesche89
wiesche89 force-pushed the staging branch 2 times, most recently from eccb1ee to 2743dff Compare August 9, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants