Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

I0415 11:27:07.409732 63491 backend.go:184] Protocol Version: 60, Network Id: 0
I0415 11:27:07.409872 63491 backend.go:194] Blockchain DB Version: 1
I0415 11:27:07.411236 63491 chain_manager.go:186] Last block (#45520) ed690e93128a63018c57f24271cee02a8c3215ec883325e396e3f339cb50b3ad TD=51002962928
I0415 11:27:07.769282 63491 ethash.go:94] Making cache
I0415 11:27:08.775832 63491 ethash.go:99] Took: 1.006490066s
I0415 11:27:08.780872 63491 cmd.go:116] Starting Geth/v0.9.9/darwin/go1.4.2
I0415 11:27:08.780964 63491 server.go:183] Starting Server
I0415 11:27:09.397678 63491 nat.go:94] mapping error: no devices discovered
I0415 11:27:09.397785 63491 udp.go:157] Listening, enode://e07b11e79c6c927b654958b4feff613a1879945f32f88e612ff2ae74b35500bff9482f8e5c02f4efce0d763aca0ca45055210fdb1841c773397992aff84e9c80@[::]:30303
I0415 11:27:09.398019 63491 blockpool.go:276] Blockpool started
I0415 11:27:07.409732 63491 backend.go:184] Protocol Version: 60, Network Id: 0
I0415 11:27:07.409872 63491 backend.go:194] Blockchain DB Version: 1
I0415 11:27:07.411236 63491 chain_manager.go:186] Last block (#45520) ed690e93128a63018c57f24271cee02a8c3215ec883325e396e3f339cb50b3ad TD=51002962928
I0415 11:27:07.769282 63491 ethash.go:94] Making cache
I0415 11:27:08.775832 63491 ethash.go:99] Took: 1.006490066s
I0415 11:27:08.780872 63491 cmd.go:116] Starting Geth/v0.9.9/darwin/go1.4.2
I0415 11:27:08.780964 63491 server.go:183] Starting Server
I0415 11:27:09.397678 63491 nat.go:94] mapping error: no devices discovered
I0415 11:27:09.397785 63491 udp.go:157] Listening, enode://e07b11e79c6c927b654958b4feff613a1879945f32f88e612ff2ae74b35500bff9482f8e5c02f4efce0d763aca0ca45055210fdb1841c773397992aff84e9c80@[::]:30303
I0415 11:27:09.398019 63491 blockpool.go:276] Blockpool started
goroutine 35766 [running]:
runtime/pprof.writeGoroutineStacks(0x9a43248, 0xc22b61f4a0, 0x0, 0x0)
/usr/local/go/src/runtime/pprof/pprof.go:511 +0x8d
runtime/pprof.writeGoroutine(0x9a43248, 0xc22b61f4a0, 0x2, 0x0, 0x0)
/usr/local/go/src/runtime/pprof/pprof.go:500 +0x4f
runtime/pprof.(*Profile).WriteTo(0x4cb40e0, 0x9a43248, 0xc22b61f4a0, 0x2, 0x0, 0x0)
/usr/local/go/src/runtime/pprof/pprof.go:229 +0xd5
net/http/pprof.handler.ServeHTTP(0xc22ad1f3f1, 0x9, 0x9a431e8, 0xc22b61f4a0, 0xc2255bfe10)
/usr/local/go/src/net/http/pprof/pprof.go:169 +0x35f
net/http/pprof.Index(0x9a431e8, 0xc22b61f4a0, 0xc2255bfe10)
@bas-vk
bas-vk / gist:9b454d4892078bc2e7c6
Created November 27, 2015 08:58
Experimental RPC
# this is experimental software, expect problems and use on your own risk!
It contains most of the official RPC API methods (https://github.com/ethereum/wiki/wiki/JSON-RPC).
The db_getXXX and db_setXXX methods are removed and will not be implemented.
Checkout: https://github.com/bas-vk/go-ethereum/tree/jsonrpc
Start the geth node with the `--ipcexp` flag. This will start the IPC endpoint with the new RPC implementation.
New is support for push notification by creating a subsription on a particular event.
@bas-vk
bas-vk / rpc.md
Last active November 30, 2015 15:09
New RPC integration

Introduce a new type Api in the rpc package:

// Api describes the set of methods offered over the RPC interface
type Api struct {
  Namespace string     // namespace under which the rpc methods of Service are exposed
  Version string       // api version for DApp's
  Service interface{}  // receiver instance which holds the methods
  Public bool          // indication if the methods must be considered safe for public use
}
@bas-vk
bas-vk / storage.js
Created June 30, 2016 16:09
eth_getStorageAt
var Web3 = require('web3');
var web3 = new Web3();
var key = Buffer.from("000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298", "hex");
var pos = Buffer.from("0000000000000000000000000000000000000000000000000000000000000001", "hex");
var key = Buffer.concat([key, pos], key.length + pos.length).toString("hex");
var options = {encoding: "hex"};
var position = web3.sha3(key, options);
var WebSocketClient = require('websocket').client;
var client = new WebSocketClient();
client.on('connectFailed', function(error) {
console.log('Connect Error: ' + error.toString());
});
client.on('connect', function(connection) {
//console.log('WebSocket Client Connected');
Are these necessary? They can be implemented fairly easy by a client that needs it. If so can we use uint for the index.
TransactionInBlock(ctx context.Context, blockHash common.Hash, index int) (*types.Transaction, error)
ReceiptInBlock(ctx context.Context, blockHash common.Hash, index int) (*types.Receipt, error)
BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
PendingBalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
Instead of adding a special method for pending can't we just use the block number to specify pending?
Currently we have -1 and -2 to indicate the pending and latest block in the RPC interface.
package main
import (
"context"
"fmt"
"math/big"
"strings"
"time"
"encoding/json"
package main
import (
"context"
"log"
"math/big"
"strings"
"time"
ethereum "github.com/ethereum/go-ethereum"