Create an account with the open strategy
The open strategy allows for registering new accounts without paying the registration fee. However, it's important to note that the open strategy does not require funding a non-existent account. Therefore, you should proceed with caution when using this strategy in the production environment.
To enable account creation using the open strategy, you must add the following configuration details to the
chromia.yml
file:
src/chromia.yml
blockchains:
open:
module: main
compile:
rellVersion: 0.13.5
database:
schema: schema_open
test:
modules:
- test
libs:
ft4:
registry: https://bitbucket.org/chromawallet/ft3-lib
path: rell/src/lib/ft4
tagOrBranch: v0.8.0r
rid: x"B6AE6AC82AC735BFB9E4E412FFB76BF95380E94F371F5F6A14E71A3AA7D5FEF6"
insecure: false
After adding the configuration details, you need to import the open
strategy and create a new operation to register accounts using the imported lib.ft4.accounts.strategies
library. This can be done as follows:
src/main.rell
module;
import lib.ft4.accounts.strategies;
import lib.ft4.accounts.strategies.open;
operation custom_register_account() {
val account = strategies.register_account();
}
For a complete code example, refer to the Cookbook repository.