GithubHelp home page GithubHelp logo

isabella232 / keyserver-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terra-money/keyserver

0.0 0.0 0.0 138 KB

A small server to generate and manage keys as well as provide basic signing operations

License: Apache License 2.0

Java 13.83% Go 80.39% Makefile 3.90% Dockerfile 1.88%

keyserver-1's Introduction

Keyserver

This is a basic keyserver for terra applications. It contains the following routes:

GET     /version
GET     /keys
POST    /keys
GET     /keys/{name}?bech=acc
PUT     /keys/{name}
DELETE  /keys/{name}
POST    /tx/sign
POST    /tx/bank/send
POST    /tx/broadcast

First, build and start the server:

> make install
> keyserver config
> keyserver serve

Then you can use the included CLI to create keys, use the mnemonics to create them in terracli as well:

# Create a new key with generated mnemonic
> keyserver keys post yun foobarbaz | jq

# Create another key
> keyserver keys post jim foobarbaz | jq

# Save the mnemonic from the above command and add it to terracli
> terracli keys add yun --recover

# Next create a single node testnet
> terrad init testing --chain-id testing
> terracli config chain-id testing
> terrad add-genesis-account yun 10000000000stake
> terrad add-genesis-account $(keyserver keys show jim | jq -r .address) 100000000stake
> terrad gentx --name yun
> terrad collect-gentxs
> terrad start

In another window, generate the transaction to sign, sign it and broadcast:

> mkdir -p test_data
> keyserver tx bank send $(keyserver keys show yun | jq -r .address) $(keyserver keys show jim | jq -r .address) 10000stake testing "memo" 10stake 1.4 > test_data/unsigned.json
> keyserver tx sign yun foobarbaz testing 0 1 test_data/unsigned.json > test_data/signed.json
> keyserver tx broadcast test_data/signed.json
{"height":"0","txhash":"84CEF8B7FD04DA6FE9C22A6077D8286FA7775CAA0BB06D1D875AE9527A3D15CB"}
> terracli q txs 84CEF8B7FD04DA6FE9C22A6077D8286FA7775CAA0BB06D1D875AE9527A3D15CB

keyserver-1's People

Contributors

jackzampolin avatar yun-yeo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.