Este mini-guia compreende as ferramentas necessárias para executar contratos com o Mist e desenvolver Dapps utilizando uma rede local privada.
- Instalar Mist
| // In app.js or main.js or whatever: | |
| // var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']); | |
| // This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17). | |
| myApp.filter('percentage', ['$filter', function ($filter) { | |
| return function (input, decimals) { | |
| return $filter('number')(input * 100, decimals) + '%'; | |
| }; | |
| }]); |
| var myFunc = require("./myFunc"); | |
| (function bar(){ | |
| myFunc("bar message"); | |
| })(); |
| # Version key/value should be on his own line | |
| PACKAGE_VERSION=$(cat package.json \ | |
| | grep version \ | |
| | head -1 \ | |
| | awk -F: '{ print $2 }' \ | |
| | sed 's/[",]//g') | |
| echo $PACKAGE_VERSION |
| #!/bin/bash | |
| # Upload a file informed to gist.github.com. Before use, install gist 'gem install gist' - https://github.com/defunkt/gist and login with gist --login | |
| if [ -z $1 ]; then | |
| echo "File not informed. E.G: 'gist-upload file1.txt'" | |
| exit 0 | |
| fi | |
| FILE=$1 | |
| BASENAME=$(basename -- $1) |
| source "https://rubygems.org" | |
| gem 'eventmachine' | |
| gem 'sinatra' | |
| gem 'yajl-ruby', require: 'yajl' | |
| gem 'thin' | |
| gem 'em-websocket' |
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found
/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
| #!/bin/bash | |
| time for ((i=1;i<=300;i++)); do \ | |
| curl --silent -X POST \ | |
| --happy-eyeballs-timeout-ms \ | |
| -d'{"numero_conta": 1, "cpf": "12000", "valor_saldo": 1000000000.0, "nome_titular": "Zé pilintra"}' \ | |
| -H "Content-Type: application/json" \ | |
| http://localhost:8080/exemplo/contacorrente > /dev/null 2>&1 ; \ | |
| done |