你是否和我前段时间一样, 苦苦的寻找一款好用的开源以太坊钱包, 你会发现可用都很少, 因为很多钱包说开源, 仅仅是开源部分代码, 现在不需要再找了,
登链钱包完全开源, 登链钱包完全开源, 登链钱包完全开源, 重要的事情说三遍.
再也不用傻乎乎找人开发以太坊钱包了, 直接拿去用吧; 再也不用担心私钥会被上传到别人的服务器上.
<!-- more -->
写在前面
区块链是开放的, 很难想象一个封闭的项目如何产生信任, 开源一直是区块链社区所倡导的行为准则. 我们也希望开源能够降低行业的开发门槛, 吸引更多的开发者和公司能够利用我们的代码, 找到更多落地的应用场景, 一起来推动行业的发展. 同时我们也相信开源可以是产品更加的安全, 我们也邀请专业的区块链安全团队零时科技来为钱包做安全审计.
效果演示
先来看看钱包长什么样吧, 我制作了一个 gif 图片:
<p align="center"> <img src= width="450"> </p>
Gif 图片比较简陋, 见谅见谅, 可以看的出来界面参考了现在的主流钱包, 感谢 imToken 及 ETHWallet,
大家可以戳链接下载 APK 体验, Google play 也已经上架, 正在审核中.
功能介绍
目前版本支持一下功能:
[x] 支持通过生成助记词, Keystore 文件, 私钥 创建钱包账号;
[x] 支持导出钱包账号助记词, 私钥, Keystore 文件;
[x] 账户余额查询及转账功能;
[x] 支持多个钱包账号管理;
[x] 支持 ERC20 代币(余额显示, 转账, 代币币价显示);
[x] 历史交易列表显示;
[x] 二维码扫描, 兼容 imToken 格式;
[x] 支持用法币 (美元和人民币) 实时显示币价;
[x] 支持以太坊官方测试网络 (Infura Koven 及 Ropsten) 及本地测试网络.
功能够全面吧, 尤其是最后一个功能支持以太坊官方测试网络 (Infura Koven 及 Ropsten) 及本地测试网络, 估计是开发者的最爱, 做为开发者的我, 懂你们的痛(可以获取到免费的以太币用于测试).
代码的讲解和相应的课程, 我们后面会陆续放出, 在还没有放出之前, 先提醒大家几个注意的点:
使用本地网络测试的时候注意 Geth 或 Ganache 设置下可接收 RPC 连接的地址, 因为默认情况下只支持本地连接, 这样手机上就无法连接.
显示交易记录功能需要自己搭建一个服务器提供 API 接口, 这个接口来自 TrustWallet, 为了和本应用保持版本一致, 我 Fork 了一份, 地址为 trust-ray, 这个库会解析区块, 并把交易信息存到 MongoDB 数据库里, 然后用 API 提供给客户端使用.
实时币价的显示其实也是使用 trust-ray 提供的接口, trust-ray 使用的是 CoinMarketCap 的数据, 目前使用的是 CoinMarketCap 免费提供的数据, CoinMarketCap 现在有一套新的付费接口, 免费的数据可能在将来会停用, 到时需要使用 CoinMarketCap 的 apikey 来访问.
代码中 ERC20_Contract 目录提供了一个 ERC20 合约给大家部署测试 Token 功能.
其他的代码介绍及环境搭建大家就只有等我的文章了, 大家也可以学习网页钱包开发课程, 课程详细介绍了开发钱包必备的理论知识.
有什么需要的功能, 可以提 issue 或加我微信留言.
对了本项目的 GitHub 地址为: Upchain-wallet, 点 Star 的同学都会发大财, 哈哈哈~~~
参考的开源项目
本钱包在开发是站在巨人的肩膀上完成, 特别感谢以下项目:
- web3j
- bitcoinj
- Trust-wallet
- ETHWallet
- BGAQRCode
- Trust-ray
再啰嗦几句
本次开源也是受到区块链社区的影响, 尤其是 HiBlock 区块链社区一些朋友坚持布道和开源的精神影响.
HiBlock 区块链社区 是国内最大的区块链开发者社区, 社区已经聚集了数千名区块链开发者.
登链钱包是由登链学院出品, 希望大家知道登链学院不单出品优质课程, 我们也为行业发展贡献一份力量, 感谢大家转发.
-- 类目
- create table `product_category` (
- `category_id` int not null auto_increment,
- `category_name` varchar(64) not null comment '类目名字',
- `category_type` int not null comment '类目编号',
- `create_time` timestamp not null default current_timestamp comment '创建时间',
- `update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
- primary key (`category_id`)
- );
-- 商品
- create table `product_info` (
- `product_id` varchar(32) not null,
- `product_name` varchar(64) not null comment '商品名称',
- `product_price` decimal(8,2)www.yihuanyule.cn not null comment '单价',
- `product_stock` int not www.huarenyl.cn null comment '库存',
- `product_description` varchar(64) comment '描述',
- `product_icon` varchar(512) comment '小图',
- `product_status` tinyint(3) DEFAULT '0' COMMENT '商品状态, 0 正常 1 下架',
- `category_type` int not null comment '类目编号',
- `create_time` timestamp not null default current_timestamp comment '创建时间',
- `update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
- primary key (`product_id`)
- );
-- 订单
- create table `order_master` www.taoyang2vip.com (
- `order_id` varchar(32) not null,
- `buyer_name` varchar(32) not null comment '买家名字',
- `buyer_phone` varchar(32)www.myzx1.com not null comment '买家电话',
- `buyer_address` varchar(128) not null comment '买家地址',
- `buyer_openid` varchar(64) not null comment '买家微信 openid',
- `order_amount` decimal(8,2) not null comment '订单总金额',
- `order_status` tinyint(3) not null default '0' comment '订单状态, 默认为新下单',
- `pay_status` tinyint(3) not null default '0' comment '支付状态, 默认未支付',
- `create_time` timestamp not null default current_timestamp comment '创建时间',
- `update_time`www.michenggw.com timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
- primary key (`order_id`),
- key `idx_buyer_openid`www.jiahuayulpt.com (`buyer_openid`)
- );
-- 订单商品
- create table `order_detail` (
- `detail_id` varchar(32)www.ycjszpgs.com not null,
- `order_id` varchar(32) not null,
- `product_id` varchar(32) not null,
- `product_name` varchar(64) not null comment '商品名称',
- `product_price` decimal(8,2)www.dfgjpt.com not null comment '当前价格, 单位分',
- `product_quantity` int not null comment '数量',
- `product_icon` varchar(512) comment '小图',
- `create_time` timestamp not null default current_timestamp comment '创建时间',
- `update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
- primary key (`detail_id`),
- key `idx_order_id` (`order_id`)
- );
-- 卖家(登录后台使用, 卖家登录之后可能直接采用微信扫码登录, 不使用账号密码)
- create table `seller_info` (
- `seller_id` varchar(32) not null,
- `username` varchar(32) www.dfzx157.com not null,
- `password` varchar(32) not null,
- `openid` varchar(64)www.yongshiyule178.com not www.cmeidi.cn null comment '微信 openid',
- `create_time` timestamp not null default current_timestamp comment '创建时间',
- `update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
- primary key (`seller_id`)
- ) comment '卖家信息表';
来源: http://www.bubuko.com/infodetail-2982366.html