Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
还可以使用本工具直接查询区块链上的数据。


如何使用(针对程序猿,需要事先安装好git、node和npm/cnpm)
如何使用(针对程序猿,需要事先安装好`git`、`node`、`npm`/`cnpm`
1. git clone https://github.com/fractalplatform/webWallet.git
2. cd webWallet
3. npm i
4. npm run start -- -p 8080
5. 在浏览器中访问http://localhost:8080, 节点信息设置按钮位于网页右上角处,默认链接本地节点(http://127.0.0.1:8545),如需链接FT公链的测试网络请更改链接为:http://node.pub-fractal.com
5. 在浏览器中访问 `http://localhost:8080`, 节点信息设置按钮位于网页右上角处,默认连接本地节点(`http://127.0.0.1:8545`),如需连接FT公链的测试网络修改`./src/utils/constant.js` `BASE_URL`为:`http://node.pub-fractal.com`

### 用户使用指南:
由于Fractal采用了更容易记忆的账号体系来包装难以记忆的公私钥账号,因此在钱包里,我们需要先生成或导入公私钥,然后再生成容易记忆的账号,将公钥同账号绑定后即可使用(如转账、发行资产等操作),具体操作如下:

- 进入账户管理一栏中的“密钥”子栏目
- 对于首次使用本网页钱包的用户,需要初始化本钱包,点击按钮初始化钱包/新增一对公私钥,此时会有助记词出现,按提示操作即可,除此以外,你还可以通过导入助记词来初始化钱包,点击按钮通过导入助记词初始化钱包,按提示操作即可;
- 进入**账户管理**一栏中的**密钥**子栏目
- 对于首次使用本网页钱包的用户,需要初始化本钱包,点击按钮**初始化钱包/新增一对公私钥**,此时会有助记词出现,按提示操作即可,除此以外,你还可以通过导入助记词来初始化钱包,点击按钮**通过导入助记词初始化钱包**,按提示操作即可;
- 钱包初始化完成后,还可以使用直接导入私钥、导入keystore等操作,用于钱包之间的账号转移;
- 当密钥部分有公私钥后,便可进入“账号”子栏目开始创建账号,对于首次之前没有任何账号的用户,需要向官方或是其他有账号的用户获取帮助,帮您创建一个账号,您只要将账号名和账号需要绑定的公钥告知对方即可,对方就能帮您创建账号,切记不要告知对方您的私钥,当对方把账号创建好后,您便可导入账号,进而对此账号做一些操作。
- 当密钥部分有公私钥后,便可进入**账号**子栏目开始创建账号,对于首次之前没有任何账号的用户,需要向官方或是其他有账号的用户获取帮助,帮您创建一个账号,您只要将账号名和账号需要绑定的公钥告知对方即可,对方就能帮您创建账号,切记不要告知对方您的私钥,当对方把账号创建好后,您便可导入账号,进而对此账号做一些操作。
170 changes: 158 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import cookie from 'react-cookies';
import { encode } from 'rlp';
import { Feedback } from '@icedesign/base';
import * as utils from '../utils/utils';

let provider = 'http://127.0.0.1:8545';
import { BASE_URL } from '../utils/constant';

async function postToNode(dataToNode) {
return fetch(provider, {headers: { "Content-Type": "application/json" }, method: 'POST', body: dataToNode});
return fetch(BASE_URL, {headers: { "Content-Type": "application/json" }, method: 'POST', body: dataToNode});
// const data = await response.json();
// if (data.data.error != null) {
// throw data.data.error.message;
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import '@icedesign/base/reset.scss';

import router from './router';
import configureStore from './configureStore';
import { BASE_URL } from './utils/constant';

// Create redux store with history
const initialState = {};
const history = createHashHistory();
const store = configureStore(initialState, history);
const ICE_CONTAINER = document.getElementById('ice-container');
axios.defaults.headers.post['Content-Type'] = 'application/json';
axios.defaults.baseURL = 'http://127.0.0.1:8545';
axios.defaults.baseURL = BASE_URL;
const nodeInfo = cookie.load('nodeInfo');
if (nodeInfo != null && nodeInfo !== '') {
axios.defaults.baseURL = nodeInfo;
Expand Down
6 changes: 6 additions & 0 deletions src/utils/constant.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* 默认链接本地节点(http://127.0.0.1:8545)
* 如需链接FT公链的测试网络请更改链接为:http://node.pub-fractal.com
*/
export const BASE_URL = 'http://127.0.0.1:8545';

export const CALL_CONTRACT = 0;
export const CREATE_CONTRACT = 1;

Expand Down