Code Monkey home page Code Monkey logo

blockchain's Introduction

区块链

公益众筹

  • 支付宝 爱心捐赠 X 蚂蚁区块链
  • 轻众筹 阳光链(阳光公益联盟链)

blockchain's People

Contributors

zhuangjinxin avatar

blockchain's Issues

Welcome to the Geth JavaScript console!

modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

all:

> 
Array                JSON                 String               admin                encodeURI            isNaN                personal             txpool
BigNumber            Math                 SyntaxError          clearInterval        encodeURIComponent   isPrototypeOf        propertyIsEnumerable undefined
Boolean              NaN                  TypeError            clearTimeout         escape               jeth                 require              unescape
Date                 Number               URIError             console              eth                  loadScript           rpc                  valueOf
Error                Object               Web3                 constructor          eval                 miner                setInterval          web3
EvalError            RangeError           XMLHttpRequest       debug                hasOwnProperty       net                  setTimeout
Function             ReferenceError       _setInterval         decodeURI            inspect              parseFloat           toLocaleString
Infinity             RegExp               _setTimeout          decodeURIComponent   isFinite             parseInt             toString

admin:

> admin.
admin.addPeer              admin.getDatadir           admin.importChain          admin.propertyIsEnumerable admin.startRPC             admin.toLocaleString
admin.constructor          admin.getNodeInfo          admin.isPrototypeOf        admin.removePeer           admin.startWS              admin.toString
admin.datadir              admin.getPeers             admin.nodeInfo             admin.sleep                admin.stopRPC              admin.valueOf
admin.exportChain          admin.hasOwnProperty       admin.peers                admin.sleepBlocks          admin.stopWS

debug:

> debug.
debug.backtraceAt                 debug.getBadBlocks                debug.preimage                    debug.startGoTrace                debug.traceBlockFromFile
debug.blockProfile                debug.getBlockRlp                 debug.printBlock                  debug.stopCPUProfile              debug.traceTransaction
debug.chaindbCompact              debug.getModifiedAccountsByHash   debug.propertyIsEnumerable        debug.stopGoTrace                 debug.valueOf
debug.chaindbProperty             debug.getModifiedAccountsByNumber debug.seedHash                    debug.storageRangeAt              debug.verbosity
debug.constructor                 debug.goTrace                     debug.setBlockProfileRate         debug.toLocaleString              debug.vmodule
debug.cpuProfile                  debug.hasOwnProperty              debug.setGCPercent                debug.toString                    debug.writeBlockProfile
debug.dumpBlock                   debug.isPrototypeOf               debug.setHead                     debug.traceBlock                  debug.writeMemProfile
debug.freeOSMemory                debug.memStats                    debug.stacks                      debug.traceBlockByHash
debug.gcStats                     debug.metrics                     debug.startCPUProfile             debug.traceBlockByNumber

eth:

> eth.
eth._requestManager            eth.filter                     eth.getGasPrice                eth.getTransactionFromBlock    eth.protocolVersion
eth.accounts                   eth.gasPrice                   eth.getHashrate                eth.getTransactionReceipt      eth.resend
eth.blockNumber                eth.getAccounts                eth.getMining                  eth.getUncle                   eth.sendIBANTransaction
eth.call                       eth.getBalance                 eth.getPendingTransactions     eth.getWork                    eth.sendRawTransaction
eth.coinbase                   eth.getBlock                   eth.getProtocolVersion         eth.hashrate                   eth.sendTransaction
eth.compile                    eth.getBlockNumber             eth.getRawTransaction          eth.iban                       eth.sign
eth.constructor                eth.getBlockTransactionCount   eth.getRawTransactionFromBlock eth.icapNamereg                eth.signTransaction
eth.contract                   eth.getBlockUncleCount         eth.getStorageAt               eth.isSyncing                  eth.submitTransaction
eth.defaultAccount             eth.getCode                    eth.getSyncing                 eth.mining                     eth.submitWork
eth.defaultBlock               eth.getCoinbase                eth.getTransaction             eth.namereg                    eth.syncing
eth.estimateGas                eth.getCompilers               eth.getTransactionCount        eth.pendingTransactions

miner:

> miner.
miner.constructor          miner.isPrototypeOf        miner.setExtra             miner.stop                 miner.valueOf
miner.getHashrate          miner.propertyIsEnumerable miner.setGasPrice          miner.toLocaleString
miner.hasOwnProperty       miner.setEtherbase         miner.start                miner.toString

net:

> net.
net._requestManager net.constructor net.getListening net.getPeerCount net.getVersion net.listening net.peerCount net.version

personal:

> personal.
personal._requestManager personal.ecRecover       personal.importRawKey    personal.lockAccount     personal.sendTransaction
personal.constructor     personal.getListAccounts personal.listAccounts    personal.newAccount      personal.sign
personal.deriveAccount   personal.getListWallets  personal.listWallets     personal.openWallet      personal.unlockAccount

rpc:

> rpc.
rpc.constructor          rpc.hasOwnProperty       rpc.modules              rpc.toLocaleString       rpc.valueOf
rpc.getModules           rpc.isPrototypeOf        rpc.propertyIsEnumerable rpc.toString

txpool:

> txpool.
txpool.constructor          txpool.getInspect           txpool.inspect              txpool.status               txpool.valueOf
txpool.content              txpool.getStatus            txpool.isPrototypeOf        txpool.toLocaleString
txpool.getContent           txpool.hasOwnProperty       txpool.propertyIsEnumerable txpool.toString

Install Solidity:`brew linkapps` has been deprecated and will eventually be removed!

Install solidity:
http://solidity.readthedocs.io/en/latest/installing-solidity.html#binary-packages

brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity
brew linkapps solidity

最后一步linkapps时警告!

➜  boost brew linkapps solidity
Warning: `brew linkapps` has been deprecated and will eventually be removed!

Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using
either aliases or symlinks and Homebrew formulae do not build "proper" `.app`
bundles that can be relocated. Instead, please consider using `brew cask` and
migrate formulae using `.app`s to casks.

BCOS:ethconsole 命令一览

All

Array                 Boolean               Date                  Error                 EvalError
Function              Infinity              JSON                  Math                  NaN
Number                Object                RangeError            ReferenceError        RegExp
String                SyntaxError           TypeError             URIError              decodeURI
decodeURIComponent    encodeURI             encodeURIComponent    eval                  isFinite
isNaN                 parseFloat            parseInt              undefined

ArrayBuffer           Buffer                DataView              Float32Array          Float64Array
GLOBAL                Int16Array            Int32Array            Int8Array             Intl
Map                   Promise               Proxy                 Reflect               Set
Symbol                Uint16Array           Uint32Array           Uint8Array            Uint8ClampedArray
WeakMap               WeakSet               _                     assert                buffer
child_process         clearImmediate        clearInterval         clearTimeout          cluster
console               crypto                dgram                 dns                   domain
escape                events                fs                    global                http
https                 module                net                   os                    path
proces                process               punycode              querystring           readline
repl                  require               root                  setImmediate          setInterval
setTimeout            stream                string_decoder        tls                   tty
unescape              url                   util                  utils                 v8
vm                    web3                  zlib

web3

__defineGetter__      __defineSetter__      __lookupGetter__      __lookupSetter__      __proto__
constructor           hasOwnProperty        isPrototypeOf         propertyIsEnumerable  toLocaleString
toString              valueOf

web3.__defineGetter__      web3.__defineSetter__      web3.__lookupGetter__      web3.__lookupSetter__
web3.__proto__             web3.constructor           web3.hasOwnProperty        web3.isPrototypeOf
web3.propertyIsEnumerable  web3.toLocaleString        web3.toString              web3.valueOf

web3.createBatch           web3.fromAscii             web3.fromDecimal           web3.fromICAP
web3.fromUtf8              web3.fromWei               web3.isAddress             web3.isChecksumAddress
web3.isConnected           web3.isIBAN                web3.reset                 web3.setProvider
web3.sha3                  web3.toAscii               web3.toBigNumber           web3.toChecksumAddress
web3.toDecimal             web3.toHex                 web3.toUtf8                web3.toWei

web3._extend               web3._requestManager       web3.admin                 web3.currentProvider
web3.db                    web3.debug                 web3.eth                   web3.miner
web3.net                   web3.network               web3.personal              web3.providers
web3.settings              web3.shh                   web3.test                  web3.txpool

Remix运行结果Detail

字段
status 0x1 Transaction mined and execution succeed
from 0xca35b7d915458ef540ade6068dfe2f44e8fa733c
to addressTest.getBalance(address) 0x692a70d2e424a56d2c6c27aa97d1a86395877b3a
gas 3000000 gas
transaction cost 22045 gas
execution cost 645 gas
hash 0xd2156ba7ce3257c133839bad5a85bb3443d39a6cab2175d2d472265b84ca1fdb
input
decoded input { "address addr": "0x0000000000000000000000000000000000000000" }
decoded output { "0": "uint256: 0" }
logs []
value 0 wei

Ethereum: 调用合约时报错 Error: invalid address

> eth.getCode(contractInstance.address)
"0x606060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063c6888fa1146044575b600080fd5b3415604e57600080fd5b606260048080359060200190919050506078565b6040518082815260200191505060405180910390f35b60006002820290509190505600a165627a7a72305820e8e05128db9d00a453de656e71eec1ceec964fb4f0118acce284a379eeee51070029"
> contractInstance.multiply(2)
Error: invalid address
    at web3.js:3930:15
    at web3.js:3756:20
    at web3.js:5025:28
    at map (<native code>)
    at web3.js:5024:12
    at web3.js:5050:18
    at web3.js:5075:23
    at web3.js:4137:16
    at apply (<native code>)
    at web3.js:4223:16

BCOS:sample示例项目导入Eclipse步骤及遇到的问题

项目导入过程:

打开Eclipse,File->Import->General->Existing Project into Workspace->选择sample项目->Finish完成!

如果Eclipse项目比较多,可以在导入项目前或导入项目中建立java workset分组

问题1:

问题描述:导入后一片红,缺少web3j的main包和extension包!
解决办法
右击项目名sample->Build Path->Configure Build Path...->选Libraries->Add JARs->选择sample项目sample/lib目录下的三个包:DfsSDK.jarweb3j-2.1.0.jarweb3j-2.1.0-extension.jarOk->点Apply应用->点Ok确认;项目里的红杠消除,依赖包全部导入!

问题2:

问题描述
运行项目报错The project: web3j-v2.0.1_src which is referenced by the classpath, does not exist.
解决办法
右键项目名simple->Build Path->Configure Build Path->Projects->remove web3j相关的两个项目->Ok确认!

之后,再Run运行Main.java即可!

提供给官方的解决办法:https://github.com/bcosorg/samples/issues/1

geth -help

> geth -help
NAME:
   geth - the go-ethereum command line interface

   Copyright 2013-2017 The go-ethereum Authors

USAGE:
   geth [options] command [command options] [arguments...]

VERSION:
   1.7.3-stable-4bb3c89d

COMMANDS:
   account     Manage accounts
   attach      Start an interactive JavaScript environment (connect to node)
   bug         opens a window to report a bug on the geth repo
   console     Start an interactive JavaScript environment
   copydb      Create a local chain from a target chaindata folder
   dump        Dump a specific block from storage
   dumpconfig  Show configuration values
   export      Export blockchain into file
   import      Import a blockchain file
   init        Bootstrap and initialize a new genesis block
   js          Execute the specified JavaScript files
   license     Display license information
   makecache   Generate ethash verification cache (for testing)
   makedag     Generate ethash mining DAG (for testing)
   monitor     Monitor and visualize node metrics
   removedb    Remove blockchain and state databases
   version     Print version numbers
   wallet      Manage Ethereum presale wallets
   help, h     Shows a list of commands or help for one command

ETHEREUM OPTIONS:
  --config value               TOML configuration file
  --datadir "/root/.ethereum"  Data directory for the databases and keystore
  --keystore                   Directory for the keystore (default = inside the datadir)
  --nousb                      Disables monitoring for and managing USB hardware wallets
  --networkid value            Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby) (default: 1)
  --testnet                    Ropsten network: pre-configured proof-of-work test network
  --rinkeby                    Rinkeby network: pre-configured proof-of-authority test network
  --syncmode "fast"            Blockchain sync mode ("fast", "full", or "light")
  --ethstats value             Reporting URL of a ethstats service (nodename:secret@host:port)
  --identity value             Custom node name
  --lightserv value            Maximum percentage of time allowed for serving LES requests (0-90) (default: 0)
  --lightpeers value           Maximum number of LES client peers (default: 20)
  --lightkdf                   Reduce key-derivation RAM & CPU usage at some expense of KDF strength

DEVELOPER CHAIN OPTIONS:
  --dev               Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
  --dev.period value  Block period to use in developer mode (0 = mine only if transaction pending) (default: 0)

ETHASH OPTIONS:
  --ethash.cachedir                Directory to store the ethash verification caches (default = inside the datadir)
  --ethash.cachesinmem value       Number of recent ethash caches to keep in memory (16MB each) (default: 2)
  --ethash.cachesondisk value      Number of recent ethash caches to keep on disk (16MB each) (default: 3)
  --ethash.dagdir "/root/.ethash"  Directory to store the ethash mining DAGs (default = inside home folder)
  --ethash.dagsinmem value         Number of recent ethash mining DAGs to keep in memory (1+GB each) (default: 1)
  --ethash.dagsondisk value        Number of recent ethash mining DAGs to keep on disk (1+GB each) (default: 2)

TRANSACTION POOL OPTIONS:
  --txpool.nolocals            Disables price exemptions for locally submitted transactions
  --txpool.journal value       Disk journal for local transaction to survive node restarts (default: "transactions.rlp")
  --txpool.rejournal value     Time interval to regenerate the local transaction journal (default: 1h0m0s)
  --txpool.pricelimit value    Minimum gas price limit to enforce for acceptance into the pool (default: 1)
  --txpool.pricebump value     Price bump percentage to replace an already existing transaction (default: 10)
  --txpool.accountslots value  Minimum number of executable transaction slots guaranteed per account (default: 16)
  --txpool.globalslots value   Maximum number of executable transaction slots for all accounts (default: 4096)
  --txpool.accountqueue value  Maximum number of non-executable transaction slots permitted per account (default: 64)
  --txpool.globalqueue value   Maximum number of non-executable transaction slots for all accounts (default: 1024)
  --txpool.lifetime value      Maximum amount of time non-executable transaction are queued (default: 3h0m0s)

PERFORMANCE TUNING OPTIONS:
  --cache value            Megabytes of memory allocated to internal caching (min 16MB / database forced) (default: 128)
  --trie-cache-gens value  Number of trie node generations to keep in memory (default: 120)

ACCOUNT OPTIONS:
  --unlock value    Comma separated list of accounts to unlock
  --password value  Password file to use for non-interactive password input

API AND CONSOLE OPTIONS:
  --rpc                  Enable the HTTP-RPC server
  --rpcaddr value        HTTP-RPC server listening interface (default: "localhost")
  --rpcport value        HTTP-RPC server listening port (default: 8545)
  --rpcapi value         API's offered over the HTTP-RPC interface
  --ws                   Enable the WS-RPC server
  --wsaddr value         WS-RPC server listening interface (default: "localhost")
  --wsport value         WS-RPC server listening port (default: 8546)
  --wsapi value          API's offered over the WS-RPC interface
  --wsorigins value      Origins from which to accept websockets requests
  --ipcdisable           Disable the IPC-RPC server
  --ipcpath              Filename for IPC socket/pipe within the datadir (explicit paths escape it)
  --rpccorsdomain value  Comma separated list of domains from which to accept cross origin requests (browser enforced)
  --jspath loadScript    JavaScript root path for loadScript (default: ".")
  --exec value           Execute JavaScript statement
  --preload value        Comma separated list of JavaScript files to preload into the console

NETWORKING OPTIONS:
  --bootnodes value     Comma separated enode URLs for P2P discovery bootstrap (set v4+v5 instead for light servers)
  --bootnodesv4 value   Comma separated enode URLs for P2P v4 discovery bootstrap (light server, full nodes)
  --bootnodesv5 value   Comma separated enode URLs for P2P v5 discovery bootstrap (light server, light nodes)
  --port value          Network listening port (default: 30303)
  --maxpeers value      Maximum number of network peers (network disabled if set to 0) (default: 25)
  --maxpendpeers value  Maximum number of pending connection attempts (defaults used if set to 0) (default: 0)
  --nat value           NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>) (default: "any")
  --nodiscover          Disables the peer discovery mechanism (manual peer addition)
  --v5disc              Enables the experimental RLPx V5 (Topic Discovery) mechanism
  --netrestrict value   Restricts network communication to the given IP networks (CIDR masks)
  --nodekey value       P2P node key file
  --nodekeyhex value    P2P node key as hex (for testing)

MINER OPTIONS:
  --mine                    Enable mining
  --minerthreads value      Number of CPU threads to use for mining (default: 4)
  --etherbase value         Public address for block mining rewards (default = first account created) (default: "0")
  --targetgaslimit value    Target gas limit sets the artificial target gas floor for the blocks to mine (default: 4712388)
  --gasprice "18000000000"  Minimal gas price to accept for mining a transactions
  --extradata value         Block extra data set by the miner (default = client version)

GAS PRICE ORACLE OPTIONS:
  --gpoblocks value      Number of recent blocks to check for gas prices (default: 10)
  --gpopercentile value  Suggested gas price is the given percentile of a set of recent transaction gas prices (default: 50)

VIRTUAL MACHINE OPTIONS:
  --vmdebug  Record information useful for VM and contract debugging

LOGGING AND DEBUGGING OPTIONS:
  --metrics                 Enable metrics collection and reporting
  --fakepow                 Disables proof-of-work verification
  --nocompaction            Disables db compaction after import
  --verbosity value         Logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: 3)
  --vmodule value           Per-module verbosity: comma-separated list of <pattern>=<level> (e.g. eth/*=5,p2p=4)
  --backtrace value         Request a stack trace at a specific logging statement (e.g. "block.go:271")
  --debug                   Prepends log messages with call-site location (file and line number)
  --pprof                   Enable the pprof HTTP server
  --pprofaddr value         pprof HTTP server listening interface (default: "127.0.0.1")
  --pprofport value         pprof HTTP server listening port (default: 6060)
  --memprofilerate value    Turn on memory profiling with the given rate (default: 524288)
  --blockprofilerate value  Turn on block profiling with the given rate (default: 0)
  --cpuprofile value        Write CPU profile to the given file
  --trace value             Write execution trace to the given file

WHISPER (EXPERIMENTAL) OPTIONS:
  --shh                       Enable Whisper
  --shh.maxmessagesize value  Max message size accepted (default: 1048576)
  --shh.pow value             Minimum POW accepted (default: 0.2)

DEPRECATED OPTIONS:
  --fast   Enable fast syncing through state downloads
  --light  Enable light client mode

MISC OPTIONS:
  --help, -h  show help


COPYRIGHT:
   Copyright 2013-2017 The go-ethereum Authors

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.