> For the complete documentation index, see [llms.txt](https://neochain.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://neochain.gitbook.io/project/eos/zhi-neng-he-yue-shi-yong-dan-ji-dan-jie-dian-duo-qian-bao.md).

# 智能合约使用（单机单节点多钱包）

## 本节延续上一节内容

## 账号列表

| 账号ID      | 账号含义 | 钱包        |
| --------- | ---- | --------- |
| eosio     | 矿工1  | -         |
| token1    | 交易所1 | default   |
| hospital1 | 医院1  | default   |
| patient1  | 患者1  | default   |
| hospital2 | 医院2  | hospital2 |
| doctor2   | 医生2  | hospital2 |

## 创建钱包及用户

```
#创建钱包
cleos wallet create -n hospital2
"PW5JxnbBTTbTQKUHHNvYojU1xrcjxQduz2wU6gfMEgiZjwT5S6xJ6"

#查看钱包列表
cleos wallet list

#创建并导入key
cleos create key
Private key: 5KZS8Q9MVniCbLY2RxjSWruM5YvfDPteP3qQDM23YP5ngwvqHMt
Public key: EOS8K9wqRtD8cCuHvbdzcquEhYHnSaFvyQSWm8kVxYFHavraNeue2

cleos wallet import -n hospital2 5KZS8Q9MVniCbLY2RxjSWruM5YvfDPteP3qQDM23YP5ngwvqHMt 

#创建用户
cleos create account eosio hospital2 EOS8K9wqRtD8cCuHvbdzcquEhYHnSaFvyQSWm8kVxYFHavraNeue2 EOS8K9wqRtD8cCuHvbdzcquEhYHnSaFvyQSWm8kVxYFHavraNeue2 
cleos create account eosio doctor2 EOS8K9wqRtD8cCuHvbdzcquEhYHnSaFvyQSWm8kVxYFHavraNeue2 EOS8K9wqRtD8cCuHvbdzcquEhYHnSaFvyQSWm8kVxYFHavraNeue2 

#查看用户列表
cleos get accounts EOS8K9wqRtD8cCuHvbdzcquEhYHnSaFvyQSWm8kVxYFHavraNeue2

#查看eosio下级用户
cleos get servants eosio
```

## 跨钱包转账

```
cleos push action token1 transfer '["patient1", "hospital2", "50.0000 YR", "Remote Diagnose" ]' -p patient1
```

## 钱包锁定后，不能花钱，只能收钱

```
#锁定patient1所在钱包
cleos wallet lock -n default

#转账会失败
cleos push action token1 transfer '["patient1", "hospital2", "50.0000 YR", "Remote Diagnose" ]' -p patient1

#解锁patient1所在钱包，锁定hospital2所在钱包
cleos wallet unlock -n default
cleos wallet lock -n hospital2

#转账会成功
cleos push action token1 transfer '["patient1", "hospital2", "50.0000 YR", "Remote Diagnose" ]' -p patient1

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://neochain.gitbook.io/project/eos/zhi-neng-he-yue-shi-yong-dan-ji-dan-jie-dian-duo-qian-bao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
