openwallet

command module
v2.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

README

OpenWallet

Slack

Contents

Introduction

openwallet框架定义了一套规范化的钱包体系开发模型,应用开发者无需了解区块链底层协议,即可支持多种区块链资产管理功能。 区块链底层协议开发者也可以实现openwallet框架资产适配器协议,开发者便可利用该区块链生态实现更多落地应用。 openwallet框架,未来将进化成为一个去中心化系统开发框架,跟随不断发展的区块链生态,提供更多应用开发组件库。

Features

v1

细节上,openwallet框架有以下特性:

  • 规范化的钱包体系模型。我们把钱包体系划分为3层模型:钱包,资产账户,地址。钱包:理论上就是一个32字节的种子,可通过用户口令加密保存keystore文件。种子相当重要,它基于BIP32协议衍生子代密钥,丢失将失去所有子代密钥。资产账户:一个钱包可以创建不同区块链协议的资产账户。这是因为openwallet的扩展密钥算法已经实现了多种ECC曲线的支持,例如:secp256k1,ed25519等。资产账户主要提供一个非强化版的扩展公钥,用于生成更多的地址。地址:真正用于接收区块链资产的是地址模型。业务应用可以根据需求去组织自己的钱包。例如:普通用户创建一个onchain钱包,他分别创建了多种区块链的资产账户,账户默认都只创建一个地址,解决各种支付方式。
  • 区块链资产适配器协议。区块链协议各有不同,如果应用开发者把每种区块链协议都弄明白并实现落地应用,将会是一个漫长艰难复杂的开发过程。经过多时间的研究,openwallet钱包体系模型适用于大量主流的区块链协议。为此,我们定义一个规范化的区块链资产适配器协议,让区块链协议适配者实现:主链基本信息,配置加载过程,地址解析器,交易单解析器,区块链扫描器,智能合约解析器,日志管理工具等等方法。区块链资产适配器实现后,可通过openw包提供的功能进行测试。
  • OWTP通信协议。openwallet定义自己的加密通信协议,内置SM2协商密码机制,可以在非https环境下开启加密通信。
v2

兼容v1功能,扩展智能合约解析器,支持与合约进行交互,监听合约的事件日志。

openwallet V2升级

v2版本完全兼容v1版本,只需在go.mod中依赖v2最新版本


require (
    github.com/blocktree/openwallet/v2 latest
    ....
)

已依赖v1库的项目,可以安装Mod


GO111MODULE=on go get github.com/marwan-at-work/mod/cmd/mod

# 在你的项目的根目录,执行命令,import openwallet库相关的文件都会更新到v2包
mod upgrade --mod-name=github.com/blocktree/openwallet

Resources

Assets-Adapter 区块链资产适配器
v1
v2
钱包开发者平台

Contributing

如果你对项目有非常感兴趣,可创建issue 分享你的想法和创意。

Sponsors

License

openwallet is licensed under the GNU General Public License v3.0. See LICENSE for the full license text.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
sia
cmd
wmd
file
Package file provides simple utility functions to be used with files
Package file provides simple utility functions to be used with files
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
owtp全称OpenWallet Transfer Protocol,OpenWallet的一种点对点的分布式私有通信协议。
owtp全称OpenWallet Transfer Protocol,OpenWallet的一种点对点的分布式私有通信协议。
Package session provider Usage: import( "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("memory", `{"cookieName":"gosessionid", "enableSetCookie,omitempty": true, "gclifetime":3600, "maxLifetime": 3600, "secure": false, "cookieLifeTime": 3600, "providerConfig": ""}`) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
Package session provider Usage: import( "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("memory", `{"cookieName":"gosessionid", "enableSetCookie,omitempty": true, "gclifetime":3600, "maxLifetime": 3600, "secure": false, "cookieLifeTime": 3600, "providerConfig": ""}`) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
couchbase
Package couchbase for session provider depend on github.com/couchbaselabs/go-couchbasee go install github.com/couchbaselabs/go-couchbase Usage: import( _ "github.com/astaxie/beego/session/couchbase" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("couchbase", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"http://host:port/, Pool, Bucket"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
Package couchbase for session provider depend on github.com/couchbaselabs/go-couchbasee go install github.com/couchbaselabs/go-couchbase Usage: import( _ "github.com/astaxie/beego/session/couchbase" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("couchbase", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"http://host:port/, Pool, Bucket"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
ledis
Package ledis provide session Provider
Package ledis provide session Provider
memcache
Package memcache for session provider depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/astaxie/beego/session/memcache" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("memcache", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:11211"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
Package memcache for session provider depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/astaxie/beego/session/memcache" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("memcache", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:11211"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
mysql
Package mysql for session provider depends on github.com/go-sql-driver/mysql: go install github.com/go-sql-driver/mysql mysql session support need create table as sql: CREATE TABLE `session` ( `session_key` char(64) NOT NULL, `session_data` blob, `session_expiry` int(11) unsigned NOT NULL, PRIMARY KEY (`session_key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Usage: import( _ "github.com/astaxie/beego/session/mysql" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("mysql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
Package mysql for session provider depends on github.com/go-sql-driver/mysql: go install github.com/go-sql-driver/mysql mysql session support need create table as sql: CREATE TABLE `session` ( `session_key` char(64) NOT NULL, `session_data` blob, `session_expiry` int(11) unsigned NOT NULL, PRIMARY KEY (`session_key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Usage: import( _ "github.com/astaxie/beego/session/mysql" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("mysql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
postgres
Package postgres for session provider depends on github.com/lib/pq: go install github.com/lib/pq needs this table in your database: CREATE TABLE session ( session_key char(64) NOT NULL, session_data bytea, session_expiry timestamp NOT NULL, CONSTRAINT session_key PRIMARY KEY(session_key) ); will be activated with these settings in app.conf: SessionOn = true SessionProvider = postgresql SessionSavePath = "user=a password=b dbname=c sslmode=disable" SessionName = session Usage: import( _ "github.com/astaxie/beego/session/postgresql" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("postgresql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"user=pqgotest dbname=pqgotest sslmode=verify-full"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
Package postgres for session provider depends on github.com/lib/pq: go install github.com/lib/pq needs this table in your database: CREATE TABLE session ( session_key char(64) NOT NULL, session_data bytea, session_expiry timestamp NOT NULL, CONSTRAINT session_key PRIMARY KEY(session_key) ); will be activated with these settings in app.conf: SessionOn = true SessionProvider = postgresql SessionSavePath = "user=a password=b dbname=c sslmode=disable" SessionName = session Usage: import( _ "github.com/astaxie/beego/session/postgresql" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("postgresql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"user=pqgotest dbname=pqgotest sslmode=verify-full"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
redis
Package redis for session provider depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/astaxie/beego/session/redis" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("redis", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
Package redis for session provider depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/astaxie/beego/session/redis" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("redis", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
redis_cluster
Package redis for session provider depend on github.com/go-redis/redis go install github.com/go-redis/redis Usage: import( _ "github.com/astaxie/beego/session/redis_cluster" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("redis_cluster", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070;127.0.0.1:7071"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
Package redis for session provider depend on github.com/go-redis/redis go install github.com/go-redis/redis Usage: import( _ "github.com/astaxie/beego/session/redis_cluster" "github.com/astaxie/beego/session" ) func init() { globalSessions, _ = session.NewManager("redis_cluster", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070;127.0.0.1:7071"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL