有没有办法确定命名空间是否已在 Chainweb 上使用?

Is there a way to determine if a namespace is already taken on Chainweb?

Pact language reference entry on namespaces 中,文本明确指出在 public 区块链上,模块和接口必须在命名空间内定义,并且命名空间必须是全局唯一的。

Namespace declarations provide a unique prefix for modules and interfaces defined within the namespace scope. Namespaces are handled differently in public and private blockchain contexts: in private they are freely definable, and the root namespace (ie, not using a namespace at all) is available for user code. In public blockchains, users are not allowed to use the root namespace (which is reserved for built-in contracts like the coin contract) and must define code within a namespace, which may or may not be definable (ie, users might be restricted to “user” namespaces).

如果我正在编写一个智能合约并且需要定义一个命名空间,有什么方法可以让我验证我的命名空间是否是唯一的?

使用(list-modules) 获取现有模块及其全名space 名称的列表。您也可以从 Chainweaver 列出它们。 请注意,如果没有 Kadena 分配给您,您不能在测试网或主网上创建名称 space。如果您想在 public space 中部署而无需获取名称space,请使用现有名称space 免费或用户。