asimov

command module
v0.0.0-...-7ee7fde Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

README

Asimov

Official Go implementation of the Asimov protocol https://asimov.network

Getting Started With Asimov

This document will introduce how to develop simple contracts and deploying to Asimov blockchain in few minutes.

Try Asimov

Your can start a solo instance of asimov node for the usage of development. The following programs is currently available for macOS and Linux.

  • Asimov Full Node asimovd

Asimov Full Node

Download the package from https://asimov.network/wallet , where there is a link named 'Download Asimov Fullnode'

This zip file contains eight parts

  • Full Node asimovd
  • Sample Configuration asimovd.sample.conf
  • genesis json `genesis.json
  • Genesis block testnet.block
  • Tool wallet
  • Tool autotx
  • Readme README.md
  • Check Sum md5.md

Prepare Workspace

It requires a directory to run asimovd node, and to store data. The block chain takes several GB, so this location must have a lot of free space.

The default is ~/.asimovd on POSIX OSes, $LOCALAPPDATA/Asimovd on Windows, ~/Library/Application Support/Asimovd on Mac OS, and ​$home/asimovd on Plan9. Environment variables are expanded so they may be used. NOTE: Windows environment variables are typically %VARIABLE%, but they must be accessed with $VARIABLE here. Also, ~ is expanded to ​$HOME path.

You can also use a self defined directory, which was already created.

Run the node:

Run the node on default workspace

./asimovd

Run the node on self defined directory

./asimovd homeDir <Your Dir>

Then, you may see some error like this Check the config file <Your Dir>/Asimovd/asimovd.conf: stat <Your Dir>/Asimovd/asimovd.conf: no such file or directory It means you need make a configuration file for the node.

cd <Your Dir>
mkdir Asimovd
cd Asimovd

copy asimovd.sample.conf, genesis.json and testnet.block file into Asimovd directory.

Config asimovd.conf in your working path.
cp asimovd.sample.conf asimovd.conf

Edit asimovd.conf file as follows:

; devnet,testnet,regtest,simnet
testnet=1
; solo,poa,satoshiplus
consensustype=satoshiplus
privatekey=<your_privatekey_can_generate_by_wallet>

Generate your private key.

generate your privatekey using wallet:

./wallet -c genKey -n test
  New key pair (priv, pubkey) (format:hex)
      { 0xf57dcd236c78368d64eb455b35d98c6d676394a1bb246f88fddd4d9103132729 , 0x020e470848be43cc2a9927af3ea9919e36a1e1b3319bc3845a31e1dcb5bcde79b8 }
      Compressed pubkey hash address: 0x664ceee539d3d5314824750b5f164cd8f8f87109b4
  Bitcoin base58check encode secret:  cVouSDdm3zVvTg5DuBqFaatghYQ1cApyEYBSdoSAyscmTCB5CK55
  Bitcoin legacy type address:  mnXjqNr44AbA5HbxbySBqf7b8Ho37Wqpv6
  Bitcoin p2sh-segwit type address:  2N1unojExgURPZ56sgwHetWVMsWqFPZD2wS
  Bitcoin bech32 type address:  tb1qfnhw2wwn65c5sfr4pd03vnxclru8zzd50s8fcy

Source code Project

Clone Source code
go get github.com/AsimovNetwork/asimov
Install Dependencies:
govendor sync
Prepare config

Same as above configuration section.

Toolchain

visit online Developer Center to use the web IDE for asimov blockchain contract development.

Or clone and build source code(The code will be open source soon):

git clone https://github.com/AsimovNetwork/developer.git
npm install
npm run serve

Start the node

After prepare workspace and configuration. Now you can start the node

Cleanup

You can cleanup the state data when you want to reset all the states of the test blockchain.

# stop asimovd
cd <Your Dir>/Asimovd/
rm -rf data state logs
# restart asimov

Asimov Testnet

Asimov Testnet is now available for developers.

Every one can connect the testnet with AsiLink and Web IDE.

Wallet and Account

Using AsiLink Chrome Extension to manager your wallet and account.

Documentation

Overview

asimovd is a full-node asimov implementation written in Go.

The default options are sane for most users. This means asimovd will work out of the box' for most users. However, there are also a wide variety of flags that can be used to control it.

The following section provides a usage overview which enumerates the flags. An interesting point to note is that the long form of all of these options (except -C) can be specified in a configuration file that is automatically parsed when asimovd starts up. By default, the configuration file is located at ~/.asimovd/asimovd.conf on POSIX-style operating systems, %LOCALAPPDATA%\Asimovd\asimovd.conf on Windows, ~/Library/Application Support/Asimovd/asimovd.conf on Mac OS, and $home/asimovd/asimovd.conf on Plan9. The -C (--configfile) flag, as shown below, can be used to override this location.

Usage:

asimovd [OPTIONS]

Application Options:

-V, --version             Display version information and exit
-C, --configfile=         Path to configuration file
-b, --datadir=            Directory to store data
    --logdir=             Directory to logger output.
    --statedir=           Directory to store state.
-a, --addpeer=            Add a peer to connect with at startup
    --connect=            Connect only to the specified peers at startup
    --nolisten            Disable listening for incoming connections -- NOTE:
                          Listening is automatically disabled if the --connect
                          or --proxy options are used without also specifying
                          listen interfaces via --listen
    --listen=             Add an interface/port to listen for connections
                          (default all interfaces port: 8333, testnet: 18333)
    --maxpeers=           Max number of inbound and outbound peers (125)
    --nobanning           Disable banning of misbehaving peers
    --banduration=        How long to ban misbehaving peers.  Valid time units
                          are {s, m, h}.  Minimum 1 second (24h0m0s)
    --banthreshold=       Maximum allowed ban score before disconnecting and
                          banning misbehaving peers.
    --whitelist=          Add an IP network or IP that will not be banned.
                          (eg. 192.168.1.0/24 or ::1)
-u, --rpcuser=            Username for RPC connections
-P, --rpcpass=            Password for RPC connections
    --rpclimituser=       Username for limited RPC connections
    --rpclimitpass=       Password for limited RPC connections
    --rpccert=            File containing the certificate file
    --rpckey=             File containing the certificate key
    --rpcmaxclients=      Max number of RPC clients for standard connections
                          (10)
    --rpcmaxwebsockets=   Max number of RPC websocket connections (25)
    --norpc               Disable built-in RPC server -- NOTE: The RPC server
                          is disabled by default if no rpcuser/rpcpass or
                          rpclimituser/rpclimitpass is specified
    --notls               Disable TLS for the RPC server -- NOTE: This is only
                          allowed if the RPC server is bound to localhost
    --nodnsseed           Disable DNS seeding for peers
    --externalip=         Add an ip to the list of local addresses we claim to
                          listen on to peers
    --proxy=              Connect via SOCKS5 proxy (eg. 127.0.0.1:9050)
    --proxyuser=          Username for proxy server
    --proxypass=          Password for proxy server
    --onion=              Connect to tor hidden services via SOCKS5 proxy
                          (eg. 127.0.0.1:9050)
    --onionuser=          Username for onion proxy server
    --onionpass=          Password for onion proxy server
    --noonion             Disable connecting to tor hidden services
    --torisolation        Enable Tor stream isolation by randomizing user
                          credentials for each connection.
    --testnet             Use the test network
    --regtest             Use the regression test network
    --simnet              Use the simulation test network
    --addcheckpoint=      Add a custom checkpoint.  Format: '<height>:<hash>'
    --nocheckpoints       Disable built-in checkpoints.  Don't do this unless
                          you know what you're doing.
    --uacomment=          Comment to add to the user agent --
                          See BIP 14 for more information.
    --dbtype=             Database backend to use for the Block Chain (ffldb)
    --profile=            Enable HTTP profiling on given port -- NOTE port
                          must be between 1024 and 65536
    --cpuprofile=         Write CPU profile to the specified file
-d, --debuglevel=         Logging level for all subsystems {trace, debug,
                          info, warn, error, critical} -- You may also specify
                          <subsystem>=<level>,<subsystem2>=<level>,... to set
                          the logger level for individual subsystems -- Use show
                          to list available subsystems (info)
    --upnp                Use UPnP to map our listening port outside of NAT
    --maxorphantx=        Max number of orphan transactions to keep in memory
                          (100)
    --nopeerbloomfilters  Disable bloom filtering support.
    --nocfilters          Disable committed filtering (CF) support.
    --blocksonly          Do not accept transactions from remote peers.

Help Options:

-h, --help           Show this help message

Directories

Path Synopsis
gcs
vrf
txo
cmd
base58
Package base58 provides an API for working with modified base58 and Base58Check encodings.
Package base58 provides an API for working with modified base58 and Base58Check encodings.
bech32
Package bech32 provides a Go implementation of the bech32 format specified in BIP 173.
Package bech32 provides a Go implementation of the bech32 format specified in BIP 173.
hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.
net
poa
prove of authority.
prove of authority.
bn256
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
bn256/cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
bn256/google
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
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.
dbimpl/ffldb/treap
Package treap implements a treap data structure that is used to hold ordered key/value pairs using a combination of binary search tree and heap semantics.
Package treap implements a treap data structure that is used to hold ordered key/value pairs using a combination of binary search tree and heap semantics.
rpcs
netutil
Package netutil contains extensions to the net package.
Package netutil contains extensions to the net package.
rawdb
Package rawdb contains a collection of low level database accessors.
Package rawdb contains a collection of low level database accessors.
rpc
rpcjson
NOTE: This file is intended to house the RPC commands that are supported by a chain server.
NOTE: This file is intended to house the RPC commands that are supported by a chain server.
Current limitations: - GSS-API authentication is not supported - only SOCKS version 5 is supported - TCP bind and UDP not yet supported Example http client over SOCKS5: proxy := &socks.Proxy{"127.0.0.1:1080"} tr := &http.Transport{ Dial: proxy.Dial, } client := &http.Client{Transport: tr} resp, err := client.Get("https://example.com")
Current limitations: - GSS-API authentication is not supported - only SOCKS version 5 is supported - TCP bind and UDP not yet supported Example http client over SOCKS5: proxy := &socks.Proxy{"127.0.0.1:1080"} tr := &http.Transport{ Dial: proxy.Dial, } client := &http.Client{Transport: tr} resp, err := client.Get("https://example.com")
vm
fvm
Package ethereum defines interfaces for interacting with Ethereum.
Package ethereum defines interfaces for interacting with Ethereum.
fvm/abi
Package abi implements the Ethereum ABI (Application Binary Interface).
Package abi implements the Ethereum ABI (Application Binary Interface).
fvm/core/vm
Package virtual-machine implements the Ethereum Virtual Machine.
Package virtual-machine implements the Ethereum Virtual Machine.
fvm/event
Package event deals with subscriptions to real-time events.
Package event deals with subscriptions to real-time events.
fvm/event/filter
Package filter implements event filters.
Package filter implements event filters.
fvm/log
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
fvm/math
Package math provides integer math utilities.
Package math provides integer math utilities.
fvm/mclock
Package mclock is a wrapper for a monotonic clock source
Package mclock is a wrapper for a monotonic clock source
fvm/metrics
Go port of Coda Hale's Metrics library <https://github.com/rcrowley/go-metrics> Coda Hale's original work: <https://github.com/codahale/metrics>
Go port of Coda Hale's Metrics library <https://github.com/rcrowley/go-metrics> Coda Hale's original work: <https://github.com/codahale/metrics>
fvm/metrics/exp
Hook go-metrics into expvar on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler
Hook go-metrics into expvar on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler
fvm/rlp
Package rlp implements the RLP serialization format.
Package rlp implements the RLP serialization format.
fvm/trie
Package trie implements Merkle Patricia Tries.
Package trie implements Merkle Patricia Tries.

Jump to

Keyboard shortcuts

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