-
Notifications
You must be signed in to change notification settings - Fork 266
DNA dev mode #1302
Description
Half-baked idea, please expand:
#1300 is probably a pre-requisite for this to work
DNA dev mode
Currently, DNA addresses are always specified by the hash of the DNA bundle. For development purposes this is problematic, because every code change results in a new DNA address, and total loss of data.
How about we have a dev-mode DNA config, where instead of pointing to a built DNA package, the config points to a source directory containing its code, and the user specifies a string to use as the DNA address, rather than the hash. Then a developer can keep hacking away at the code without losing the source chain in between changes.
[[dnas]]
id = "dna-id"
dev_source = "path/to/dna/project"
# omit `file` and `hash`Caveats
This would make it vastly easier for people to join networks as bad actors, so maybe we would also disable or severely limit networking for DNAs in test mode, or simply prevent users from entering actual DNA hashes as dev-mode addresses.
Of course it would also open up the possibility of a user ruining the integrity of their source chain because of validation rules changing over the lifetime of their DNA, but they're in hack mode and it's up to them to manage. This is analogous to hot-reloading -- for some changes you can hot-reload, but sometimes you just have to restart fresh to clear out the inconsistent state.