This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker stop $(docker ps -a -q) | |
| docker rm $(docker ps -a -q) | |
| # 移除所有hyperledger chaincode dev container images | |
| docker rmi $(docker images dev-peer* -a -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// npm install web3 --save | |
| var Web3 = require("web3") | |
| var web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:7545")) | |
| web3.eth.getAccounts().then((accounts) => { | |
| console.log("Accounts:"); | |
| console.log(accounts); | |
| }).catch((error) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "os" | |
| "strings" | |
| "github.com/hyperledger/fabric/core/chaincode/shim" | |
| "github.com/hyperledger/fabric/protos/peer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export COMPOSE_CONVERT_WINDOWS_PATHS=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // install test tools | |
| // npm install mocha chai --save | |
| /* | |
| add.js | |
| */ | |
| function add(x, y) { | |
| return x + y; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * app.js | |
| */ | |
| var express = require("express"); | |
| var app = express(); | |
| app.get('/user', function(req, res) { | |
| res.status(200).json({ name: "john" }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| services: | |
| mybox: | |
| image: busybox | |
| container_name: mybox | |
| command: top | |
| # Run: docker-compose up -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker inspect container_name -f "{{json .NetworkSettings.Networks }}" | jq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Undo last commit and KEEP all changes | |
| git reset --soft HEAD~1 | |
| # Undo last commit and REMOVE all changes | |
| git reset --hard HEAD~1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "first-network-org1", | |
| "version": "1.0.0", | |
| "client": { | |
| "organization": "Org1", | |
| "connection": { | |
| "timeout": { | |
| "peer": { | |
| "endorser": "300" | |
| }, |