ChainMovers / suibase

Sui development environment and cookbook.
https://suibase.io
Apache License 2.0
35 stars 6 forks source link

static DNS for genesis address #20

Closed mario4tier closed 1 year ago

mario4tier commented 1 year ago

sui-base helper should provide a mean to get client addresses "by name".

This is for test setup that need either multiple address at same time, or coordinate to have various software "parts" not collide using the same.

For now, only genesis address will have a name and they can't be changed.

Simple Implementation Information will be available in a read-only JSON map:

~/sui-base/workdirs/<workdir name>/.state/dns

{
    "known": {
        "<address name\>": { "address": "0x..." },        
    }
}

Example:

{
    "known": {
        "sb-1-ed25519": { "address": "0x038fddd909e46fd8853a518a3c7518c67e51bc5a" },
        "sb-2-ed25519": { "address": "0x130e3a131cd0c5249114e3d0cc4ba78ff61dd482" },
        ...
        "sb-5-ed25519": { "address": "0x2c3feb9d53b3507377c81f2b5de87ea8ea6385d2" },
        "sb-1-secp256k1": { "address": "0x464e289e078ef5560ffa3d6ea0e61795780d9826" },
        "sb-2-secp256k1": { "address": "0x92f23d8a5a48dd0e2d4052f0a9e757fcb39fc85b" },
        ...
    }
}

String format is: sb-<index>-<key type>

Future Plan (thought for fun): User dynamic "DNS" is not plan unless there is a use-case for it AND a sui-base service daemon is implemented (to handle concurrency). Another potential variation would be a pre-funded address pool.