You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mygithub.libinneed.workers.dev/wealdtech/go-eth2-wallet-store-filesystem

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mygithub.libinneed.workers.dev/wealdtech/go-eth2-wallet-store-filesystem

v1.18.1
Go
Version published
Created
Source

go-eth2-wallet-store-filesystem

Tag License GoDoc Travis CI codecov.io Go Report Card

Filesystem-based store for the Ethereum 2 wallet.

Table of Contents

Install

go-eth2-wallet-store-filesystem is a standard Go module which can be installed with:

go get github.com/wealdtech/go-eth2-wallet-store-filesystem

Usage

In normal operation this module should not be used directly. Instead, it should be configured to be used as part of go-eth2-wallet.

The filesystem store has the following options:

  • location: the base directory in which to store wallets. If this is not configured it defaults to a sensible operating system-specific values:
    • for Linux: $HOME/.config/ethereum2/wallets
    • for OSX: $HOME/Library/Application Support/ethereum2/wallets
    • for Windows: %APPDATA%\ethereum2\wallets
  • passphrase: a key used to encrypt all data written to the store. If this is not configured data is written to the store unencrypted (although wallet- and account-specific private information may be protected by their own passphrases)

Example

package main

import (
	e2wallet "github.com/wealdtech/go-eth2-wallet"
	filesystem "github.com/wealdtech/go-eth2-wallet-store-filesystem"
)

func main() {
    // Set up and use a simple store
    store := filesystem.New()
    e2wallet.UseStore(store)

    // Set up and use an encrypted store
    store := filesystem.New(filesystem.WithPassphrase([]byte("my secret")))
    e2wallet.UseStore(store)

    // Set up and use an encrypted store at a custom location
    store := filesystem.New(filesystem.WithPassphrase([]byte("my secret")), filesystem.WithLocation("/home/user/wallets"))
    e2wallet.UseStore(store)

    // Use e2wallet operations as normal.
}

Maintainers

Jim McDonald: @mcdee.

Contribute

Contributions welcome. Please check out the issues.

License

Apache-2.0 © 2019 Weald Technology Trading Ltd

FAQs

Package last updated on 01 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts