Skip to content

a remote wallet for provider sign service

License

MIT and 2 other licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

filecoin-project/venus-wallet

Repository files navigation

Venus Wallet


  • A remote wallet for Filecoin and supports JsonRPC2.0 call.
  • The project is decoupled from Lotus and Venus independently, and can be called by different implementations of Filecoin.
  • It can dynamically configure strategy to limit the signature rules of the Wallet group.
  • Through the configuration of signature strategy, it can achieve environmental isolation of different wallet groups

Use Venus Issues for reporting issues about this repository.


Get Started

1. Build

export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__"
export CGO_CFLAGS="-D__BLST_PORTABLE__"

make 
  • If the test or target application crashes with an "illegal instruction" exception [after copying to an older system], rebuild with CGO_CFLAGS environment variable set to -O -D__BLST_PORTABLE__. Don't forget -O!

2. Setup

# start daemon
$ ./venus-wallet run

# set password to protect wallet security (Used for AES encryption, private key, root token seed)
$ ./venus-wallet set-password
Password:******
Enter Password again:******

3. Get remote connect string

JWT Token restricts access to RPC interface calls

# --perm 
# "read","write","sign","admin" 
./venus-wallet auth api-info --perm admin

4. Get strategy token

  • Strategy token restricts the authority of business execution
  • How to generate strategy token for remote service Venus wallet cli
  • URL append strategy token <JWT token>:/ip4/0.0.0.0/tcp/5678/http:<Strategy token>

Once we have a connection string, we can connect to the remote wallet through it.



Config

[API]
ListenAddress = "/ip4/0.0.0.0/tcp/5678/http"

[DB]
Conn = "[homePath]/keystore.sqlit"
Type = "sqlite"
DebugMode = true

[Factor]
# aes variable
ScryptN = 262144
ScryptP = 1

[JWT]
#  hex JWT token, generate by secret
Token = "" 
# hex JWT secret, randam generate first init
Secret = ""

Package concept

+-- api // RPC service interface permission setting
|
+-- build // dependency injection
|
+-- cli  // shell cmd
|
+-- cmd  // service startup entry
|
+-- config // config provider
|
+-- core // constant 
|
+-- crypto // private key 
|
+-- filemgr // local file manager, Ps:config,database
|
+-- log // log set
|
+-- middeleware // middleware such as link tracking, data reporting
|
+-- signature // signature verification
|
+-- sotrage // the wallet keystore implementation
|
+-- version // git version by ldflags